[PATCH] D111896: [indvars] Canonicalize exit conditions to unsigned using range info

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 18 10:50:41 PDT 2021


reames added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1857
+    // thus we need to notify top most loop.
+    SE->forgetTopmostLoop(L);
+  }
----------------
mkazantsev wrote:
> Do we really need this? We don't fold any blocks here, just replacing signed predicate with unsigned. How can this be a problem for caches?
We don't, though for somewhat subtle reasons.  In theory, switching the predicate could let us compute a trip count, but since we haven't *changed* the trip count of the loop, at worst we've left SCEV in an imprecise state.  

I removed the invalidation for now, we may want to add it back if that imprecision turns out to be a problem later.  


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111896/new/

https://reviews.llvm.org/D111896



More information about the llvm-commits mailing list