[libclc] libclc: Replace fmod implementation with elementwise builtin (PR #186083)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 18 12:57:54 PDT 2026


arsenm wrote:

> This change is breaking `fmod` on some platforms using `clspv`. I'm not sure to understand where the fmod implementation should be coming from if not from libclc. Is it part of LLVM? I don't see it, but I might have missed it.

Yes, LLVM codegen. Ideally all of these operations would just use the LLVM intrinsics, and llvm codegen would select the implementation. Most of these implementations here exist as a workaround to difficulties for GPU backends emitting calls in codegen. ExpandIRInsts should replace the frem instruction with the same inline expansion if the target reports the libcall is not available 

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


More information about the cfe-commits mailing list