File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments