File tree 1 file changed +4
-4
lines changed
llvm/lib/Transforms/Vectorize 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2495,16 +2495,16 @@ void InnerLoopVectorizer::emitIterationCountCheck(BasicBlock *Bypass) {
2495
2495
const SCEV *TC2OverflowSCEV = SE.applyLoopGuards (SE.getSCEV (LHS), OrigLoop);
2496
2496
const SCEV *StepSCEV = SE.getSCEV (Step);
2497
2497
2498
- // Check if the tc + step is >= maxuint .
2498
+ // Check if (UMax - n) < (VF * UF) .
2499
2499
if (SE.isKnownPredicate (ICmpInst::ICMP_ULT, TC2OverflowSCEV, StepSCEV)) {
2500
2500
CheckMinIters = Builder.getTrue ();
2501
2501
} else if (!SE.isKnownPredicate (
2502
2502
CmpInst::getInversePredicate (CmpInst::ICMP_ULT),
2503
2503
TC2OverflowSCEV, StepSCEV)) {
2504
- // Generate the IV overflow check only if we cannot prove the IV won't
2505
- // overflow, or known to always overflow .
2504
+ // Generate the IV overflow check only if we cannot prove
2505
+ // (UMax - n) < (VF * UF) .
2506
2506
CheckMinIters = Builder.CreateICmp (ICmpInst::ICMP_ULT, LHS, Step);
2507
- } // else tc + step known < maxuint , use CheckMinIters preset to false
2507
+ } // else n + (VF * UF) <= UMax , use CheckMinIters preset to false
2508
2508
}
2509
2509
2510
2510
// Create new preheader for vector loop.
You can’t perform that action at this time.
0 commit comments