[Mlir-commits] [mlir] [mlir] Fix disagreement between document and test(NFC) (PR #109257)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Sep 19 02:12:31 PDT 2024


https://github.com/csstormq created https://github.com/llvm/llvm-project/pull/109257

None

>From 866453ec17ef6c6d42e2bc6b880ca24d0877c2b6 Mon Sep 17 00:00:00 2001
From: csstormq <swust_xiaoqiangxu at 163.com>
Date: Thu, 19 Sep 2024 17:05:16 +0800
Subject: [PATCH] [mlir] Fix disagreement between document and test(NFC)

---
 mlir/docs/Tutorials/UnderstandingTheIRStructure.md | 9 +++++----
 mlir/test/IR/print-ir-nesting.mlir                 | 9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/mlir/docs/Tutorials/UnderstandingTheIRStructure.md b/mlir/docs/Tutorials/UnderstandingTheIRStructure.md
index ed323fc42336bc..de8e0bea57921c 100644
--- a/mlir/docs/Tutorials/UnderstandingTheIRStructure.md
+++ b/mlir/docs/Tutorials/UnderstandingTheIRStructure.md
@@ -97,12 +97,12 @@ llvm-project/mlir/test/IR/print-ir-nesting.mlir`:
 
 ```mlir
 "builtin.module"() ( {
-  %0:4 = "dialect.op1"() {"attribute name" = 42 : i32} : () -> (i1, i16, i32, i64)
+  %results:4 = "dialect.op1"() {"attribute name" = 42 : i32} : () -> (i1, i16, i32, i64)
   "dialect.op2"() ( {
-    "dialect.innerop1"(%0#0, %0#1) : (i1, i16) -> ()
+    "dialect.innerop1"(%results#0, %results#1) : (i1, i16) -> ()
   },  {
     "dialect.innerop2"() : () -> ()
-    "dialect.innerop3"(%0#0, %0#2, %0#3)[^bb1, ^bb2] : (i1, i32, i64) -> ()
+    "dialect.innerop3"(%results#0, %results#2, %results#3)[^bb1, ^bb2] : (i1, i32, i64) -> ()
   ^bb1(%1: i32):  // pred: ^bb0
     "dialect.innerop4"() : () -> ()
     "dialect.innerop5"() : () -> ()
@@ -125,6 +125,8 @@ visiting op: 'builtin.module' with 0 operands and 0 results
        - 'attribute name' : '42 : i32'
        0 nested regions:
       visiting op: 'dialect.op2' with 0 operands and 0 results
+      1 attributes:
+       - 'other attribute' : '42 : i64'
        2 nested regions:
         Region with 1 blocks:
           Block with 0 arguments, 0 successors, and 1 operations
@@ -146,7 +148,6 @@ visiting op: 'builtin.module' with 0 operands and 0 results
              0 nested regions:
             visiting op: 'dialect.innerop7' with 0 operands and 0 results
              0 nested regions:
-       0 nested regions:
 ```
 
 ## Other IR Traversal Methods
diff --git a/mlir/test/IR/print-ir-nesting.mlir b/mlir/test/IR/print-ir-nesting.mlir
index 6afbfd918b5373..7d5fa31bfde794 100644
--- a/mlir/test/IR/print-ir-nesting.mlir
+++ b/mlir/test/IR/print-ir-nesting.mlir
@@ -4,7 +4,7 @@
 // CHECK:  1 nested regions:
 // CHECK:   Region with 1 blocks:
 // CHECK:     Block with 0 arguments, 0 successors, and 2 operations
-module {
+"builtin.module"() ( {
 
 
 // CHECK:       visiting op: 'dialect.op1' with 0 operands and 4 results
@@ -15,6 +15,8 @@ module {
 
 
 // CHECK:       visiting op: 'dialect.op2' with 0 operands and 0 results
+// CHECK:       1 attributes:
+// CHECK:        - 'other attribute' : '42 : i64'
 // CHECK:        2 nested regions:
   "dialect.op2"() ({
 
@@ -50,6 +52,5 @@ module {
 // CHECK:             visiting op: 'dialect.innerop7' with 0 operands and 0 results
 // CHECK:              0 nested regions:
     "dialect.innerop7"() : () -> ()
-  }) : () -> ()
-
-} // module
+  }) {"other attribute" = 42 : i64} : () -> ()
+}) : () -> ()



More information about the Mlir-commits mailing list