MLIR
20.0.0git
|
A listener that forwards all notifications to another listener. More...
#include "mlir/IR/PatternMatch.h"
Public Member Functions | |
ForwardingListener (OpBuilder::Listener *listener) | |
void | notifyOperationInserted (Operation *op, InsertPoint previous) override |
Notify the listener that the specified operation was inserted. More... | |
void | notifyBlockInserted (Block *block, Region *previous, Region::iterator previousIt) override |
Notify the listener that the specified block was inserted. More... | |
void | notifyBlockErased (Block *block) override |
Notify the listener that the specified block is about to be erased. More... | |
void | notifyOperationModified (Operation *op) override |
Notify the listener that the specified operation was modified in-place. More... | |
void | notifyOperationReplaced (Operation *op, Operation *newOp) override |
Notify the listener that all uses of the specified operation's results are about to be replaced with the results of another operation. More... | |
void | notifyOperationReplaced (Operation *op, ValueRange replacement) override |
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... | |
void | notifyOperationErased (Operation *op) override |
Notify the listener that the specified operation is about to be erased. More... | |
void | notifyPatternBegin (const Pattern &pattern, Operation *op) override |
Notify the listener that the specified pattern is about to be applied at the specified root operation. More... | |
void | notifyPatternEnd (const Pattern &pattern, LogicalResult status) override |
Notify the listener that a pattern application finished with the specified status. More... | |
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. More... | |
Public Member Functions inherited from mlir::RewriterBase::Listener | |
Listener () | |
Public Member Functions inherited from mlir::OpBuilder::Listener | |
Listener () | |
virtual | ~Listener ()=default |
Public Member Functions inherited from mlir::OpBuilder::ListenerBase | |
Kind | getKind () const |
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) |
Protected Member Functions inherited from mlir::OpBuilder::Listener | |
Listener (Kind kind) | |
Protected Member Functions inherited from mlir::OpBuilder::ListenerBase | |
ListenerBase (Kind kind) | |
A listener that forwards all notifications to another listener.
This struct can be used as a base to create listener chains, so that multiple listeners can be notified of IR changes.
Definition at line 463 of file PatternMatch.h.
|
inline |
Definition at line 464 of file PatternMatch.h.
|
inlineoverridevirtual |
Notify the listener that the specified block is about to be erased.
At this point, the block has zero uses.
Reimplemented from mlir::RewriterBase::Listener.
Definition at line 478 of file PatternMatch.h.
References mlir::RewriterBase::Listener::notifyBlockErased().
|
inlineoverridevirtual |
Notify the listener that the specified block was inserted.
previous
and previousIt
are the previous location of the block.previous
is "nullptr".Note: Creating an (unlinked) block does not trigger this notification.
Reimplemented from mlir::OpBuilder::Listener.
Definition at line 473 of file PatternMatch.h.
References mlir::OpBuilder::Listener::notifyBlockInserted().
|
inlineoverridevirtual |
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 508 of file PatternMatch.h.
References mlir::RewriterBase::Listener::notifyMatchFailure().
|
inlineoverridevirtual |
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 from mlir::RewriterBase::Listener.
Definition at line 495 of file PatternMatch.h.
References mlir::RewriterBase::Listener::notifyOperationErased().
|
inlineoverridevirtual |
Notify the listener that the specified operation was inserted.
previous
is the previous location of the op.previous
is empty.Note: Creating an (unlinked) op does not trigger this notification.
Reimplemented from mlir::OpBuilder::Listener.
Definition at line 469 of file PatternMatch.h.
References mlir::OpBuilder::Listener::notifyOperationInserted().
|
inlineoverridevirtual |
Notify the listener that the specified operation was modified in-place.
Reimplemented from mlir::RewriterBase::Listener.
Definition at line 482 of file PatternMatch.h.
References mlir::RewriterBase::Listener::notifyOperationModified().
|
inlineoverridevirtual |
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 from mlir::RewriterBase::Listener.
Definition at line 486 of file PatternMatch.h.
References mlir::RewriterBase::Listener::notifyOperationReplaced().
|
inlineoverridevirtual |
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 from mlir::RewriterBase::Listener.
Definition at line 490 of file PatternMatch.h.
References mlir::RewriterBase::Listener::notifyOperationReplaced().
|
inlineoverridevirtual |
Notify the listener that the specified pattern is about to be applied at the specified root operation.
Reimplemented from mlir::RewriterBase::Listener.
Definition at line 499 of file PatternMatch.h.
References mlir::RewriterBase::Listener::notifyPatternBegin().
|
inlineoverridevirtual |
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 from mlir::RewriterBase::Listener.
Definition at line 503 of file PatternMatch.h.
References mlir::RewriterBase::Listener::notifyPatternEnd().