[libclc] [libclc] Optimize generic CLC fmin/fmax (PR #128506)

Wenju He via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 29 03:18:25 PDT 2025


================
@@ -43,8 +48,10 @@ _CLC_DEF _CLC_OVERLOAD half __clc_fmin(half x, half y) {
   return (y < x) ? y : x;
----------------
wenju-he wrote:

>I wonder if we in fact want to have `half` use `__builtin_fminf16`? We can simplify the definitions if all types are using a builtin. What do you think? That would optimize the `half` case, rather than pessimize the `float`/`double` case.

LGTM. My opinion is that we better use the same implementation for all of the 3 data types. Either using checking nan, or  using builtin function.

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


More information about the cfe-commits mailing list