Skip to content

Commit 660fe44

Browse files
committed
!fixup address latest comments, thanks!
1 parent 092c2d6 commit 660fe44

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2449,12 +2449,9 @@ void InnerLoopVectorizer::emitIterationCountCheck(BasicBlock *Bypass) {
24492449
} else if (!SE.isKnownPredicate(CmpInst::getInversePredicate(P),
24502450
TripCountSCEV, SE.getSCEV(Step))) {
24512451
// Generate the minimum iteration check only if we cannot prove the
2452-
// check is known to be true, or known to be false
2452+
// check is known to be true, or known to be false.
24532453
CheckMinIters = Builder.CreateICmp(P, Count, Step, "min.iters.check");
2454-
2455-
// else step is known to be smaller than trip count, use CheckMinIters
2456-
// preset to false.
2457-
}
2454+
} // else step known to be < trip count, use CheckMinIters preset to false.
24582455
} else if (VF.isScalable() &&
24592456
!isIndvarOverflowCheckKnownFalse(Cost, VF, UF) &&
24602457
Style != TailFoldingStyle::DataAndControlFlowWithoutRuntimeCheck) {
@@ -2470,11 +2467,12 @@ void InnerLoopVectorizer::emitIterationCountCheck(BasicBlock *Bypass) {
24702467
Value *Step = CreateStep();
24712468
#ifndef NDEBUG
24722469
ScalarEvolution &SE = *PSE.getSE();
2473-
const SCEV *TripCountSCEV = SE.applyLoopGuards(SE.getSCEV(LHS), OrigLoop);
2470+
const SCEV *TC2OverflowSCEV = SE.applyLoopGuards(SE.getSCEV(LHS), OrigLoop);
24742471
assert(
2472+
!isIndvarOverflowCheckKnownFalse(Cost, VF * UF) &&
24752473
!SE.isKnownPredicate(CmpInst::getInversePredicate(ICmpInst::ICMP_ULT),
2476-
TripCountSCEV, SE.getSCEV(Step)) &&
2477-
"SCEV unexpectedly proved overflow check to be known");
2474+
TC2OverflowSCEV, SE.getSCEV(Step)) &&
2475+
"unexpectedly proved overflow check to be known");
24782476
#endif
24792477
// Don't execute the vector loop if (UMax - n) < (VF * UF).
24802478
CheckMinIters = Builder.CreateICmp(ICmpInst::ICMP_ULT, LHS, Step);

llvm/test/Transforms/LoopVectorize/if-reduction.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,7 @@ for.end: ; preds = %for.body, %entry
16591659
ret i64 %1
16601660
}
16611661

1662+
; FIXME: %indvars.iv.next is poison on first iteration due to sub nuw 0, 1.
16621663
define i32 @fcmp_0_sub_select1(ptr noalias %x, i32 %N) nounwind readonly {
16631664
; CHECK-LABEL: define i32 @fcmp_0_sub_select1(
16641665
; CHECK-SAME: ptr noalias [[X:%.*]], i32 [[N:%.*]]) #[[ATTR0]] {

llvm/test/Transforms/LoopVectorize/version-stride-with-integer-casts.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ exit:
415415

416416
; Test case to make sure that uses of versioned strides of type i1 are properly
417417
; extended. From https://github.com/llvm/llvm-project/issues/91369.
418+
; TODO: Better check (udiv i64 15, %g.64) after checking if %g == 1.
418419
define void @zext_of_i1_stride(i1 %g, ptr %dst) mustprogress {
419420
; CHECK-LABEL: define void @zext_of_i1_stride(
420421
; CHECK-SAME: i1 [[G:%.*]], ptr [[DST:%.*]]) #[[ATTR0:[0-9]+]] {

0 commit comments

Comments
 (0)