[llvm] 03a23f0 - [VPlan] Store LoopRegion in variable in calculateRegisterUsage... (NFC)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 23 09:45:04 PDT 2025


Author: Florian Hahn
Date: 2025-08-23T17:43:25+01:00
New Revision: 03a23f02a9a15bb7335cacfbbbd4cfe501bd7ca8

URL: https://github.com/llvm/llvm-project/commit/03a23f02a9a15bb7335cacfbbbd4cfe501bd7ca8
DIFF: https://github.com/llvm/llvm-project/commit/03a23f02a9a15bb7335cacfbbbd4cfe501bd7ca8.diff

LOG: [VPlan] Store LoopRegion in variable in calculateRegisterUsage... (NFC)

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp b/llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
index 6c9a78add6822..747c6623aa22a 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
@@ -442,8 +442,9 @@ SmallVector<VPRegisterUsage, 8> llvm::calculateRegisterUsageForPlan(
   // assume that each recipe that has in-loop users starts an interval. We
   // record every time that an in-loop value is used, so we have a list of the
   // first and last occurrences of each recipe.
+  VPRegionBlock *LoopRegion = Plan.getVectorLoopRegion();
   ReversePostOrderTraversal<VPBlockDeepTraversalWrapper<VPBlockBase *>> RPOT(
-      Plan.getVectorLoopRegion());
+      LoopRegion);
   for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(RPOT)) {
     if (!VPBB->getParent())
       break;
@@ -473,10 +474,10 @@ SmallVector<VPRegisterUsage, 8> llvm::calculateRegisterUsageForPlan(
         Ends.insert(DefR);
       }
     }
-    if (VPBB == Plan.getVectorLoopRegion()->getExiting()) {
+    if (VPBB == LoopRegion->getExiting()) {
       // VPWidenIntOrFpInductionRecipes are used implicitly at the end of the
       // exiting block, where their increment will get materialized eventually.
-      for (auto &R : Plan.getVectorLoopRegion()->getEntryBasicBlock()->phis()) {
+      for (auto &R : LoopRegion->getEntryBasicBlock()->phis()) {
         if (isa<VPWidenIntOrFpInductionRecipe>(&R)) {
           EndPoint[&R] = Idx2Recipe.size();
           Ends.insert(&R);


        


More information about the llvm-commits mailing list