[llvm] [LoopVectorize] Improve algorithm for hoisting runtime checks (PR #73515)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 05:04:00 PST 2023


================
@@ -346,7 +346,9 @@ void RuntimePointerChecking::tryToCreateDiffCheck(
     auto *SinkStartAR = cast<SCEVAddRecExpr>(SinkStartInt);
     const Loop *StartARLoop = SrcStartAR->getLoop();
     if (StartARLoop == SinkStartAR->getLoop() &&
-        StartARLoop == InnerLoop->getParentLoop()) {
+        StartARLoop == InnerLoop->getParentLoop() &&
+        SrcStartAR->getStepRecurrence(*SE) !=
----------------
fhahn wrote:

Would be good to add a comment here explaining the check

https://github.com/llvm/llvm-project/pull/73515


More information about the llvm-commits mailing list