Skip to content

Commit 03a23f0

Browse files
committed
[VPlan] Store LoopRegion in variable in calculateRegisterUsage... (NFC)
1 parent b12e033 commit 03a23f0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,9 @@ SmallVector<VPRegisterUsage, 8> llvm::calculateRegisterUsageForPlan(
442442
// assume that each recipe that has in-loop users starts an interval. We
443443
// record every time that an in-loop value is used, so we have a list of the
444444
// first and last occurrences of each recipe.
445+
VPRegionBlock *LoopRegion = Plan.getVectorLoopRegion();
445446
ReversePostOrderTraversal<VPBlockDeepTraversalWrapper<VPBlockBase *>> RPOT(
446-
Plan.getVectorLoopRegion());
447+
LoopRegion);
447448
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(RPOT)) {
448449
if (!VPBB->getParent())
449450
break;
@@ -473,10 +474,10 @@ SmallVector<VPRegisterUsage, 8> llvm::calculateRegisterUsageForPlan(
473474
Ends.insert(DefR);
474475
}
475476
}
476-
if (VPBB == Plan.getVectorLoopRegion()->getExiting()) {
477+
if (VPBB == LoopRegion->getExiting()) {
477478
// VPWidenIntOrFpInductionRecipes are used implicitly at the end of the
478479
// exiting block, where their increment will get materialized eventually.
479-
for (auto &R : Plan.getVectorLoopRegion()->getEntryBasicBlock()->phis()) {
480+
for (auto &R : LoopRegion->getEntryBasicBlock()->phis()) {
480481
if (isa<VPWidenIntOrFpInductionRecipe>(&R)) {
481482
EndPoint[&R] = Idx2Recipe.size();
482483
Ends.insert(&R);

0 commit comments

Comments
 (0)