diff options
| author | River Riddle <riverriddle@google.com> | 2019-10-14 09:50:54 -0700 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-10-14 10:01:59 -0700 |
| commit | 96de7091bcac2086fb3be55169ec4e826145c574 (patch) | |
| tree | a0d2050ec8bbecd70642ad82706241bdc72580b6 /mlir/test/Transforms | |
| parent | 24c392f21c6ea9d2e1dbe39728e8a2fddb25e740 (diff) | |
| download | bcm5719-llvm-96de7091bcac2086fb3be55169ec4e826145c574.tar.gz bcm5719-llvm-96de7091bcac2086fb3be55169ec4e826145c574.zip | |
Allowing replacing non-root operations in DialectConversion.
When dealing with regions, or other patterns that need to generate temporary operations, it is useful to be able to replace other operations than the root op being matched. Before this PR, these operations would still be considered for legalization meaning that the conversion would either fail, erroneously need to mark these ops as legal, or add unnecessary patterns.
PiperOrigin-RevId: 274598513
Diffstat (limited to 'mlir/test/Transforms')
| -rw-r--r-- | mlir/test/Transforms/test-legalizer-full.mlir | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mlir/test/Transforms/test-legalizer-full.mlir b/mlir/test/Transforms/test-legalizer-full.mlir index 79494c798e1..2cf981b0db9 100644 --- a/mlir/test/Transforms/test-legalizer-full.mlir +++ b/mlir/test/Transforms/test-legalizer-full.mlir @@ -19,6 +19,13 @@ func @dropped_region_with_illegal_ops() { }) : () -> () "test.return"() : () -> () } +// CHECK-LABEL: func @replace_non_root_illegal_op +func @replace_non_root_illegal_op() { + // CHECK-NEXT: "test.legal_op_b" + // CHECK-NEXT: test.return + %result = "test.replace_non_root"() : () -> (i32) + "test.return"() : () -> () +} // ----- |

