Skip to content

Commit 4168f8e

Browse files
committed
comments
1 parent 892f813 commit 4168f8e

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

mlir/docs/PassManagement.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,19 +1401,22 @@ $ tree /tmp/pipeline_output
14011401
* `mlir-use-nameloc-as-prefix`
14021402
* If your source IR has named locations (`loc("named_location")"`) then passing this flag will use those
14031403
names (`named_location`) to prefix the corresponding SSA identifiers:
1404-
```
1404+
1405+
```mlir
14051406
%1 = memref.load %0[] : memref<i32> loc("alice")
14061407
%2 = memref.load %0[] : memref<i32> loc("bob")
14071408
%3 = memref.load %0[] : memref<i32> loc("bob")
14081409
```
1410+
14091411
will print
1410-
```
1412+
1413+
```mlir
14111414
%alice = memref.load %0[] : memref<i32>
14121415
%bob = memref.load %0[] : memref<i32>
14131416
%bob_0 = memref.load %0[] : memref<i32>
14141417
```
1415-
These names will also be preserved through passes to newly created operations
1416-
(assuming the pass writer was diligent about forward `Location` information).
1418+
1419+
These names will also be preserved through passes to newly created operations if using the appropriate location.
14171420
14181421
14191422
## Crash and Failure Reproduction

mlir/lib/IR/AsmPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ bool OpPrintingFlags::shouldPrintUniqueSSAIDs() const {
369369
return printUniqueSSAIDsFlag || shouldPrintGenericOpForm();
370370
}
371371

372-
/// Return if the printer should use NameLocs as prefixes when printing SSA IDs
372+
/// Return if the printer should use NameLocs as prefixes when printing SSA IDs.
373373
bool OpPrintingFlags::shouldUseNameLocAsPrefix() const {
374374
return useNameLocAsPrefix;
375375
}

mlir/test/IR/print-use-nameloc-as-prefix.mlir

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// CHECK-LABEL: test_basic
55
func.func @test_basic() {
66
%0 = memref.alloc() : memref<i32>
7-
// CHECK: %alice
7+
// CHECK: %alice = memref.load
88
%1 = memref.load %0[] : memref<i32> loc("alice")
99
return
1010
}
@@ -14,9 +14,9 @@ func.func @test_basic() {
1414
// CHECK-LABEL: test_repeat_namelocs
1515
func.func @test_repeat_namelocs() {
1616
%0 = memref.alloc() : memref<i32>
17-
// CHECK: %alice
17+
// CHECK: %alice = memref.load
1818
%1 = memref.load %0[] : memref<i32> loc("alice")
19-
// CHECK: %alice_0
19+
// CHECK: %alice_0 = memref.load
2020
%2 = memref.load %0[] : memref<i32> loc("alice")
2121
return
2222
}
@@ -36,9 +36,9 @@ func.func private @make_two_results() -> (index, index)
3636

3737
// CHECK-LABEL: test_multiple_results
3838
func.func @test_multiple_results(%cond: i1) {
39-
// CHECK: %foo:2
39+
// CHECK: %foo:2 = call @make_two_results
4040
%0:2 = call @make_two_results() : () -> (index, index) loc("foo")
41-
// CHECK: %bar:2
41+
// CHECK: %bar:2 = call @make_two_results
4242
%1, %2 = call @make_two_results() : () -> (index, index) loc("bar")
4343

4444
// CHECK: %kevin:2 = scf.while (%arg1 = %bar#0, %arg2 = %bar#0)
@@ -65,9 +65,9 @@ func.func @test_multiple_results(%cond: i1) {
6565

6666
// CHECK-LABEL: test_op_asm_interface
6767
func.func @test_op_asm_interface(%arg0: tensor<?xf32>, %arg1: tensor<?xf32>) {
68-
// CHECK: %c0
68+
// CHECK: %c0 = arith.constant
6969
%0 = arith.constant 0 : index
70-
// CHECK: %foo
70+
// CHECK: %foo = arith.constant
7171
%1 = arith.constant 1 : index loc("foo")
7272

7373
linalg.generic #trait ins(%arg0: tensor<?xf32>) outs(%arg0, %arg1: tensor<?xf32>, tensor<?xf32>) {

0 commit comments

Comments
 (0)