[llvm] [LLVM] Add `llvm.vector.reduce.{min, max}imumnum` (PR #218295)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 01:51:31 PDT 2026


================
@@ -20390,6 +20390,72 @@ than +0.0. If any element of the vector is a NaN, the result is NaN.
 ##### Arguments:
 The argument to this intrinsic must be a vector of floating-point values.
 
+(int_vector_reduce_fmaximumnum)=
+
+#### '`llvm.vector.reduce.fmaximumnum.*`' Intrinsic
+
+##### Syntax:
+This is an overloaded intrinsic.
+
+```
+declare float @llvm.vector.reduce.fmaximumnum.v4f32(<4 x float> %a)
+declare double @llvm.vector.reduce.fmaximumnum.v2f64(<2 x double> %a)
+```
+
+##### Overview:
+
+The '`llvm.vector.reduce.fmaximumnum.*`' intrinsics do a floating-point
+`MAX` reduction of a vector, returning the result as a scalar. The return type
+matches the element-type of the vector input.
+
+This instruction has the same comparison and `nsz` semantics as the
+'`llvm.maximumnum.*`' intrinsic:
----------------
nikic wrote:

```suggestion
'`llvm.maximumnum.*`' intrinsic.
```

I'd rather not repeat the semantics of min/max intrinsics in more places than necessary.

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


More information about the llvm-commits mailing list