[PATCH] D15058: [SCEVExpander] Have hoistIVInc preserve LCSSA

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 7 15:45:00 PST 2015


sanjoy marked 2 inline comments as done.

================
Comment at: lib/Analysis/ScalarEvolutionExpander.cpp:936-938
@@ -935,2 +935,5 @@
 
+  if (!SE.LI.movementPreservesLCSSAForm(IncV, InsertPos))
+    return false;
+
   // Check that the chain of IV operands leading back to Phi can be hoisted.
----------------
mzolotukhin wrote:
> With this change we should become more conservative in some cases; did you see any effect on the testsuite? E.g. how many tests would crash if we replace with condition with an assert?
Turning this into an assert does not fail any test in the current llvm test suite (i.e. the `tests/` directory) except the newly added `pr24804.ll`.  I haven't run this over any other IR corpus.

Having said that, I'm not //too// worried -- even in the "worst case", this will replace a correctness issue with a performance issue.


http://reviews.llvm.org/D15058





More information about the llvm-commits mailing list