[PATCH] D28364: SimplifyLibCalls: Remove incorrect optimization of fabs

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 10:10:43 PST 2017


majnemer added inline comments.


================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1200
-    // Fold fabs(x * x) -> x * x; any squared FP value must already be positive.
-    if (I->getOpcode() == Instruction::FMul)
-      if (I->getOperand(0) == I->getOperand(1))
----------------
Couldn't this stay if the `fmul` is marked as `nnan`?


https://reviews.llvm.org/D28364





More information about the llvm-commits mailing list