summaryrefslogtreecommitdiffstats
path: root/mlir/test/Transforms
diff options
context:
space:
mode:
authorRiver Riddle <riverriddle@google.com>2019-10-14 09:50:54 -0700
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-10-14 10:01:59 -0700
commit96de7091bcac2086fb3be55169ec4e826145c574 (patch)
treea0d2050ec8bbecd70642ad82706241bdc72580b6 /mlir/test/Transforms
parent24c392f21c6ea9d2e1dbe39728e8a2fddb25e740 (diff)
downloadbcm5719-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.mlir7
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"() : () -> ()
+}
// -----
OpenPOWER on IntegriCloud