[llvm] [VPlan] Compute induction end values in VPlan. (PR #112145)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 19 15:27:14 PST 2024
================
@@ -9718,13 +9711,14 @@ 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,
- Kind, cast_if_present<BinaryOperator>(FPBinOp));
+ 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 be set to constant 0 in prepareToExecute.
----------------
ayalz wrote:
I still seem to be missing something here. The fact that prepareToExecute() creates the vector trip count (typically to non zero?) implies that derived IVs that are based on it will miss the opportunity to be folded by simplifyRecipes(), because it's too late.
https://github.com/llvm/llvm-project/pull/112145
More information about the llvm-commits
mailing list