[LLVMdev] help with phi elimination/ register allocation

Chris Lattner sabre at nondot.org
Fri Nov 18 08:12:43 PST 2005


On Fri, 18 Nov 2005, Abhijit Ray wrote:
> I would like to have the llvm code modified so as to obtain the amount
> of spill code generated, for each basic block.

ok.

> Basically what would be helpful would be something like a code for a
> target which has the same instruction set as LLVM itself. Only extra
> input I would be providing would be the number of registers.

Ok, realize that this is just an approximation though.  Consider 64-bit 
values on a 32-bit host.  These will require twice as many registers to 
hold as 32-bit values.  Anything that just looks at LLVM code will 
underestimate (by half!) the register pressure in these situations.

> The intention is to analyze the type of applications that stress the
> register allocator more.

Why not just takes something like the itanium backend (which has many 
registers) and play around with increasing/reducing the number of 
registers it has?  There is already -stats output telling you the number 
of spills.  This would give you a useful number for a real target.

> Just wanted to know if LLVM already has passes which I can run to get such info.

Not really.

> Towards this end ,after some help on the irc channel , I checked out
> the PHIElimination pass , is it possible to run that pass on the
> bytecode file using

The PHI elimination pass is part of the code generator, it is not an 
llvm-to-llvm transformation.  However, there is the recently committed 
reg2mem pass.  It does not currently eliminate all PHI nodes, but could be 
extended to do so if you desire.  However, I'm not sure why eliminating 
SSA form is useful.  How are you trying to do measurements?

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list