[llvm] Add `llvm.vector.partial.reduce.fadd` intrinsic (PR #159776)
Sander de Smalen via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 9 09:18:05 PDT 2025
================
@@ -20717,20 +20729,32 @@ The first argument is an integer vector with the same type as the result.
The second argument is a vector with a length that is a known integer multiple
of the result's type, while maintaining the same element type.
-Semantics:
+'``llvm.vector.partial.reduce.fadd.*``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+This is an overloaded intrinsic.
+
+::
+
+ declare <4 x f32> @llvm.vector.partial.reduce.fadd.v4f32.v8f32(<4 x f32> %a, <8 x f32> %b)
+ declare <vscale x 4 x f32> @llvm.vector.partial.reduce.fadd.nxv4f32.nxv8f32(<vscale x 4 x f32> %a, <vscale x 8 x f32> %b)
+
+Arguments:
""""""""""
-Other than the reduction operator (e.g. add) the way in which the concatenated
-arguments is reduced is entirely unspecified. By their nature these intrinsics
-are not expected to be useful in isolation but instead implement the first phase
-of an overall reduction operation.
+The first argument is a floating-point vector with the same type as the result.
-The typical use case is loop vectorization where reductions are split into an
-in-loop phase, where maintaining an unordered vector result is important for
-performance, and an out-of-loop phase to calculate the final scalar result.
+The second argument is a vector with a length that is a known integer multiple
+of the result's type, while maintaining the same element type.
-By avoiding the introduction of new ordering constraints, these intrinsics
-enhance the ability to leverage a target's accumulation instructions.
+Semantics:
+""""""""""
+
+As the way in which the arguments to this floating-point intrinsic are reduced is unspecified,
+this intrinsic will reassociate floating-point values, which may result in variations to the
----------------
sdesmalen-arm wrote:
As well as reassociation, this should also mention that the intrinsic is allowed to assume [floating point contraction](https://llvm.org/docs/LangRef.html#rewrite-based-flags)
https://github.com/llvm/llvm-project/pull/159776
More information about the llvm-commits
mailing list