[llvm] [AMDGPU] Extend wave reduce intrinsics for i32 type (PR #126469)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 27 01:40:06 PDT 2025


================
@@ -2327,8 +2327,14 @@ class AMDGPUWaveReduce<LLVMType data_ty = llvm_anyint_ty> : Intrinsic<
     ],
     [IntrNoMem, IntrConvergent, IntrWillReturn, IntrNoCallback, IntrNoFree, ImmArg<ArgIndex<1>>]>;
 
-def int_amdgcn_wave_reduce_umin : AMDGPUWaveReduce;
-def int_amdgcn_wave_reduce_umax : AMDGPUWaveReduce;
+multiclass AMDGPUWaveReduceOps<list<string> Operations> {
+  foreach Op = Operations in { def Op : AMDGPUWaveReduce; }
+}
+
+defvar Operations = [
+  "umin", "min", "umax", "max", "uadd", "add", "usub", "sub", "and", "or", "xor"
+];
----------------
arsenm wrote:

Might as well inline this into the multi class and avoid the class parameter 

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


More information about the llvm-commits mailing list