[PATCH] Refactor reciprocal square root estimate into target-independent function (part 1).

Chandler Carruth chandlerc at gmail.com
Sat Sep 20 14:46:52 PDT 2014


Looks like a trivially good refactoring. Looking forward to the cleanup to the function, I agree it could be better. =]

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7012-7014
@@ -7007,1 +7011,5 @@
+    // it may be folded into a target-specific square root estimate intruction.
+    SDValue SqrtOp = BuildRSQRTE(N);
+    if (SqrtOp.getNode())
+      return SqrtOp;
   }
----------------
You can make SqrtOp a condition variable now, I fixed SDValue to support this:

  if (SDValue SqrtOp = BuildRSQRTE(N))
    return SqrtOp;

http://reviews.llvm.org/D5425






More information about the llvm-commits mailing list