[Mlir-commits] [mlir] [mlir][GPU] Extend gpu.barrier with scope and named-barrier support (PR #195692)

Bangtian Liu llvmlistbot at llvm.org
Mon May 4 15:51:26 PDT 2026


================
@@ -670,6 +670,12 @@ class BarrierElimination final : public OpRewritePattern<BarrierOp> {
     LDBG() << "checking the necessity of: " << barrier << " "
            << barrier.getLoc();
 
+    // Named barriers have precise arrival-count semantics; never eliminate.
----------------
bangtianliu wrote:

Should we also add a scope guard similar to the named barrier guard

like 

```cpp
if (barrier.getScope() != gpu::Scope::Workgroup) {
  LDBG() << "barrier has non-workgroup scope, retain it\n";
  return failure();
}
```

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


More information about the Mlir-commits mailing list