[clang] [llvm] cuda clang: Fix argument order for __reduce_max_sync (PR #132881)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 25 14:36:05 PDT 2025


================
@@ -315,7 +315,7 @@ defm MATCH_ALLP_SYNC_64 : MATCH_ALLP_SYNC<Int64Regs, "b64", int_nvvm_match_all_s
 multiclass REDUX_SYNC<string BinOp, string PTXType, Intrinsic Intrin> {
   def : NVPTXInst<(outs Int32Regs:$dst), (ins Int32Regs:$src, Int32Regs:$mask),
           "redux.sync." # BinOp # "." # PTXType # " $dst, $src, $mask;",
-          [(set i32:$dst, (Intrin i32:$src, Int32Regs:$mask))]>,
+          [(set i32:$dst, (Intrin i32:$mask, Int32Regs:$src))]>,
----------------
Artem-B wrote:

Good catch.

Parameters should be swapped in https://github.com/llvm/llvm-project/blob/960615954e4cb3150ae4a479fa7f9d0d17035eea/clang/lib/Headers/__clang_cuda_intrinsics.h#L518-L544


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


More information about the llvm-commits mailing list