[PATCH] D15937: [LibCallSimplifier] use instruction-level fast-math-flags to transform sqrt calls

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 10:45:40 PST 2016


davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

This looks fine to me but I'd love to hear Steve's opinion on it. I'm looking forward to see other instructions fixed (pow & friends =))


================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1425
@@ -1423,2 +1424,3 @@
     Value *OtherMul0, *OtherMul1;
+    // FIXME: This multiply must be unsafe to allow this transform.
     if (match(Op0, m_FMul(m_Value(OtherMul0), m_Value(OtherMul1)))) {
----------------
I think you're correct that if any of the ops is strict we should bail out, and your code is fine. Have you checked by any chance what GCC does? Steven Canon might have some more opinions on this.

================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1442
@@ -1441,2 +1441,3 @@
   B.SetFastMathFlags(I->getFastMathFlags());
+
   // If we found a repeated factor, hoist it out of the square root and
----------------
Spurious blank linke.


http://reviews.llvm.org/D15937





More information about the llvm-commits mailing list