[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 00:13:21 PDT 2026


================
@@ -1179,16 +1183,20 @@ def NVVM_BarrierOp : NVVM_SingleResultIntrinsicOp<"barrier",
   let results = (outs Optional<I32>:$res);
 
   let hasVerifier = 1;
+  let hasCanonicalizeMethod = 1;
 
   let assemblyFormat =
       "(`id` `=` $barrierId^)? (`number_of_threads` `=` $numberOfThreads^)? "
+      "custom<Aligned>($aligned) "
----------------
durga4github wrote:

ok, I see .. I think we are hitting the limits of the existing Parser when we have many optional attributes/operands.

Taking a step back, 

I think, a lot of this complexity exists because we try to handle both `red` and the simple `barrier` versions in the same Op. I believe splitting the `red` into its own `barrier.red` Op will simplify things here. 
(Some pieces of the Verifier logic can be shared across both the Ops).

@grypp , Please let us know your thoughts. 

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


More information about the Mlir-commits mailing list