[LLVMdev] Removing dead code

Chris Lattner sabre at nondot.org
Fri Jun 30 15:31:12 PDT 2006


On Fri, 30 Jun 2006, Fernando Magno Quintao Pereira wrote:
> where %reg1032 is dead.

Right.  One of the jobs of the register allocator is to coallesce register 
copies.  Once coallesced, they can be removed.

> I'm removing these instructions. In Linear scan, they are removed too. 
> I'm removing all the dead definitions from instructions that are not 
> function calls, and the resulting programs seem to work fine. The ratio

I suggest you do more testing.  For copies, this is clearly fine, but for 
general instructions, it isn't.

> of these instructions is about 1:20, that is, for each 20 instructions 
> (in PPC) the RA could remove 1 dead definition.

Again, how many of these are copies?  We expect that the register 
allocator will make copies dead and remove them.  Are you removing any 
non-copy instructions?

-Chris

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



More information about the llvm-dev mailing list