[llvm] [AArch64][CostModel] Increase the cost of illegal SVE int-to-fp converts (PR #130756)
Graham Hunter via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 18 06:22:58 PDT 2025
================
@@ -2968,6 +3010,16 @@ InstructionCost AArch64TTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
{ISD::UINT_TO_FP, MVT::v2f64, MVT::v2i16, 4},
{ISD::UINT_TO_FP, MVT::v2f64, MVT::v2i32, 2},
+ // SVE: to nxv2f64
+ {ISD::SINT_TO_FP, MVT::nxv2f64, MVT::nxv2i8, 7},
+ {ISD::SINT_TO_FP, MVT::nxv2f64, MVT::nxv2i16, 5},
+ {ISD::SINT_TO_FP, MVT::nxv2f64, MVT::nxv2i32, 3},
----------------
huntergr-arm wrote:
I've update the code to include two kinds of entry in the table -- one where the destination type is legal, with minimal costs for them. The other is where the destination type is illegal (too wide) but the source type is either legal or narrower than legal and requires splitting, so I've added a penalty cost to them.
I've done that via symbolic constants, so we can change the numbers later without trying to figure out what we were modeling.
The target-independent code still gets involved in some of the cases and seems to work ok (e.g nxv16i8 -> nxv16f64, since there's currently no MVT for the latter type and it has to be split at the EVT level before we can look it up in the table).
https://github.com/llvm/llvm-project/pull/130756
More information about the llvm-commits
mailing list