[llvm-dev] alloca

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 5 09:47:50 PDT 2017


On 5 September 2017 at 13:17, Anastasiya Ruzhanskaya via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> is the alloca instruction itself valid input for stores instructions ( and
> maybe some others?). In all realistic examples I encountered it as input only to getelementptr instruction.

It is. Bruce has already covered the address part, but if you're
interested in the value being stored you'd typically see it for code
that stored a local address somewhere (maybe to a global). In
semi-idiomatic C:

int *var;
void foo() {
   int local;
   var = &local; // Produces a store of the "local" alloca to @var
   do_something_with_var();
}

Cheers.

Tim.


More information about the llvm-dev mailing list