[LLVMdev] Code Generation and Alloca
clattner at apple.com
Fri Aug 15 11:19:38 CDT 2008
On Aug 15, 2008, at 8:40 AM, John Criswell wrote:
> Dear All,
> I have a question regarding code generation and alloca.
> How important is it to keep allocas in a function's entry block
> Having consecutive allocas probably makes code generation
> more efficient because the code generator can coalesce them into a
> single add/subtract of the stack pointer on function entry. Can the
> code generators now coalesce allocas even if they are not consecutive
> within the basic block, or is it still a good idea to keep allocas
> consecutive when doing transforms?
Don't worry about it. All fixed sized allocas in the entry block are
folded into the stack adjustment done in the prolog.
More information about the LLVMdev