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 _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits