[clang] [Clang] Add `__builtin_reduce_addf` for ordered/unordered fp reductions (PR #176160)

Sander de Smalen via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 22 01:25:02 PST 2026


sdesmalen-arm wrote:

> The lowering seems sane to me, but I'm not familiar enough with pre-existing discussions to have a useful opinion. One thing I do wonder is whether it would be clearer to have names that immediately distinguish between ordered and unordered reductions. E.g.
> 
> * __builtin_reduce_fadd_unordered`
> * __builtin_reduce_fadd_ordered`

I agree it makes sense to reflect the ordering in the name. My suggestion would be to define the ordered builtin expliclitly as being ordered (e.g. `__builtin_reduce_ordered_addf`), and to leave that out for the other builtin (e.g. `__builtin_reduce_addf`), to give the compiler the freedom to pick any ordering.

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


More information about the cfe-commits mailing list