[llvm] [VPlan] Extend getSCEVForVPV, use to compute VPReplicateRecipe cost. (PR #161276)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 3 06:45:18 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();
----------------
artagnon wrote:

The other cases aren't guarded by this? Is this necessary?

https://github.com/llvm/llvm-project/pull/161276


More information about the llvm-commits mailing list