[LLVMdev] Alloca Outside of Entry Block

Chris Lattner clattner at apple.com
Thu Aug 14 10:21:19 PDT 2008


On Aug 14, 2008, at 9:30 AM, Eli Friedman wrote:

> On Thu, Aug 14, 2008 at 7:55 AM, John Criswell <criswell at uiuc.edu>  
> wrote:
>> 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.
>
> Yeah, legal, but the performance sucks because it codegens into a call
> to the C library's alloca function.

This is only true for some targets (windows?).  Most targets just  
manipulate the stack pointer inline.

> It's probably worth documenting in LangRef because the difference in
> the generated code is so striking.

This would be fine,

-Chris



More information about the llvm-dev mailing list