diff options
author | Matthias Springer <me@m-sp.org> | 2023-05-12 10:04:13 +0200 |
---|---|---|
committer | Matthias Springer <me@m-sp.org> | 2023-05-12 15:07:20 +0200 |
commit | 7d436d56b60b36508b94e39d08761f1405a9c770 (patch) | |
tree | 7c42a607e3e02af08e401c206491f7af0c3f7f1e /mlir/include | |
parent | 81be68062f49dccfb0c28b98f04d88b5343c4ae6 (diff) | |
download | llvm-7d436d56b60b36508b94e39d08761f1405a9c770.tar.gz |
[mlir][transform] TrackingListener: Allow existing ops as replacements
The TrackingListener was unnecessarily strict. Existing ops are now allowed when updating payload ops mappings due to `replaceOp` in the TrackingListener.
Differential Revision: https://reviews.llvm.org/D150429
Diffstat (limited to 'mlir/include')
-rw-r--r-- | mlir/include/mlir/Dialect/Transform/IR/TransformOps.h | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/mlir/include/mlir/Dialect/Transform/IR/TransformOps.h b/mlir/include/mlir/Dialect/Transform/IR/TransformOps.h index b6bc094d8ba5..7a0f80200cc4 100644 --- a/mlir/include/mlir/Dialect/Transform/IR/TransformOps.h +++ b/mlir/include/mlir/Dialect/Transform/IR/TransformOps.h @@ -48,8 +48,8 @@ public: protected: /// Return a replacement payload op for the given op, which is going to be /// replaced with the given values. By default, if all values are defined by - /// the same newly-created op, which also has the same type as the given op, - /// that defining op is used as a replacement. + /// the same op, which also has the same type as the given op, that defining + /// op is used as a replacement. virtual Operation *findReplacementOp(Operation *op, ValueRange newValues) const; @@ -66,22 +66,14 @@ protected: virtual void notifyPayloadReplacementNotFound(Operation *op, ValueRange values) {} - /// Return "true" if the given op is a new op. - bool isNewOp(Operation *op) const; - /// Return the single op that defines all given values (if any). static Operation *getCommonDefiningOp(ValueRange values); private: - void notifyOperationInserted(Operation *op) override; - void notifyOperationRemoved(Operation *op) override; void notifyOperationReplaced(Operation *op, ValueRange newValues) override; - /// Ops that were newly created during the transform. - DenseMap<OperationName, DenseSet<Operation *>> newOps; - /// The transform op in which this TrackingListener is used. TransformOpInterface transformOp; }; |