[llvm] [VPlan] Assert that replacement types match in VPUser::setOperand (NFC). (PR #195891)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu May 21 09:05:31 PDT 2026


================
@@ -2092,17 +2092,18 @@ static bool optimizeVectorInductionWidthForTCAndVFUF(VPlan &Plan,
       continue;
 
     // Update IV operands and comparison bound to use new narrower type.
-    auto *NewStart = Plan.getZero(NewIVTy);
-    WideIV->setStartValue(NewStart);
-    auto *NewStep = Plan.getConstantInt(NewIVTy, 1);
-    WideIV->setStepValue(NewStep);
+    auto *NewWideIV = WideIV->cloneWithOperands(Plan.getZero(NewIVTy),
+                                                Plan.getConstantInt(NewIVTy, 1),
+                                                WideIV->getVFValue());
+    NewWideIV->insertBefore(WideIV);
----------------
fhahn wrote:

Ah right, it looks like the removal got dropped and is actually not needed. I removed the make_early_inc_range for now

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


More information about the llvm-commits mailing list