[llvm] 6a8775b - [LV] Get function from loop, TTI from LVP to call getMaxVScale (NFC) (#211670)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 01:05:59 PDT 2026


Author: Florian Hahn
Date: 2026-07-24T09:05:54+01:00
New Revision: 6a8775b6f7e5a7e1bf3055819595b2612605c6f4

URL: https://github.com/llvm/llvm-project/commit/6a8775b6f7e5a7e1bf3055819595b2612605c6f4
DIFF: https://github.com/llvm/llvm-project/commit/6a8775b6f7e5a7e1bf3055819595b2612605c6f4.diff

LOG: [LV] Get function from loop, TTI from LVP to call getMaxVScale (NFC) (#211670)

Remove unnecessary uses for CM from LVP::executePlan.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index a75305e27d7a5..efae9c2bc82f6 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5973,7 +5973,7 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
   VPlanTransforms::removeBranchOnConst(BestVPlan, /*OnlyLatches=*/true);
   VPlanTransforms::materializeBackedgeTakenCount(BestVPlan, VectorPH);
   std::optional<uint64_t> MaxRuntimeStep;
-  if (auto MaxVScale = getMaxVScale(*CM.TheFunction, CM.TTI))
+  if (auto MaxVScale = getMaxVScale(*OrigLoop->getHeader()->getParent(), TTI))
     MaxRuntimeStep = uint64_t(*MaxVScale) * BestVF.getKnownMinValue() * BestUF;
   assert((LI->getUniqueLatchExitBlock(*OrigLoop) || RequiresScalarEpilogue) &&
          "loops not exiting via the latch without required epilogue?");


        


More information about the llvm-commits mailing list