Skip to content

Commit ff0ce74

Browse files
committed
[VPlan] Replace scalar preheader with VPIRBB at single place (NFC).
Replace the scalar preheader VPBB with an VPIRBB wrapping the IR basic block created by createVectorizedLoopSkeleton.
1 parent e27e4f3 commit ff0ce74

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,7 +2492,6 @@ BasicBlock *InnerLoopVectorizer::createVectorizedLoopSkeleton() {
24922492
// to the scalar loop.
24932493
emitIterationCountCheck(LoopScalarPreHeader);
24942494

2495-
replaceVPBBWithIRVPBB(Plan.getScalarPreheader(), LoopScalarPreHeader);
24962495
replaceVPBBWithIRVPBB(VectorPHVPBB, LoopVectorPreHeader);
24972496
return LoopVectorPreHeader;
24982497
}
@@ -7335,6 +7334,8 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
73357334
BasicBlock *EntryBB =
73367335
cast<VPIRBasicBlock>(BestVPlan.getEntry())->getIRBasicBlock();
73377336
State.CFG.PrevBB = ILV.createVectorizedLoopSkeleton();
7337+
replaceVPBBWithIRVPBB(BestVPlan.getScalarPreheader(),
7338+
State.CFG.PrevBB->getSingleSuccessor());
73387339
VPlanTransforms::removeDeadRecipes(BestVPlan);
73397340

73407341
assert(verifyVPlanIsValid(BestVPlan, true /*VerifyLate*/) &&
@@ -7466,7 +7467,6 @@ BasicBlock *EpilogueVectorizerMainLoop::createEpilogueVectorizedLoopSkeleton() {
74667467
EPI.MainLoopIterationCountCheck =
74677468
emitIterationCountCheck(LoopScalarPreHeader, false);
74687469

7469-
replaceVPBBWithIRVPBB(Plan.getScalarPreheader(), LoopScalarPreHeader);
74707470
return LoopVectorPreHeader;
74717471
}
74727472

@@ -7601,7 +7601,6 @@ EpilogueVectorizerEpilogueLoop::createEpilogueVectorizedLoopSkeleton() {
76017601
Phi->removeIncomingValue(MemCheckBlock);
76027602
}
76037603

7604-
replaceVPBBWithIRVPBB(Plan.getScalarPreheader(), LoopScalarPreHeader);
76057604
return LoopVectorPreHeader;
76067605
}
76077606

0 commit comments

Comments
 (0)