[llvm] [VPlan] Extend getSCEVForVPV, use to compute VPReplicateRecipe cost. (PR #161276)
    Florian Hahn via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Oct 21 13:12:02 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, there are other users that don't have a loop available at the moment
https://github.com/llvm/llvm-project/pull/161276
    
    
More information about the llvm-commits
mailing list