diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp index f28b3849a57c..5c94aeb1d7ae 100644 --- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp @@ -4414,7 +4414,7 @@ InstructionCost AArch64TTIImpl::getCmpSelInstrCost( } if (Opcode == Instruction::FCmp) { - if (auto Cost = getFP16BF16PromoteCost( + if (auto PromotedCost = getFP16BF16PromoteCost( ValTy, CostKind, Op1Info, Op2Info, /*IncludeTrunc=*/false, [&](Type *PromotedTy) { InstructionCost Cost = @@ -4428,7 +4428,7 @@ InstructionCost AArch64TTIImpl::getCmpSelInstrCost( TTI::CastContextHint::None, CostKind); return Cost; })) - return *Cost; + return *PromotedCost; auto LT = getTypeLegalizationCost(ValTy); // Model unknown fp compares as a libcall.