Skip to content

Commit c641c1a

Browse files
committed
[VPlan] Pass VPValue operands to handleReplication. (NFC)
Update handleReplication to also take VPValue operands as argument, in line with the other methods in VPRecipeBuilder.
1 parent f50efe9 commit c641c1a

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8628,8 +8628,9 @@ void VPRecipeBuilder::fixHeaderPhis() {
86288628
}
86298629
}
86308630

8631-
VPReplicateRecipe *VPRecipeBuilder::handleReplication(Instruction *I,
8632-
VFRange &Range) {
8631+
VPReplicateRecipe *
8632+
VPRecipeBuilder::handleReplication(Instruction *I, ArrayRef<VPValue *> Operands,
8633+
VFRange &Range) {
86338634
bool IsUniform = LoopVectorizationPlanner::getDecisionAndClampRange(
86348635
[&](ElementCount VF) { return CM.isUniformAfterVectorization(I, VF); },
86358636
Range);
@@ -8685,8 +8686,8 @@ VPReplicateRecipe *VPRecipeBuilder::handleReplication(Instruction *I,
86858686
assert((Range.Start.isScalar() || !IsUniform || !IsPredicated ||
86868687
(Range.Start.isScalable() && isa<IntrinsicInst>(I))) &&
86878688
"Should not predicate a uniform recipe");
8688-
auto *Recipe = new VPReplicateRecipe(I, mapToVPValues(I->operands()),
8689-
IsUniform, BlockInMask);
8689+
auto *Recipe = new VPReplicateRecipe(
8690+
I, make_range(Operands.begin(), Operands.end()), IsUniform, BlockInMask);
86908691
return Recipe;
86918692
}
86928693

@@ -9358,7 +9359,7 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range) {
93589359
VPRecipeBase *Recipe =
93599360
RecipeBuilder.tryToCreateWidenRecipe(Instr, Operands, Range, VPBB);
93609361
if (!Recipe)
9361-
Recipe = RecipeBuilder.handleReplication(Instr, Range);
9362+
Recipe = RecipeBuilder.handleReplication(Instr, Operands, Range);
93629363

93639364
RecipeBuilder.setRecipe(Instr, Recipe);
93649365
if (isa<VPHeaderPHIRecipe>(Recipe)) {

llvm/lib/Transforms/Vectorize/VPRecipeBuilder.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,12 @@ class VPRecipeBuilder {
218218
return Ingredient2Recipe[I];
219219
}
220220

221-
/// Build a VPReplicationRecipe for \p I. If it is predicated, add the mask as
222-
/// last operand. Range.End may be decreased to ensure same recipe behavior
223-
/// from \p Range.Start to \p Range.End.
224-
VPReplicateRecipe *handleReplication(Instruction *I, VFRange &Range);
221+
/// Build a VPReplicationRecipe for \p I using \p Operands. If it is
222+
/// predicated, add the mask as last operand. Range.End may be decreased to
223+
/// ensure same recipe behavior from \p Range.Start to \p Range.End.
224+
VPReplicateRecipe *handleReplication(Instruction *I,
225+
ArrayRef<VPValue *> Operands,
226+
VFRange &Range);
225227

226228
/// Add the incoming values from the backedge to reduction & first-order
227229
/// recurrence cross-iteration phis.

0 commit comments

Comments
 (0)