summaryrefslogtreecommitdiffstats
path: root/mlir/test/lib/TestDialect
diff options
context:
space:
mode:
authorLei Zhang <antiagainst@google.com>2019-12-02 07:54:23 -0800
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-12-02 07:54:50 -0800
commit4982eaf87cf879fe47173ce640f87b7f9f103b73 (patch)
tree4557cda78835b73f076c8764f521d08ca0153e43 /mlir/test/lib/TestDialect
parent0d22a3fdc87cb8e96a73cb427c6621c405c4674e (diff)
downloadbcm5719-llvm-4982eaf87cf879fe47173ce640f87b7f9f103b73.tar.gz
bcm5719-llvm-4982eaf87cf879fe47173ce640f87b7f9f103b73.zip
[DRR] Introduce `$_` to ignore op argument match
Right now op argument matching in DRR is position-based, meaning we need to specify N arguments for an op with N ODS-declared argument. This can be annoying when we don't want to capture all the arguments. `$_` is to remedy the situation. PiperOrigin-RevId: 283339992
Diffstat (limited to 'mlir/test/lib/TestDialect')
-rw-r--r--mlir/test/lib/TestDialect/TestOps.td12
1 files changed, 12 insertions, 0 deletions
diff --git a/mlir/test/lib/TestDialect/TestOps.td b/mlir/test/lib/TestDialect/TestOps.td
index 6bb0cbc7f0c..6952eaa7717 100644
--- a/mlir/test/lib/TestDialect/TestOps.td
+++ b/mlir/test/lib/TestDialect/TestOps.td
@@ -479,6 +479,18 @@ def OpJ : TEST_Op<"op_j">, Arguments<(ins)>, Results<(outs I32)>;
def OpK : TEST_Op<"op_k">, Arguments<(ins)>, Results<(outs I32)>;
def : Pat<(OpJ), (OpK)>;
+// Test `$_` for ignoring op argument match.
+def TestIgnoreArgMatchSrcOp : TEST_Op<"ignore_arg_match_src"> {
+ let arguments = (ins
+ AnyType:$a, AnyType:$b, AnyType:$c,
+ AnyAttr:$d, AnyAttr:$e, AnyAttr:$f);
+}
+def TestIgnoreArgMatchDstOp : TEST_Op<"ignore_arg_match_dst"> {
+ let arguments = (ins AnyType:$b, AnyAttr:$f);
+}
+def : Pat<(TestIgnoreArgMatchSrcOp $_, $b, I32, I64Attr:$_, $_, $f),
+ (TestIgnoreArgMatchDstOp $b, $f)>;
+
def OpInterleavedOperandAttribute1 : TEST_Op<"interleaved_operand_attr1"> {
let arguments = (ins
I32:$input1,
OpenPOWER on IntegriCloud