MLIR
21.0.0git
|
#include "mlir/IR/PatternMatch.h"
Public Member Functions | |
Listener () | |
virtual void | notifyBlockErased (Block *block) |
Notify the listener that the specified block is about to be erased. More... | |
virtual void | notifyOperationModified (Operation *op) |
Notify the listener that the specified operation was modified in-place. More... | |
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. More... | |
virtual void | notifyOperationReplaced (Operation *op, ValueRange replacement) |
Notify the listener that all uses of the specified operation's results are about to be replaced with the a range of values, potentially produced by other operations. More... | |
virtual void | notifyOperationErased (Operation *op) |
Notify the listener that the specified operation is about to be erased. More... | |
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. More... | |
virtual void | notifyPatternEnd (const Pattern &pattern, LogicalResult status) |
Notify the listener that a pattern application finished with the specified status. More... | |
virtual void | notifyMatchFailure (Location loc, function_ref< void(Diagnostic &)> reasonCallback) |
Notify the listener that the pattern failed to match, and provide a callback to populate a diagnostic with the reason why the failure occurred. More... | |
![]() | |
Listener () | |
virtual | ~Listener ()=default |
virtual void | notifyOperationInserted (Operation *op, InsertPoint previous) |
Notify the listener that the specified operation was inserted. More... | |
virtual void | notifyBlockInserted (Block *block, Region *previous, Region::iterator previousIt) |
Notify the listener that the specified block was inserted. More... | |
![]() | |
Kind | getKind () const |
Static Public Member Functions | |
static bool | classof (const OpBuilder::Listener *base) |
Additional Inherited Members | |
![]() | |
enum class | Kind { OpBuilderListener = 0 , RewriterBaseListener = 1 } |
The kind of listener. More... | |
![]() | |
Listener (Kind kind) | |
![]() | |
ListenerBase (Kind kind) | |
Definition at line 414 of file PatternMatch.h.
|
inline |
Definition at line 415 of file PatternMatch.h.
|
static |
Definition at line 97 of file PatternMatch.cpp.
References mlir::OpBuilder::ListenerBase::getKind(), and mlir::OpBuilder::ListenerBase::RewriterBaseListener.
|
inlinevirtual |
Notify the listener that the specified block is about to be erased.
At this point, the block has zero uses.
Reimplemented in mlir::detail::ConversionPatternRewriterImpl::SingleEraseRewriter, and mlir::RewriterBase::ForwardingListener.
Definition at line 420 of file PatternMatch.h.
Referenced by mlir::RewriterBase::ForwardingListener::notifyBlockErased().
|
inlinevirtual |
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 in mlir::detail::ConversionPatternRewriterImpl, mlir::RewriterBase::ForwardingListener, mlir::transform::ErrorCheckingTrackingListener, and mlir::transform::TrackingListener.
Definition at line 466 of file PatternMatch.h.
Referenced by mlir::RewriterBase::ForwardingListener::notifyMatchFailure().
|
inlinevirtual |
Notify the listener that the specified operation is about to be erased.
At this point, the operation has zero uses.
Note: This notification is not triggered when unlinking an operation.
Reimplemented in mlir::detail::ConversionPatternRewriterImpl::SingleEraseRewriter, and mlir::RewriterBase::ForwardingListener.
Definition at line 447 of file PatternMatch.h.
Referenced by mlir::RewriterBase::ForwardingListener::notifyOperationErased().
|
inlinevirtual |
Notify the listener that the specified operation was modified in-place.
Reimplemented in mlir::RewriterBase::ForwardingListener.
Definition at line 423 of file PatternMatch.h.
Referenced by mlir::RewriterBase::ForwardingListener::notifyOperationModified().
|
inlinevirtual |
Notify the listener that all uses of the specified operation's results are about to be replaced with the results of another operation.
This is called before the uses of the old operation have been changed.
By default, this function calls the "operation replaced with values" notification.
Reimplemented in mlir::RewriterBase::ForwardingListener.
Definition at line 431 of file PatternMatch.h.
References mlir::Operation::getResults().
Referenced by mlir::RewriterBase::ForwardingListener::notifyOperationReplaced().
|
inlinevirtual |
Notify the listener that all uses of the specified operation's results are about to be replaced with the a range of values, potentially produced by other operations.
This is called before the uses of the operation have been changed.
Reimplemented in mlir::RewriterBase::ForwardingListener.
Definition at line 440 of file PatternMatch.h.
|
inlinevirtual |
Notify the listener that the specified pattern is about to be applied at the specified root operation.
Reimplemented in mlir::RewriterBase::ForwardingListener.
Definition at line 451 of file PatternMatch.h.
Referenced by mlir::RewriterBase::ForwardingListener::notifyPatternBegin().
|
inlinevirtual |
Notify the listener that a pattern application finished with the specified status.
"success" indicates that the pattern was applied successfully. "failure" indicates that the pattern could not be applied. The pattern may have communicated the reason for the failure with notifyMatchFailure
.
Reimplemented in mlir::RewriterBase::ForwardingListener.
Definition at line 458 of file PatternMatch.h.
Referenced by mlir::RewriterBase::ForwardingListener::notifyPatternEnd().