MLIR  18.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::RewriterBase::Listener Struct Reference

#include "mlir/IR/PatternMatch.h"

+ Inheritance diagram for mlir::RewriterBase::Listener:

Public Member Functions

 Listener ()
 
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 the specified operation is about to be replaced with another operation. More...
 
virtual void notifyOperationReplaced (Operation *op, ValueRange replacement)
 Notify the listener that the specified operation is about to be replaced with the a range of values, potentially produced by other operations. More...
 
virtual void notifyOperationRemoved (Operation *op)
 Notify the listener that the specified operation is about to be erased. More...
 
virtual LogicalResult notifyMatchFailure (Location loc, function_ref< void(Diagnostic &)> reasonCallback)
 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. More...
 
- Public Member Functions inherited from mlir::OpBuilder::Listener
 Listener ()
 
virtual ~Listener ()=default
 
virtual void notifyOperationInserted (Operation *op)
 Notification handler for when an operation is inserted into the builder. More...
 
virtual void notifyBlockCreated (Block *block)
 Notification handler for when a block is created using the builder. More...
 
- Public Member Functions inherited from mlir::OpBuilder::ListenerBase
Kind getKind () const
 

Static Public Member Functions

static bool classof (const OpBuilder::Listener *base)
 

Additional Inherited Members

- Public Types inherited from mlir::OpBuilder::ListenerBase
enum class  Kind { OpBuilderListener = 0 , RewriterBaseListener = 1 }
 The kind of listener. More...
 
- Protected Member Functions inherited from mlir::OpBuilder::Listener
 Listener (Kind kind)
 
- Protected Member Functions inherited from mlir::OpBuilder::ListenerBase
 ListenerBase (Kind kind)
 

Detailed Description

Definition at line 401 of file PatternMatch.h.

Constructor & Destructor Documentation

◆ Listener()

mlir::RewriterBase::Listener::Listener ( )
inline

Definition at line 402 of file PatternMatch.h.

Member Function Documentation

◆ classof()

bool RewriterBase::Listener::classof ( const OpBuilder::Listener base)
static

◆ notifyMatchFailure()

virtual LogicalResult mlir::RewriterBase::Listener::notifyMatchFailure ( Location  loc,
function_ref< void(Diagnostic &)>  reasonCallback 
)
inlinevirtual

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.

This method allows for derived listeners to optionally hook into the reason why a rewrite failed, and display it to users.

Reimplemented in mlir::ConversionPatternRewriter, mlir::RewriterBase::ForwardingListener, and mlir::transform::TrackingListener.

Definition at line 435 of file PatternMatch.h.

References mlir::failure().

◆ notifyOperationModified()

virtual void mlir::RewriterBase::Listener::notifyOperationModified ( Operation op)
inlinevirtual

Notify the listener that the specified operation was modified in-place.

Reimplemented in mlir::RewriterBase::ForwardingListener.

Definition at line 406 of file PatternMatch.h.

◆ notifyOperationRemoved()

virtual void mlir::RewriterBase::Listener::notifyOperationRemoved ( Operation op)
inlinevirtual

Notify the listener that the specified operation is about to be erased.

At this point, the operation has zero uses.

Reimplemented in mlir::RewriterBase::ForwardingListener.

Definition at line 427 of file PatternMatch.h.

◆ notifyOperationReplaced() [1/2]

virtual void mlir::RewriterBase::Listener::notifyOperationReplaced ( Operation op,
Operation replacement 
)
inlinevirtual

Notify the listener that the specified operation is about to be replaced with 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 414 of file PatternMatch.h.

◆ notifyOperationReplaced() [2/2]

virtual void mlir::RewriterBase::Listener::notifyOperationReplaced ( Operation op,
ValueRange  replacement 
)
inlinevirtual

Notify the listener that the specified operation is 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 422 of file PatternMatch.h.


The documentation for this struct was generated from the following files: