[llvm] [RISCV][TTI] Implement vector costs for `llvm.fpto{u|s}i.sat()`. (PR #143655)

Elvis Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 24 02:13:12 PDT 2025


ElvisWang123 wrote:

Gentle ping @arsenm 

Your previous changes (#97463) make saturating operation return the expansion cost.  If the target TTI doesn't implement their own implementation of the saturating operations, the cost of vector saturating operation will be under estimate and wrong.

Although the issue of that the wrong cost of the saturating fptoint is target independent.  I think after #97463, target TTI need to handle some of the cases of invalid cost instead of just lower to BasicTTI. 

I think implement this change in the target TTI is better to prevent moving the cost calculation in the BasicTTI  before the expansion cost, which basically revert #100521 and add the legal check of source type.


https://github.com/llvm/llvm-project/pull/143655


More information about the llvm-commits mailing list