Skip to content

Commit

Permalink
[VPlan] Remove getPreheader(). (NFC)
Browse files Browse the repository at this point in the history
The preheader is now the entry block, connected to the vector.ph.

Clean up after #114292.
  • Loading branch information
fhahn committed Dec 16, 2024
1 parent b95dfa3 commit 89d5272
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 5 additions & 5 deletions llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7778,12 +7778,12 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
assert(DT->verify(DominatorTree::VerificationLevel::Fast));
#endif

// 0. Generate SCEV-dependent code into the preheader, including TripCount,
// before making any changes to the CFG.
if (!BestVPlan.getPreheader()->empty()) {
// 0. Generate SCEV-dependent code in the entry, including TripCount, before
// making any changes to the CFG.
if (!BestVPlan.getEntry()->empty()) {
State.CFG.PrevBB = OrigLoop->getLoopPreheader();
State.Builder.SetInsertPoint(OrigLoop->getLoopPreheader()->getTerminator());
BestVPlan.getPreheader()->execute(&State);
BestVPlan.getEntry()->execute(&State);
}
if (!ILV.getTripCount())
ILV.setTripCount(State.get(BestVPlan.getTripCount(), VPLane(0)));
Expand Down Expand Up @@ -10049,7 +10049,7 @@ preparePlanForEpilogueVectorLoop(VPlan &Plan, Loop *L,
// TODO: This is a workaround needed for epilogue vectorization and it
// should be removed once induction resume value creation is done
// directly in VPlan.
for (auto &R : make_early_inc_range(*Plan.getPreheader())) {
for (auto &R : make_early_inc_range(*Plan.getEntry())) {
auto *ExpandR = dyn_cast<VPExpandSCEVRecipe>(&R);
if (!ExpandR)
continue;
Expand Down
6 changes: 0 additions & 6 deletions llvm/lib/Transforms/Vectorize/VPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -4048,12 +4048,6 @@ class VPlan {
SCEVToExpansion[S] = V;
}

/// \return The block corresponding to the original preheader.
/// FIXME: There's no separate preheader any longer and Entry now serves the
/// same purpose as the original preheader. Remove after transition.
VPBasicBlock *getPreheader() { return Entry; }
const VPBasicBlock *getPreheader() const { return Entry; }

/// Clone the current VPlan, update all VPValues of the new VPlan and cloned
/// recipes to refer to the clones, and return it.
VPlan *duplicate();
Expand Down

0 comments on commit 89d5272

Please sign in to comment.