[llvm-commits] [llvm] r122596 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp

Cameron Zwarich zwarich at apple.com
Tue Dec 28 15:31:33 PST 2010


On Dec 28, 2010, at 3:08 PM, Jakob Stoklund Olesen wrote:

> On Dec 28, 2010, at 1:38 PM, Cameron Zwarich wrote:
> 
>> Ah, okay. I could check whether the instruction is variadic before bailing out early after the last explicit def, but maybe I should just roll it out for now. 28% is a nice speedup though. ;-)
> 
> Maybe you are going about this the wrong way. The majority of virtual registers are never involved with PHIs, so StrongPHIElimination shouldn't have to look at them at all. Yet, here you are iterating over all operands in the machine code.
> 
> Perhaps you could keep track of the virtual registers that are used or defined by PHI instructions and use their use-def chains instead?

It needs to visit the instructions in dominance order. I guess I could build parallel blocks of instructions containing only the defs of variables appearing in phis. I suspect that the overhead of doing this would exceed any potential benefit.

At first glance, you need to maintain dominance order inside of each basic block as well, but I am pretty sure that the code could be modified to work without this constraint. Maybe I'll try it just to see.

Cameron



More information about the llvm-commits mailing list