Skip to content

Commit 4ba9c49

Browse files
committed
Update comments
1 parent 13feed4 commit 4ba9c49

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,16 +2495,15 @@ void InnerLoopVectorizer::emitIterationCountCheck(BasicBlock *Bypass) {
24952495
const SCEV *TC2OverflowSCEV = SE.applyLoopGuards(SE.getSCEV(LHS), OrigLoop);
24962496
const SCEV *StepSCEV = SE.getSCEV(Step);
24972497

2498-
// Check if the tc + step is >= maxuint.
2498+
// Check if (UMax - n) < (VF * UF).
24992499
if (SE.isKnownPredicate(ICmpInst::ICMP_ULT, TC2OverflowSCEV, StepSCEV)) {
25002500
CheckMinIters = Builder.getTrue();
25012501
} else if (!SE.isKnownPredicate(
25022502
CmpInst::getInversePredicate(CmpInst::ICMP_ULT),
25032503
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+
// Don't execute the vector loop if (UMax - n) < (VF * UF).
25062505
CheckMinIters = Builder.CreateICmp(ICmpInst::ICMP_ULT, LHS, Step);
2507-
} // else tc + step known < maxuint, use CheckMinIters preset to false
2506+
} // else n + (VF * UF) <= UMax, use CheckMinIters preset to false
25082507
}
25092508

25102509
// Create new preheader for vector loop.

0 commit comments

Comments
 (0)