[llvm] [VPlan] Extend getSCEVForVPV, use to compute VPReplicateRecipe cost. (PR #161276)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 20 13:47:06 PDT 2025
================
@@ -86,6 +87,85 @@ const SCEV *vputils::getSCEVExprForVPValue(VPValue *V, ScalarEvolution &SE) {
return TypeSwitch<const VPRecipeBase *, const SCEV *>(V->getDefiningRecipe())
.Case<VPExpandSCEVRecipe>(
[](const VPExpandSCEVRecipe *R) { return R->getSCEV(); })
+ .Case<VPCanonicalIVPHIRecipe>([&SE, L](const VPCanonicalIVPHIRecipe *R) {
+ if (!L)
+ return SE.getCouldNotCompute();
----------------
fhahn wrote:
Yep, a loop is only needed if we need to construct a SCEVAddRecExpr, which should only happen here
https://github.com/llvm/llvm-project/pull/161276
More information about the llvm-commits
mailing list