[PATCH] D14078: [FPEnv Core 13/14] Don't hoist FP-ops with side-effects in LICM

Sergey Dmitrouk via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 4 12:20:02 PST 2015


sdmitrouk added inline comments.

================
Comment at: lib/Transforms/Scalar/LICM.cpp:697-702
@@ -696,1 +696,8 @@
 
+  // isSafeToSpeculativelyExecute() is not enough, because its result is
+  // taken into account only when it's positive and we need to forbid the case
+  // where its result is negative.
+  if (const FPMathOperator *MathOp = dyn_cast<FPMathOperator>(&Inst))
+    if (!MathOp->hasNoExceptions() || !MathOp->hasNoRounding())
+      return false;
+
----------------
`isSafeToSpeculativelyExecute()` returns `false`, but code doesn't care and returns `true` from `isGuaranteedToExecute()` without this additional check.


Repository:
  rL LLVM

http://reviews.llvm.org/D14078





More information about the llvm-commits mailing list