[Mlir-commits] [mlir] [mlir][OpenMP] Model recursive memory effects of omp.masked (PR #230493)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Oct 13 08:00:53 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.
----------------
JRP-arm wrote:
I've changed the test-side-effects pass to emit recursive side effects when the `test_recursive_memory_effects` attribute is specified.
The memory effect tests have been moved to memory-effects.mlir with direct testing.
https://github.com/llvm/llvm-project/pull/230493
More information about the Mlir-commits
mailing list