diff options
| author | Lei Zhang <antiagainst@google.com> | 2019-07-26 04:31:15 -0700 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-07-26 04:31:46 -0700 |
| commit | 9f02e88946705e1db2489ede0a74cba2d54f0ca8 (patch) | |
| tree | 46b08054b73fc5778c7a854c1e75aa162bbff46f /mlir/lib/TableGen | |
| parent | 54175c240a8198c621caa83c418b5b067c9c9c40 (diff) | |
| download | bcm5719-llvm-9f02e88946705e1db2489ede0a74cba2d54f0ca8.tar.gz bcm5719-llvm-9f02e88946705e1db2489ede0a74cba2d54f0ca8.zip | |
Support referencing a single value generated by a matched multi-result op
It's quite common that we want to put further constraints on the matched
multi-result op's specific results. This CL enables referencing symbols
bound to source op with the `__N` syntax.
PiperOrigin-RevId: 260122401
Diffstat (limited to 'mlir/lib/TableGen')
| -rw-r--r-- | mlir/lib/TableGen/Pattern.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mlir/lib/TableGen/Pattern.cpp b/mlir/lib/TableGen/Pattern.cpp index 467c3d5c177..e53d050ae78 100644 --- a/mlir/lib/TableGen/Pattern.cpp +++ b/mlir/lib/TableGen/Pattern.cpp @@ -187,7 +187,8 @@ tblgen::Pattern::getSourcePatternBoundArgs() { return boundArguments; } -llvm::StringSet<> &tblgen::Pattern::getSourcePatternBoundOps() { +llvm::StringMap<const tblgen::Operator *> & +tblgen::Pattern::getSourcePatternBoundOps() { return boundOps; } @@ -263,7 +264,7 @@ void tblgen::Pattern::collectBoundArguments(DagNode tree) { // results generated from this op. It should be remembered as bound results. auto treeName = tree.getOpName(); if (!treeName.empty()) - boundOps.insert(treeName); + boundOps.try_emplace(treeName, &op); // TODO(jpienaar): Expand to multiple matches. for (int i = 0; i != numTreeArgs; ++i) { |

