[llvm] [VPlan] Make canonical IV part of the region (PR #156262)

via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 22 08:54:30 PST 2026


================
@@ -148,6 +148,16 @@ const SCEV *vputils::getSCEVExprForVPValue(const VPValue *V,
     return SE.getCouldNotCompute();
   }
 
+  if (auto *RV = dyn_cast<VPRegionValue>(V)) {
+    assert(RV == RV->getDefiningRegion()->getCanonicalIV() &&
+           "RegionValue must be canonical IV");
+    if (!L)
+      return SE.getCouldNotCompute();
+    const SCEV *Start = SE.getZero(RV->getDefiningRegion()->getCanonicalIVType());
----------------
ayalz wrote:

```suggestion
    const SCEV *Start = SE.getZero(RV->getType());
```
or simply inlined below.

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


More information about the llvm-commits mailing list