Skip to content

Commit 2790abf

Browse files
committed
[VPlan] Remove manual constant fold in VPWidenIntOrFpInductionRecipe. NFC
This manual constant folding was added in 2017 in https://reviews.llvm.org/D29956, but since then it looks like IRBuilder has learnt to fold it away itself. I'm not sure at what point this happened, I just verified this by stepping through the call to CreateVectorSplat in the debugger.
1 parent 562c93a commit 2790abf

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,13 +1691,7 @@ void VPWidenIntOrFpInductionRecipe::execute(VPTransformState &State) {
16911691
Value *Mul = Builder.CreateBinOp(MulOp, Step, RuntimeVF);
16921692

16931693
// Create a vector splat to use in the induction update.
1694-
//
1695-
// FIXME: If the step is non-constant, we create the vector splat with
1696-
// IRBuilder. IRBuilder can constant-fold the multiply, but it
1697-
// doesn't handle a constant vector splat.
1698-
SplatVF = isa<Constant>(Mul)
1699-
? ConstantVector::getSplat(State.VF, cast<Constant>(Mul))
1700-
: Builder.CreateVectorSplat(State.VF, Mul);
1694+
SplatVF = Builder.CreateVectorSplat(State.VF, Mul);
17011695
}
17021696

17031697
Builder.restoreIP(CurrIP);

0 commit comments

Comments
 (0)