[llvm-commits] [llvm] r37851 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Chris Lattner clattner at apple.com
Wed Jul 4 09:53:43 PDT 2007


On Jul 4, 2007, at 1:13 AM, Duncan Sands wrote:

>> Looking at it a little more, I think the instcombine folds are  
>> actually
>> wrong here. For example, it does X + undef -> undef, but that's  
>> wrong if
>> X is a NaN.
>
> Right, that's why I suggested X + undef -> X.

Generally it's  better to fold to a constant (e.g. a NAN) instead of  
retaining a use of X.  Folding to a NAN makes the computation of X  
dead, and theoretically the nan will be folded through lots of other  
operations (which probably isn't true right now, but could be  
implemented).

-Chris



More information about the llvm-commits mailing list