Skip to content

Commit d9c2695

Browse files
authored
[VPlan] Remove manual constant fold in VPWidenIntOrFpInductionRecipe. NFC (#118028)
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 d648eed commit d9c2695

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
@@ -1702,13 +1702,7 @@ void VPWidenIntOrFpInductionRecipe::execute(VPTransformState &State) {
17021702
Value *Mul = Builder.CreateBinOp(MulOp, Step, RuntimeVF);
17031703

17041704
// Create a vector splat to use in the induction update.
1705-
//
1706-
// FIXME: If the step is non-constant, we create the vector splat with
1707-
// IRBuilder. IRBuilder can constant-fold the multiply, but it
1708-
// doesn't handle a constant vector splat.
1709-
SplatVF = isa<Constant>(Mul)
1710-
? ConstantVector::getSplat(State.VF, cast<Constant>(Mul))
1711-
: Builder.CreateVectorSplat(State.VF, Mul);
1705+
SplatVF = Builder.CreateVectorSplat(State.VF, Mul);
17121706
}
17131707

17141708
Builder.restoreIP(CurrIP);

0 commit comments

Comments
 (0)