So in LLVM IR we can create a variable giving it the returned value of an instruction:
%1 = mul i32 %A, %B
But how to create a variable giving it an initial value?
It C++ it would be:
int x = 5;
However this kind of initialization seems not allowed in LLVM IR:
%x = i32 5
llc compiler emits an error:
error: expected instruction opcode
%x = i32 5
^
Does this mean that variables in LLVM IR can only have the returned values of instructions? What if I want to set a variable to some known predefined initial value?
Can it be done without using alloca, without creating a variable on the stack?