Skip to content

Commit 820daa5

Browse files
committed
[VPlan] Support VPWidenIntOrFpInduction in getSCEVExprForVPValue. (NFCI)
Construct SCEVs for VPWidenIntOrFpInductionRecipe analogous to VPCanonicalInductionPHIRecipe: create an AddRec with start + step from the recipe. Currently the only impact should be computing more costs of replicating stores directly in VPlan.
1 parent 5613e4a commit 820daa5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

llvm/lib/Transforms/Vectorize/VPlanUtils.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ const SCEV *vputils::getSCEVExprForVPValue(const VPValue *V,
8989
return SE.getAddRecExpr(Start, SE.getOne(Start->getType()), L,
9090
SCEV::FlagAnyWrap);
9191
})
92+
.Case<VPWidenIntOrFpInductionRecipe>(
93+
[&SE, L](const VPWidenIntOrFpInductionRecipe *R) {
94+
const SCEV *Step = getSCEVExprForVPValue(R->getStepValue(), SE, L);
95+
if (!L || isa<SCEVCouldNotCompute>(Step))
96+
return SE.getCouldNotCompute();
97+
const SCEV *Start =
98+
getSCEVExprForVPValue(R->getStartValue(), SE, L);
99+
return SE.getAddRecExpr(Start, Step, L, SCEV::FlagAnyWrap);
100+
})
92101
.Case<VPDerivedIVRecipe>([&SE, L](const VPDerivedIVRecipe *R) {
93102
const SCEV *Start = getSCEVExprForVPValue(R->getOperand(0), SE, L);
94103
const SCEV *IV = getSCEVExprForVPValue(R->getOperand(1), SE, L);

0 commit comments

Comments
 (0)