[llvm] [VPlan] Compute induction end values in VPlan. (PR #112145)

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 13:52:11 PST 2024


================
@@ -9717,13 +9720,13 @@ void VPDerivedIVRecipe::execute(VPTransformState &State) {
     State.Builder.setFastMathFlags(FPBinOp->getFastMathFlags());
 
   Value *Step = State.get(getStepValue(), VPLane(0));
-  Value *CanonicalIV = State.get(getOperand(1), VPLane(0));
+  Value *Index = State.get(getOperand(1), VPLane(0));
   Value *DerivedIV = emitTransformedIndex(
-      State.Builder, CanonicalIV, getStartValue()->getLiveInIRValue(), Step,
+      State.Builder, Index, getStartValue()->getLiveInIRValue(), Step,
       Kind, cast_if_present<BinaryOperator>(FPBinOp));
   DerivedIV->setName(Name);
-  assert(DerivedIV != CanonicalIV && "IV didn't need transforming?");
-
+  // Index may only bet set to constant 0 in prepareToExecute.
----------------
ayalz wrote:

```suggestion
  // Index may only be set to constant 0 in prepareToExecute.
```

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


More information about the llvm-commits mailing list