[Mlir-commits] [mlir] [MLIR][NVVM] Update redux.sync op (PR #166125)
Srinivasa Ravi
llvmlistbot at llvm.org
Mon Nov 3 03:22:30 PST 2025
================
@@ -0,0 +1,41 @@
+// RUN: mlir-translate -verify-diagnostics -split-input-file -mlir-to-llvmir %s
+
+// -----
+
+llvm.func @redux_sync_i32_with_abs(%value: i32, %offset: i32) {
+ // expected-error at +1 {{abs attribute is supported only for f32 type}}
+ %res = nvvm.redux.sync add %value, %offset {abs = true}: i32 -> i32
+ llvm.return
+}
+
+// -----
+
+llvm.func @redux_sync_i32_with_nan(%value: i32, %offset: i32) {
+ // expected-error at +1 {{nan attribute is supported only for f32 type}}
+ %res = nvvm.redux.sync add %value, %offset {nan = true}: i32 -> i32
+ llvm.return
+}
+
+// -----
+
+llvm.func @redux_sync_f32_with_invalid_kind(%value: f32, %offset: i32) {
+ // expected-error at +1 {{only fmin and fmax redux kinds are supported for f32 type}}
+ %res = nvvm.redux.sync add %value, %offset: f32 -> f32
+ llvm.return
+}
+
+// -----
+
+llvm.func @redux_sync_i32_with_invalid_kind(%value: i32, %offset: i32) {
+ // expected-error at +1 {{fmin and fmax redux kind must be used with f32 type}}
----------------
Wolfram70 wrote:
Went with a slightly different error message listing supported types (instead of supported redux kinds) since the code looked more concise that way.
https://github.com/llvm/llvm-project/pull/166125
More information about the Mlir-commits
mailing list