[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
Wed Jun 11 17:52:51 PDT 2025
================
@@ -1497,6 +1497,33 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
cast<VectorType>(ICA.getArgTypes()[0]), {}, CostKind,
0, cast<VectorType>(ICA.getReturnType()));
}
+ case Intrinsic::fptoui_sat:
----------------
ElvisWang123 wrote:
I think it is not only missing the scalarization for the source type, the cost of `fptoui_sat` is much lower than expect.
This can be implemented in `BasicTTI::getIntrinsicInstrCost()`. But when using type-based query it will try to get cost from `BasicTTI::getTypeBasedIntrinsicInstrCost()` which will return the cost different from the value-based query.
IIUC #97463 make the precedent that cost of intrinsics in `getTypeBasedIntrinsicInstrCost()` and not implemented before https://github.com/llvm/llvm-project/blob/a3201ce9e114aa2ecd66e525607093e4dff2f574/llvm/include/llvm/CodeGen/BasicTTIImpl.h#L2511 should be handled by target.
https://github.com/llvm/llvm-project/pull/143655
More information about the llvm-commits
mailing list