[PATCH] D17231: DAGCombiner: Relax sqrt NaN folding check

Geoff Berry via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 11:43:28 PST 2016


gberry added a subscriber: gberry.
gberry added a comment.

This looks reasonable to me (since -0 < +0 is false).


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:13825
@@ -13825,2 +13824,3 @@
+  // fold (select (setcc x, [+-]0.0, *lt), NaN, (fsqrt x))
   // The select + setcc is redundant, because fsqrt returns NaN for X < -0.
   if (const ConstantFPSDNode *NaN = isConstOrConstSplatFP(LHS)) {
----------------
You might want to update this comment to [+-]0

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:13850
@@ -13849,3 +13849,3 @@
           CC == ISD::SETULT || CC == ISD::SETLT)) {
         // We have: (select (setcc x, -0.0, *lt), NaN, (fsqrt x))
         CombineTo(TheSelect, Sqrt);
----------------
Ditto.


http://reviews.llvm.org/D17231





More information about the llvm-commits mailing list