[llvm] [LoopVectorize] Improve algorithm for hoisting runtime checks (PR #73515)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 27 05:58:57 PST 2023
================
@@ -346,7 +346,10 @@ void RuntimePointerChecking::tryToCreateDiffCheck(
auto *SinkStartAR = cast<SCEVAddRecExpr>(SinkStartInt);
const Loop *StartARLoop = SrcStartAR->getLoop();
if (StartARLoop == SinkStartAR->getLoop() &&
- StartARLoop == InnerLoop->getParentLoop()) {
+ StartARLoop == InnerLoop->getParentLoop() &&
+ !SE->isKnownPredicate(ICmpInst::ICMP_EQ,
+ SrcStartAR->getStepRecurrence(*SE),
+ SinkStartAR->getStepRecurrence(*SE))) {
----------------
nikic wrote:
```suggestion
SrcStartAR->getStepRecurrence(*SE) != SinkStartAR->getStepRecurrence(*SE)) {
```
Don't use isKnownPredicate() for ICMP_EQ.
https://github.com/llvm/llvm-project/pull/73515
More information about the llvm-commits
mailing list