Skip to content

Commit 556bdcd

Browse files
fhahnrorth
authored andcommitted
[LV] Remove unused LoopBypassBlocks from ILV (NFC).
After recent refactorings to move parts of skeleton creation LoopBypassBlocks isn't used any more. Remove it.
1 parent fd2e631 commit 556bdcd

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -611,9 +611,6 @@ class InnerLoopVectorizer {
611611
/// Middle Block between the vector and the scalar.
612612
BasicBlock *LoopMiddleBlock = nullptr;
613613

614-
/// A list of all bypass blocks. The first block is the entry of the loop.
615-
SmallVector<BasicBlock *, 4> LoopBypassBlocks;
616-
617614
/// Trip count of the original loop.
618615
Value *TripCount = nullptr;
619616

@@ -2445,7 +2442,6 @@ void InnerLoopVectorizer::emitIterationCountCheck(BasicBlock *Bypass) {
24452442
if (hasBranchWeightMD(*OrigLoop->getLoopLatch()->getTerminator()))
24462443
setBranchWeights(BI, MinItersBypassWeights, /*IsExpected=*/false);
24472444
ReplaceInstWithInst(TCCheckBlock->getTerminator(), &BI);
2448-
LoopBypassBlocks.push_back(TCCheckBlock);
24492445

24502446
assert(cast<VPIRBasicBlock>(Plan.getEntry())->getIRBasicBlock() ==
24512447
TCCheckBlock &&
@@ -2461,9 +2457,6 @@ BasicBlock *InnerLoopVectorizer::emitSCEVChecks(BasicBlock *Bypass) {
24612457
assert((!Cost->OptForSize ||
24622458
Cost->Hints->getForce() == LoopVectorizeHints::FK_Enabled) &&
24632459
"Cannot SCEV check stride or overflow when optimizing for size");
2464-
assert(!LoopBypassBlocks.empty() &&
2465-
"Should already be a bypass block due to iteration count check");
2466-
LoopBypassBlocks.push_back(SCEVCheckBlock);
24672460
AddedSafetyChecks = true;
24682461

24692462
introduceCheckBlockInVPlan(SCEVCheckBlock);
@@ -2499,7 +2492,6 @@ BasicBlock *InnerLoopVectorizer::emitMemRuntimeChecks(BasicBlock *Bypass) {
24992492
});
25002493
}
25012494

2502-
LoopBypassBlocks.push_back(MemCheckBlock);
25032495

25042496
AddedSafetyChecks = true;
25052497

@@ -7557,8 +7549,6 @@ EpilogueVectorizerMainLoop::emitIterationCountCheck(BasicBlock *Bypass,
75577549
nullptr, "vector.ph");
75587550

75597551
if (ForEpilogue) {
7560-
LoopBypassBlocks.push_back(TCCheckBlock);
7561-
75627552
// Save the trip count so we don't have to regenerate it in the
75637553
// vec.epilog.iter.check. This is safe to do because the trip count
75647554
// generated here dominates the vector epilog iter check.
@@ -7619,13 +7609,6 @@ EpilogueVectorizerEpilogueLoop::createEpilogueVectorizedLoopSkeleton() {
76197609

76207610
DT->changeImmediateDominator(LoopScalarPreHeader,
76217611
EPI.EpilogueIterationCountCheck);
7622-
// Keep track of bypass blocks, as they feed start values to the induction and
7623-
// reduction phis in the scalar loop preheader.
7624-
if (EPI.SCEVSafetyCheck)
7625-
LoopBypassBlocks.push_back(EPI.SCEVSafetyCheck);
7626-
if (EPI.MemSafetyCheck)
7627-
LoopBypassBlocks.push_back(EPI.MemSafetyCheck);
7628-
LoopBypassBlocks.push_back(EPI.EpilogueIterationCountCheck);
76297612

76307613
// The vec.epilog.iter.check block may contain Phi nodes from inductions or
76317614
// reductions which merge control-flow from the latch block and the middle
@@ -7696,7 +7679,6 @@ EpilogueVectorizerEpilogueLoop::emitMinimumVectorEpilogueIterCountCheck(
76967679
setBranchWeights(BI, Weights, /*IsExpected=*/false);
76977680
}
76987681
ReplaceInstWithInst(Insert->getTerminator(), &BI);
7699-
LoopBypassBlocks.push_back(Insert);
77007682

77017683
// A new entry block has been created for the epilogue VPlan. Hook it in, as
77027684
// otherwise we would try to modify the entry to the main vector loop.

0 commit comments

Comments
 (0)