[Mlir-commits] [mlir] [MLIR][NVVM] Adds an explicit aligned boolean attribute to nvvm.barrier (PR #192203)

Durgadoss R llvmlistbot at llvm.org
Wed Apr 22 01:09:36 PDT 2026


durga4github wrote:

> > Thanks @durga4github.
> > https://github.com/llvm/llvm-project/blob/0f4b9a7f2efaadd617994741bd2e61642ef2f96b/mlir/test/Dialect/LLVMIR/nvvm.mlir#L50
> > 
> > https://github.com/llvm/llvm-project/blob/bfdf30a8d0437ec8999ad03e00c6ceea6397c833/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp#L3440
> > 
> > According to the existing part of codebase, the canonical MLIR form for "barrier at id 0" is `nvvm.barrier` with no operand which is identical to hand-written format, the intension that folding the "ID=0" into a form with no ID is matching the import IR looks identical with hand-written IR, without this fold, `nvvm.barrier` and imported IR `nvvm.barrier id = %c0` will co-existing, which feels like not so good for down stream pattern matching.
> > So I add canonicalization pattern and loose the **verfier**. While enforcing barrier_id existence is a good choice, I am happy to wait for your suggestion.
> 
> @durga4github Hello, could you also share thoughts to it?

ok, your reasoning makes sense. As I mentioned above, I do not think using a default value of 0 for the bar-ID buys us much. I believe it was modelled on top of older intrinsic variants, and the barrier-family intrinsics were recently refactored and redesigned. so, we could leverage them and enforce specifying an ID always.

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


More information about the Mlir-commits mailing list