[llvm] 89d5272 - [VPlan] Remove getPreheader(). (NFC)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 16 11:48:16 PST 2024
Author: Florian Hahn
Date: 2024-12-16T19:48:02Z
New Revision: 89d5272841f7825920ccd911f86b4e8aeb95fb49
URL: https://github.com/llvm/llvm-project/commit/89d5272841f7825920ccd911f86b4e8aeb95fb49
DIFF: https://github.com/llvm/llvm-project/commit/89d5272841f7825920ccd911f86b4e8aeb95fb49.diff
LOG: [VPlan] Remove getPreheader(). (NFC)
The preheader is now the entry block, connected to the vector.ph.
Clean up after https://github.com/llvm/llvm-project/pull/114292.
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/lib/Transforms/Vectorize/VPlan.h
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 61f7bd84902815..b364af3a1cf702 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -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)));
@@ -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;
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 12208a7968338b..a83bf25f81a270 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -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();
More information about the llvm-commits
mailing list