[Mlir-commits] [mlir] [mlir][OpenACC][NFC] Fix par_width syntax in code examples (PR #222291)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Sep 9 03:36:40 PDT 2026


https://github.com/leovancekang created https://github.com/llvm/llvm-project/pull/222291

Update the acc.predicate_region documentation and the ACCCGToGPU example to use the explicit par_dim(...) syntax required since #217298.

These examples still use the old attribute-dictionary spelling. This is a documentation-only change; operation definitions and lowering behavior are unchanged.

>From 1b8821ccde08b5a051816a61a6398ab715ef843a Mon Sep 17 00:00:00 2001
From: leovancekang <leovancekang at outlook.com>
Date: Tue, 8 Sep 2026 16:02:58 +0800
Subject: [PATCH] [mlir][OpenACC][NFC] Fix par_width syntax in code examples

Update the acc.predicate_region documentation and the ACCCGToGPU example
to use the explicit par_dim(...) syntax required since #217298.

These examples still use the old attribute-dictionary spelling. This is
a documentation-only change; operation definitions and lowering behavior
are unchanged.
---
 mlir/include/mlir/Dialect/OpenACC/OpenACCCGOps.td  | 4 ++--
 mlir/lib/Dialect/OpenACC/Transforms/ACCCGToGPU.cpp | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCCGOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCCGOps.td
index 30dc6f73062e6..0a64262892198 100644
--- a/mlir/include/mlir/Dialect/OpenACC/OpenACCCGOps.td
+++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCCGOps.td
@@ -713,8 +713,8 @@ def OpenACC_PredicateRegionOp
     //   !$acc atomic update
     //   !$acc loop vector
     //     !$acc atomic update
-    %w_gang = acc.par_width %cNG {par_dim = #acc.par_dim<block_x>}
-    %w_vector = acc.par_width %cVL {par_dim = #acc.par_dim<thread_x>}
+    %w_gang = acc.par_width %cNG par_dim(#acc.par_dim<block_x>)
+    %w_vector = acc.par_width %cVL par_dim(#acc.par_dim<thread_x>)
     acc.compute_region launch(%ng = %w_gang, %vl = %w_vector)
         ins(%arg_c1 = %c1, %arg_c2 = %c2) : (memref<i32>, memref<i32>) {
       scf.parallel (%i) = (%c1) to (%cN) step (%c1) {
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCCGToGPU.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCCGToGPU.cpp
index 90442294d668c..489dbe5aab08f 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCCGToGPU.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCCGToGPU.cpp
@@ -53,7 +53,7 @@
 // --------
 // Before:
 //   %c128 = arith.constant 128 : index
-//   %tx = acc.par_width %c128 {par_dim = #acc.par_dim<thread_x>}
+//   %tx = acc.par_width %c128 par_dim(#acc.par_dim<thread_x>)
 //   acc.compute_region launch(%arg0 = %tx) {
 //     %c0 = arith.constant 0 : index
 //     %c1 = arith.constant 1 : index



More information about the Mlir-commits mailing list