[LLVMdev] Alloca Requirements

David Greene dag at cray.com
Tue Oct 13 08:36:06 PDT 2009


On Monday 12 October 2009 22:12, Eli Friedman wrote:
> On Mon, Oct 12, 2009 at 1:07 PM, David Greene <dag at cray.com> wrote:
> > Are there any implicit assumptions about where alloca instructions
> > can appear.
>
> Static allocas should appear as a continuous chunk in the entry block,
> otherwise other passes might make bad assumptions.

Ok, we should document this.

> > The interesting thing about this testcase is that the extra instcombine
> > makes the test pass.  If I omit it, the test fails.  The only differences
> > in the asm are stack offsets, which leads me to believe that in the
> > failing test codegen is not accounting for all allocas properly.
>
> If running a testcase through -instcombine -instcombine gives a result
> that isn't identical to -instcombine, that's a bug.  Please file it if
> you have a reduced testcase.

No, hat's not what I'm doing.  I'm limiting the number of transformations
instcombine does to do a binary search and narrow down on the specific
transformation that causes the problem (or in this case, masks it).

                               -Dave





More information about the llvm-dev mailing list