From 471eefac8626a4e684658ecfd77c29e7748a673a Mon Sep 17 00:00:00 2001 From: David Sherwood Date: Tue, 12 Aug 2025 15:42:10 +0000 Subject: [PATCH] [LV] Fix incorrect cost kind in VPReplicateRecipe::computeCost We were incorrectly using the TTI::TCK_RecipThroughput cost kind and ignoring the kind set in the context. --- llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp index e34cab117f321..a121f4f54845c 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp @@ -2944,7 +2944,6 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF, // transform, avoid computing their cost multiple times for now. Ctx.SkipCostComputation.insert(UI); - TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput; Type *ResultTy = Ctx.Types.inferScalarType(this); switch (UI->getOpcode()) { case Instruction::GetElementPtr: @@ -2970,7 +2969,7 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF, auto Op2Info = Ctx.getOperandInfo(getOperand(1)); SmallVector Operands(UI->operand_values()); return Ctx.TTI.getArithmeticInstrCost( - UI->getOpcode(), ResultTy, CostKind, + UI->getOpcode(), ResultTy, Ctx.CostKind, {TargetTransformInfo::OK_AnyValue, TargetTransformInfo::OP_None}, Op2Info, Operands, UI, &Ctx.TLI) * (isSingleScalar() ? 1 : VF.getFixedValue());