|
MLIR 22.0.0git
|
A specialized listener that keeps track of cases in which no replacement payload could be found. More...
#include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.h"
Public Member Functions | |
| ~ErrorCheckingTrackingListener () override | |
| DiagnosedSilenceableFailure | checkAndResetError () |
| Check and return the current error state of this listener. | |
| std::string | getLatestMatchFailureMessage () |
| Return the latest match notification message. | |
| bool | failed () const |
| Return "true" if this tracking listener had a failure. | |
| TrackingListener (TransformState &state, TransformOpInterface op, TrackingListenerConfig config=TrackingListenerConfig()) | |
| Create a new TrackingListener for usage in the specified transform op. | |
| Public Member Functions inherited from mlir::transform::TrackingListener | |
| TrackingListener (TransformState &state, TransformOpInterface op, TrackingListenerConfig config=TrackingListenerConfig()) | |
| Create a new TrackingListener for usage in the specified transform op. | |
| Public Member Functions inherited from mlir::RewriterBase::Listener | |
| Listener () | |
| virtual void | notifyBlockErased (Block *block) |
| Notify the listener that the specified block is about to be erased. | |
| virtual void | notifyOperationModified (Operation *op) |
| Notify the listener that the specified operation was modified in-place. | |
| virtual void | notifyOperationReplaced (Operation *op, Operation *replacement) |
| Notify the listener that all uses of the specified operation's results are about to be replaced with the results of another operation. | |
| virtual void | notifyPatternBegin (const Pattern &pattern, Operation *op) |
| Notify the listener that the specified pattern is about to be applied at the specified root operation. | |
| virtual void | notifyPatternEnd (const Pattern &pattern, LogicalResult status) |
| Notify the listener that a pattern application finished with the specified status. | |
| Public Member Functions inherited from mlir::OpBuilder::Listener | |
| Listener () | |
| virtual | ~Listener ()=default |
| virtual void | notifyOperationInserted (Operation *op, InsertPoint previous) |
| Notify the listener that the specified operation was inserted. | |
| virtual void | notifyBlockInserted (Block *block, Region *previous, Region::iterator previousIt) |
| Notify the listener that the specified block was inserted. | |
| Public Member Functions inherited from mlir::OpBuilder::ListenerBase | |
| Kind | getKind () const |
| Public Member Functions inherited from mlir::transform::TransformState::Extension | |
| virtual | ~Extension () |
| Base virtual destructor. | |
Protected Member Functions | |
| void | notifyMatchFailure (Location loc, function_ref< void(Diagnostic &)> reasonCallback) override |
| Notify the listener that the pattern failed to match, and provide a callback to populate a diagnostic with the reason why the failure occurred. | |
| void | notifyPayloadReplacementNotFound (Operation *op, ValueRange values, DiagnosedSilenceableFailure &&diag) override |
| This function is called when a tracked payload op is dropped because no replacement op was found. | |
| Protected Member Functions inherited from mlir::transform::TrackingListener | |
| virtual DiagnosedSilenceableFailure | findReplacementOp (Operation *&result, Operation *op, ValueRange newValues) const |
| Return a replacement payload op for the given op, which is going to be replaced with the given values. | |
| void | notifyMatchFailure (Location loc, function_ref< void(Diagnostic &)> reasonCallback) override |
| Notify the listener that the pattern failed to match the given operation, and provide a callback to populate a diagnostic with the reason why the failure occurred. | |
| TransformOpInterface | getTransformOp () const |
| Return the transform op in which this TrackingListener is used. | |
| Protected Member Functions inherited from mlir::OpBuilder::Listener | |
| Listener (Kind kind) | |
| Protected Member Functions inherited from mlir::OpBuilder::ListenerBase | |
| ListenerBase (Kind kind) | |
| Protected Member Functions inherited from mlir::transform::TransformState::Extension | |
| Extension (TransformState &state) | |
| Constructs an extension of the given TransformState object. | |
| const TransformState & | getTransformState () const |
| Provides read-only access to the parent TransformState object. | |
| LogicalResult | replacePayloadOp (Operation *op, Operation *replacement) |
| Replaces the given payload op with another op. | |
| LogicalResult | replacePayloadValue (Value value, Value replacement) |
| Replaces the given payload value with another value. | |
Additional Inherited Members | |
| Public Types inherited from mlir::OpBuilder::ListenerBase | |
| enum class | Kind { OpBuilderListener = 0 , RewriterBaseListener = 1 } |
| The kind of listener. More... | |
| Static Public Member Functions inherited from mlir::RewriterBase::Listener | |
| static bool | classof (const OpBuilder::Listener *base) |
| Static Protected Member Functions inherited from mlir::transform::TrackingListener | |
| static Operation * | getCommonDefiningOp (ValueRange values) |
| Return the single op that defines all given values (if any). | |
A specialized listener that keeps track of cases in which no replacement payload could be found.
The error state of this listener must be checked before the end of its lifetime.
Definition at line 1067 of file TransformInterfaces.h.
|
override |
Definition at line 1340 of file TransformInterfaces.cpp.
| DiagnosedSilenceableFailure transform::ErrorCheckingTrackingListener::checkAndResetError | ( | ) |
Check and return the current error state of this listener.
Afterwards, resets the error state to "success".
Definition at line 1348 of file TransformInterfaces.cpp.
References mlir::DiagnosedSilenceableFailure::success().
Referenced by mlir::transform::TransformState::applyTransform().
| bool transform::ErrorCheckingTrackingListener::failed | ( | ) | const |
Return "true" if this tracking listener had a failure.
Definition at line 1355 of file TransformInterfaces.cpp.
| std::string transform::ErrorCheckingTrackingListener::getLatestMatchFailureMessage | ( | ) |
Return the latest match notification message.
Returns an empty string when no error message was captured.
Definition at line 1378 of file TransformInterfaces.cpp.
|
overrideprotectedvirtual |
Notify the listener that the pattern failed to match, and provide a callback to populate a diagnostic with the reason why the failure occurred.
This method allows for derived listeners to optionally hook into the reason why a rewrite failed, and display it to users.
Reimplemented from mlir::RewriterBase::Listener.
Definition at line 1385 of file TransformInterfaces.cpp.
References diag(), and mlir::Remark.
|
overrideprotectedvirtual |
This function is called when a tracked payload op is dropped because no replacement op was found.
Derived classes can implement this function for custom error handling.
Reimplemented from mlir::transform::TrackingListener.
Definition at line 1359 of file TransformInterfaces.cpp.
References diag(), mlir::Operation::getLoc(), mlir::Value::getLoc(), and mlir::DiagnosedSilenceableFailure::silenceableFailure().
| transform::TrackingListener::TrackingListener | ( | TransformState & | state, |
| TransformOpInterface | op, | ||
| TrackingListenerConfig | config = TrackingListenerConfig() ) |
Create a new TrackingListener for usage in the specified transform op.
Optionally, a function can be specified to identify handles that should do not have to be updated.
Definition at line 969 of file TransformInterfaces.cpp.
References mlir::Value::getType().