[Mlir-commits] [mlir] [mlir][OpenMP] Model recursive memory effects of omp.masked (PR #230493)

Tom Eccles llvmlistbot at llvm.org
Fri Oct 9 08:54:52 PDT 2026


================
@@ -143,3 +143,34 @@ func.func @constant_hoisting_target(%x : !llvm.ptr) {
 // CHECK-NOT: arith.constant
 // CHECK: omp.target
 // CHECK: arith.constant
+
+// -----
+
+// Masked has no implicit barrier so a body with no effects can be removed.
+// CHECK-LABEL: func.func @masked_no_side_effects
+// CHECK-NEXT: return
+func.func @masked_no_side_effects(%a: i32, %b: i32, %filter: i32) {
+  omp.masked filter(%filter : i32) {
+    %unused = arith.addi %a, %b : i32
+    omp.terminator
+  }
+  return
+}
+
+// -----
+
+// Masked must preserve memory effects in its body.
----------------
tblah wrote:

Same as for MASTER: this would be better in a side effects test

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


More information about the Mlir-commits mailing list