[llvm] [VPlan] Narrow truncates of an induction plus a constant offset (PR #226035)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 27 13:54:32 PDT 2026


================
@@ -875,9 +875,12 @@ static void legalizeAndOptimizeInductions(VPlan &Plan) {
 
 /// Check if \p VPV is an untruncated wide induction, either before or after the
 /// increment. If so return the header IV (before the increment), otherwise
-/// return null.
+/// return null. If \p PostIncStart is provided, the induction offset by any
+/// constant is also matched, and \p PostIncStart is set to the constant start
+/// value of the affine expression \p VPV computes.
 static VPWidenInductionRecipe *
-getOptimizableIVOf(VPValue *VPV, PredicatedScalarEvolution &PSE) {
+getOptimizableIVOf(VPValue *VPV, PredicatedScalarEvolution &PSE,
+                   VPValue **PostIncStart = nullptr) {
----------------
artagnon wrote:

```suggestion
                   VPValue &*PostIncStart = nullptr) {
```

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


More information about the llvm-commits mailing list