Skip to content

Commit

Permalink
[mlir] Fix disagreement between document and test(NFC) (llvm#109257)
Browse files Browse the repository at this point in the history
  • Loading branch information
csstormq authored Sep 20, 2024
1 parent e90a732 commit 6b8edc9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions mlir/docs/Tutorials/UnderstandingTheIRStructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"() : () -> ()
Expand All @@ -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
Expand All @@ -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
Expand Down
9 changes: 5 additions & 4 deletions mlir/test/IR/print-ir-nesting.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"() ({

Expand Down Expand Up @@ -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} : () -> ()
}) : () -> ()

0 comments on commit 6b8edc9

Please sign in to comment.