Skip to content

Commit 89d5272

Browse files
committed
[VPlan] Remove getPreheader(). (NFC)
The preheader is now the entry block, connected to the vector.ph. Clean up after #114292.
1 parent b95dfa3 commit 89d5272

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7778,12 +7778,12 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
77787778
assert(DT->verify(DominatorTree::VerificationLevel::Fast));
77797779
#endif
77807780

7781-
// 0. Generate SCEV-dependent code into the preheader, including TripCount,
7782-
// before making any changes to the CFG.
7783-
if (!BestVPlan.getPreheader()->empty()) {
7781+
// 0. Generate SCEV-dependent code in the entry, including TripCount, before
7782+
// making any changes to the CFG.
7783+
if (!BestVPlan.getEntry()->empty()) {
77847784
State.CFG.PrevBB = OrigLoop->getLoopPreheader();
77857785
State.Builder.SetInsertPoint(OrigLoop->getLoopPreheader()->getTerminator());
7786-
BestVPlan.getPreheader()->execute(&State);
7786+
BestVPlan.getEntry()->execute(&State);
77877787
}
77887788
if (!ILV.getTripCount())
77897789
ILV.setTripCount(State.get(BestVPlan.getTripCount(), VPLane(0)));
@@ -10049,7 +10049,7 @@ preparePlanForEpilogueVectorLoop(VPlan &Plan, Loop *L,
1004910049
// TODO: This is a workaround needed for epilogue vectorization and it
1005010050
// should be removed once induction resume value creation is done
1005110051
// directly in VPlan.
10052-
for (auto &R : make_early_inc_range(*Plan.getPreheader())) {
10052+
for (auto &R : make_early_inc_range(*Plan.getEntry())) {
1005310053
auto *ExpandR = dyn_cast<VPExpandSCEVRecipe>(&R);
1005410054
if (!ExpandR)
1005510055
continue;

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4048,12 +4048,6 @@ class VPlan {
40484048
SCEVToExpansion[S] = V;
40494049
}
40504050

4051-
/// \return The block corresponding to the original preheader.
4052-
/// FIXME: There's no separate preheader any longer and Entry now serves the
4053-
/// same purpose as the original preheader. Remove after transition.
4054-
VPBasicBlock *getPreheader() { return Entry; }
4055-
const VPBasicBlock *getPreheader() const { return Entry; }
4056-
40574051
/// Clone the current VPlan, update all VPValues of the new VPlan and cloned
40584052
/// recipes to refer to the clones, and return it.
40594053
VPlan *duplicate();

0 commit comments

Comments
 (0)