[PATCH] fold: sqrt(x * x * y) -> fabs(x) * sqrt(y)

hfinkel at anl.gov hfinkel at anl.gov
Tue Oct 14 15:41:15 PDT 2014


================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1270
@@ +1269,3 @@
+  if (Instruction *I = dyn_cast<Instruction>(Op)) {
+    if (I->getOpcode() == Instruction::FMul && I->hasUnsafeAlgebra()) {
+      // We're looking for a repeated factor in a multiplication tree,
----------------
Hrmm... is this right, or do we need to check the function attribute here? I'm not sure that the argument having the unsafe-algebra flag means that we can change its use in a non-strict way.

http://reviews.llvm.org/D5787






More information about the llvm-commits mailing list