[llvm-commits] [llvm] r122516 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Chris Lattner clattner at apple.com
Fri Dec 24 09:35:18 PST 2010


On Dec 24, 2010, at 8:12 AM, Benjamin Kramer wrote:

> 
> On 23.12.2010, at 21:57, Owen Anderson wrote:
> 
>> Author: resistor
>> Date: Thu Dec 23 14:57:35 2010
>> New Revision: 122516
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=122516&view=rev
>> Log:
>> It is possible for SimplifyCFG to cause PHI nodes to become redundant too late in the optimization
>> pipeline to be caught by instcombine, and it's not feasible to catch them in SimplifyCFG because the
>> use-lists are in an inconsistent state at the point where it could know that it need to simplify them.
>> Instead, have CodeGenPrepare look for trivially redundant PHIs as part of its general cleanup effort.
> 
> Would it hurt much if we ran SimplifyInstruction on all instructions, not just PHIs? I've seen SimplifyCFG
> producing other nonsense like "%y = or i1 false, %x" too.

There is a more general pass ordering issue here, see:
http://llvm.org/bugs/show_bug.cgi?id=2338

For example.  Perhaps the right answer is to just run a pass of instcombine at the end, to make sure things are fully canonicalized going into codegen.

-Chris





More information about the llvm-commits mailing list