[LLVMdev] Hoisting elements of array argument into registers

Duncan Sands baldrick at free.fr
Fri Nov 5 09:51:30 PDT 2010


> I see the same with clang.  I'm not sure why the optimizers do so much better
> when they can see that sp is a local array (the special initial values don't
> matter).

It is the scalar replacement of aggregates pass that puts everything into
registers when sp is a local array.  What happens is: the tail recursion in
wf is eliminated.  wf is inlined into g.  scalarrepl turns the (local) array
accesses in g into registers.  Once everything is in registers, later passes
clean everything up.

Ciao,

Duncan.



More information about the llvm-dev mailing list