[llvm] [AMDGPU] expand-fp: Change frem expansion criterion (PR #158285)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 30 23:49:05 PDT 2025
================
@@ -74,11 +74,54 @@ class FRemExpander {
/// Constant 1 of type \p ExTy.
Value *One;
+ /// The frem argument/return types that can be expanded by this class.
+ // TODO The expansion could work for other floating point types
+ // as well, but this would require additional testing.
+ static constexpr std::array<MVT, 3> ExpandableTypes{MVT::f16, MVT::f32,
+ MVT::f64};
+
+ /// Libcalls for frem instructions of the type at the corresponding
+ /// positions of ExpandableTypes.
+ static constexpr std::array<RTLIB::Libcall, 3> FremLibcalls{
+ RTLIB::REM_F32, RTLIB::REM_F32, RTLIB::REM_F64};
----------------
arsenm wrote:
In the future this should also consider if the selected call is actually callable
https://github.com/llvm/llvm-project/pull/158285
More information about the llvm-commits
mailing list