[llvm] [VPlan] Add VPValue for VF, use it for VPWidenIntOrFpInductionRecipe. (PR #95305)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 8 16:31:38 PDT 2024
================
@@ -934,8 +934,19 @@ void VPlan::prepareToExecute(Value *TripCountV, Value *VectorTripCountV,
IRBuilder<> Builder(State.CFG.PrevBB->getTerminator());
// FIXME: Model VF * UF computation completely in VPlan.
- VFxUF.setUnderlyingValue(
- createStepForVF(Builder, TripCountV->getType(), State.VF, State.UF));
+ if (VF.getNumUsers()) {
+ Value *RuntimeVF =
+ createStepForVF(Builder, TripCountV->getType(), State.VF, 1);
+ VF.setUnderlyingValue(RuntimeVF);
+ VFxUF.setUnderlyingValue(
+ State.UF > 1
+ ? Builder.CreateMul(
+ RuntimeVF, ConstantInt::get(TripCountV->getType(), State.UF))
----------------
ayalz wrote:
ok, just confirming we're doing an explicit Mul here, compared to `createStepForVF()` doing `multiplyCoefficientBy()` below. Perhaps related to (vscale * VF) * UF vs. vscale * (VF * UF)?
https://github.com/llvm/llvm-project/pull/95305
More information about the llvm-commits
mailing list