Skip to content

Commit 7ee6cf0

Browse files
authored
[LV] Fix incorrect cost kind in VPReplicateRecipe::computeCost (llvm#153216)
We were incorrectly using the TTI::TCK_RecipThroughput cost kind and ignoring the kind set in the context.
1 parent c99cbc8 commit 7ee6cf0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2964,7 +2964,6 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF,
29642964
// transform, avoid computing their cost multiple times for now.
29652965
Ctx.SkipCostComputation.insert(UI);
29662966

2967-
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
29682967
Type *ResultTy = Ctx.Types.inferScalarType(this);
29692968
switch (UI->getOpcode()) {
29702969
case Instruction::GetElementPtr:
@@ -2990,7 +2989,7 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF,
29902989
auto Op2Info = Ctx.getOperandInfo(getOperand(1));
29912990
SmallVector<const Value *, 4> Operands(UI->operand_values());
29922991
return Ctx.TTI.getArithmeticInstrCost(
2993-
UI->getOpcode(), ResultTy, CostKind,
2992+
UI->getOpcode(), ResultTy, Ctx.CostKind,
29942993
{TargetTransformInfo::OK_AnyValue, TargetTransformInfo::OP_None},
29952994
Op2Info, Operands, UI, &Ctx.TLI) *
29962995
(isSingleScalar() ? 1 : VF.getFixedValue());

0 commit comments

Comments
 (0)