[llvm] [LLVM] Move libcall <-> intrinsic association into libcall tablegen (PR #204029)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 7 06:33:35 PDT 2026
================
@@ -117,6 +122,19 @@ struct RuntimeLibcallsInfo {
return ImplToLibcall[Impl];
}
+ /// Return the runtime libcall that the floating-point math intrinsic \p ID
+ /// operating on type \p Ty may be lowered to, or RTLIB::UNKNOWN_LIBCALL if
+ /// there is no such mapping.
+ ///
+ /// \p Ty must be the floating-point operand type, which is not always the
+ /// intrinsic's primary/overloaded type. E.g. lround/llround/lrint/llrint are
+ /// overloaded on the integer result, powi on the integer exponent, and
+ /// frexp/modf/sincos return an aggregate. For these, pass the floating-point
+ /// argument type (e.g. the type of operand 0), not the intrinsic's return
+ /// type.
+ LLVM_ABI static RTLIB::Libcall getLibcallForIntrinsic(Intrinsic::ID ID,
+ Type *Ty);
----------------
arsenm wrote:
This should take the complete FunctionType for the call signature
https://github.com/llvm/llvm-project/pull/204029
More information about the llvm-commits
mailing list