From 418dedc2341e807fe7501ad95526b0d7c2f167c4 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Wed, 1 Jan 2025 21:44:21 +0000 Subject: [PATCH] [VPlan] Remove redundant setting of insert point in ::executePlan (NFC). The entry block is a VPIRBasicBkock wrapping the original loop's preheader, so the insert point doesn't need to be set. --- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 4282f815849a83..bf1cde52f0a6fc 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -7709,11 +7709,9 @@ DenseMap LoopVectorizationPlanner::executePlan( // 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()); + if (!BestVPlan.getEntry()->empty()) BestVPlan.getEntry()->execute(&State); - } + if (!ILV.getTripCount()) ILV.setTripCount(State.get(BestVPlan.getTripCount(), VPLane(0))); else