[LLVMdev] Alloca Outside of Entry Block

John Criswell criswell at uiuc.edu
Thu Aug 14 07:55:20 PDT 2008


John Criswell wrote:
> Dear All,
>
> Is it legal to have an alloca in a basic block other than a function's
> entry block?
>   
Thanks everyone for the answers.  My original question was referring to 
the LLVM IR and not standard C.

So, the consensus seems to be that it is legal, which makes sense since 
LLVM supports the C alloca function.

FWIW, I'm not inserting allocas into code; rather I'm instrumenting them 
and found a test case where an alloca does not appear in an entry block 
(176.gcc from SPEC2000, if you're curious).  I needed to know whether 
that was an error or whether my instrumentation needs to handle that 
properly.

Thanks again.

-- John T.

> -- John T.
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>   




More information about the llvm-dev mailing list