From 89d5272841f7825920ccd911f86b4e8aeb95fb49 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Mon, 16 Dec 2024 19:47:43 +0000 Subject: [PATCH] [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. --- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 10 +++++----- llvm/lib/Transforms/Vectorize/VPlan.h | 6 ------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 61f7bd849028154..b364af3a1cf702c 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -7778,12 +7778,12 @@ DenseMap 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(&R); if (!ExpandR) continue; diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h index 12208a7968338ba..a83bf25f81a2703 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();