[Mlir-commits] [mlir] [mlir] fix memory effects in GPU barrier elimination (PR #117432)

Fabian Mora llvmlistbot at llvm.org
Sat Nov 23 11:44:47 PST 2024


================
@@ -182,3 +182,18 @@ attributes {__parallel_region_boundary_for_test} {
   %4 = memref.load %C[] : memref<f32>
   return %0, %1, %2, %3, %4 : f32, f32, f32, f32, f32
 }
+
+// CHECK-LABEL: @nested_loop_barrier_only
+func.func @nested_loop_barrier_only() attributes {__parallel_region_boundary_for_test} {
+  %c0 = arith.constant 0 : index
+  %c42 = arith.constant 42 : index
+  %c1 = arith.constant 1 : index
+  // CHECK-NOT: scf.for
----------------
fabianmcg wrote:

Comment for readability.
```suggestion
  // Note: the barrier can be removed and as consequence the loops get folded
  // by the greedy rewriter.
  // CHECK-NOT: scf.for
```

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


More information about the Mlir-commits mailing list