[PATCH] D45439: [IRCE] Use NUW flag for indvar

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 10 01:32:45 PDT 2018


mkazantsev added inline comments.


================
Comment at: lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:705
+                               ScalarEvolution &SE) {
+  if (SE.isKnownNonNegative(BoundSCEV))
+    return true;
----------------
samparker wrote:
> mkazantsev wrote:
> > I don't think that these two checks make any sense, because `isLoopEntryGuardedByCond` makes trivial checks anyways. You are just duplicating efforts.
> Removing isKnownNonNegative has no effects on the tests, but removing isKnownNegative is causing eq_ne and non_known_positive_end tests to fail. I will investigate.
It is strange, and maybe it is because of potential problem @ line 936. That is why I'd prefer these changes go separately. The part about `isKnownNonNegative` looks pretty safe, the part about `nuw` may be more fishy.


https://reviews.llvm.org/D45439





More information about the llvm-commits mailing list