Skip to content

Commit 1fa5603

Browse files
committed
[CostModel][X86] getIntrinsicInstrCost - lrint/llrint costs can use getCastInstrCost without argument data
We don't use the IntrinsicCostAttributes arguments so, which allows us to use in type-only analysis in a future patch.
1 parent 990837f commit 1fa5603

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4482,15 +4482,13 @@ X86TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
44824482
}
44834483
break;
44844484
case Intrinsic::lrint:
4485-
case Intrinsic::llrint:
4485+
case Intrinsic::llrint: {
44864486
// X86 can use the CVTP2SI instructions to lower lrint/llrint calls, which
44874487
// have the same costs as the CVTTP2SI (fptosi) instructions
4488-
if (!ICA.isTypeBasedOnly()) {
4489-
const SmallVectorImpl<Type *> &ArgTys = ICA.getArgTypes();
4490-
return getCastInstrCost(Instruction::FPToSI, RetTy, ArgTys[0],
4491-
TTI::CastContextHint::None, CostKind);
4492-
}
4493-
break;
4488+
const SmallVectorImpl<Type *> &ArgTys = ICA.getArgTypes();
4489+
return getCastInstrCost(Instruction::FPToSI, RetTy, ArgTys[0],
4490+
TTI::CastContextHint::None, CostKind);
4491+
}
44944492
case Intrinsic::maxnum:
44954493
case Intrinsic::minnum:
44964494
// FMINNUM has same costs so don't duplicate.

0 commit comments

Comments
 (0)