[libc-commits] [libc] [libc][GPU] Remove code duplicate in GPU math functions (PR #241177)
Matt Arsenault via libc-commits
libc-commits at lists.llvm.org
Wed Nov 11 18:52:55 PST 2026
arsenm wrote:
> > This isn't exactly a GPU property. I wish we had a better answer for how to emit the intrinsics from libc
>
> Do you mean using built-in functions is not a reliable way for GPU devices, different GPU may have different way to name intrinsics which has similar functionalities(__nv__, __ocl__ or __spirv_*).
No, I very much want to stop using those vendor functions. I mean these are defining the libm function in terms of a builtin defined as emitting a call to the libm function with the same name. It only happens to work out if clang emits the IR intrinsic instead of the direct libcall, and codegen can deal with the intrinsic through a not-libcall codegen path
https://github.com/llvm/llvm-project/pull/241177
More information about the libc-commits
mailing list