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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Apr 17 21:26:50 PDT 2026


xys-syx 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 also a good choice, I am happy to wait for your suggestion. 

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


More information about the Mlir-commits mailing list