Skip to content

Commit 6b8edc9

Browse files
authored
[mlir] Fix disagreement between document and test(NFC) (#109257)
1 parent e90a732 commit 6b8edc9

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

mlir/docs/Tutorials/UnderstandingTheIRStructure.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ llvm-project/mlir/test/IR/print-ir-nesting.mlir`:
9797
9898
```mlir
9999
"builtin.module"() ( {
100-
%0:4 = "dialect.op1"() {"attribute name" = 42 : i32} : () -> (i1, i16, i32, i64)
100+
%results:4 = "dialect.op1"() {"attribute name" = 42 : i32} : () -> (i1, i16, i32, i64)
101101
"dialect.op2"() ( {
102-
"dialect.innerop1"(%0#0, %0#1) : (i1, i16) -> ()
102+
"dialect.innerop1"(%results#0, %results#1) : (i1, i16) -> ()
103103
}, {
104104
"dialect.innerop2"() : () -> ()
105-
"dialect.innerop3"(%0#0, %0#2, %0#3)[^bb1, ^bb2] : (i1, i32, i64) -> ()
105+
"dialect.innerop3"(%results#0, %results#2, %results#3)[^bb1, ^bb2] : (i1, i32, i64) -> ()
106106
^bb1(%1: i32): // pred: ^bb0
107107
"dialect.innerop4"() : () -> ()
108108
"dialect.innerop5"() : () -> ()
@@ -125,6 +125,8 @@ visiting op: 'builtin.module' with 0 operands and 0 results
125125
- 'attribute name' : '42 : i32'
126126
0 nested regions:
127127
visiting op: 'dialect.op2' with 0 operands and 0 results
128+
1 attributes:
129+
- 'other attribute' : '42 : i64'
128130
2 nested regions:
129131
Region with 1 blocks:
130132
Block with 0 arguments, 0 successors, and 1 operations
@@ -146,7 +148,6 @@ visiting op: 'builtin.module' with 0 operands and 0 results
146148
0 nested regions:
147149
visiting op: 'dialect.innerop7' with 0 operands and 0 results
148150
0 nested regions:
149-
0 nested regions:
150151
```
151152

152153
## Other IR Traversal Methods

mlir/test/IR/print-ir-nesting.mlir

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// CHECK: 1 nested regions:
55
// CHECK: Region with 1 blocks:
66
// CHECK: Block with 0 arguments, 0 successors, and 2 operations
7-
module {
7+
"builtin.module"() ( {
88

99

1010
// CHECK: visiting op: 'dialect.op1' with 0 operands and 4 results
@@ -15,6 +15,8 @@ module {
1515

1616

1717
// CHECK: visiting op: 'dialect.op2' with 0 operands and 0 results
18+
// CHECK: 1 attributes:
19+
// CHECK: - 'other attribute' : '42 : i64'
1820
// CHECK: 2 nested regions:
1921
"dialect.op2"() ({
2022

@@ -50,6 +52,5 @@ module {
5052
// CHECK: visiting op: 'dialect.innerop7' with 0 operands and 0 results
5153
// CHECK: 0 nested regions:
5254
"dialect.innerop7"() : () -> ()
53-
}) : () -> ()
54-
55-
} // module
55+
}) {"other attribute" = 42 : i64} : () -> ()
56+
}) : () -> ()

0 commit comments

Comments
 (0)