Skip to content

[mlir] Fix disagreement between document and test(NFC) #109257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

csstormq
Copy link
Contributor

No description provided.

@llvmbot llvmbot added the mlir label Sep 19, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 19, 2024

@llvm/pr-subscribers-mlir

Author: None (csstormq)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/109257.diff

2 Files Affected:

  • (modified) mlir/docs/Tutorials/UnderstandingTheIRStructure.md (+5-4)
  • (modified) mlir/test/IR/print-ir-nesting.mlir (+5-4)
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} : () -> ()
+}) : () -> ()

@csstormq csstormq requested a review from joker-eph September 19, 2024 09:39
@csstormq csstormq merged commit 6b8edc9 into llvm:main Sep 20, 2024
10 checks passed
@csstormq csstormq deleted the fix_doc branch September 20, 2024 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants