MLIR  22.0.0git
Public Member Functions | List of all members
mlir::RewriterBase::PatternLoggingListener Struct Reference

A listener that logs notification events to llvm::dbgs() before forwarding to the base listener. More...

#include "mlir/IR/PatternMatch.h"

+ Inheritance diagram for mlir::RewriterBase::PatternLoggingListener:

Public Member Functions

 PatternLoggingListener (OpBuilder::Listener *listener, StringRef patternName)
 
void notifyOperationInserted (Operation *op, InsertPoint previous) override
 Notify the listener that the specified operation was inserted. 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...
 
- Public Member Functions inherited from mlir::RewriterBase::ForwardingListener
 ForwardingListener (OpBuilder::Listener *listener)
 
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 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)
 

Detailed Description

A listener that logs notification events to llvm::dbgs() before forwarding to the base listener.

Definition at line 480 of file PatternMatch.h.

Constructor & Destructor Documentation

◆ PatternLoggingListener()

mlir::RewriterBase::PatternLoggingListener::PatternLoggingListener ( OpBuilder::Listener listener,
StringRef  patternName 
)
inline

Definition at line 481 of file PatternMatch.h.

Member Function Documentation

◆ notifyOperationErased()

void RewriterBase::PatternLoggingListener::notifyOperationErased ( Operation op)
overridevirtual

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::ForwardingListener.

Definition at line 36 of file PatternLoggingListener.cpp.

References mlir::Operation::getName(), and mlir::RewriterBase::ForwardingListener::notifyOperationErased().

◆ notifyOperationInserted()

void RewriterBase::PatternLoggingListener::notifyOperationInserted ( Operation op,
InsertPoint  previous 
)
overridevirtual

Notify the listener that the specified operation was inserted.

  • If the operation was moved, then previous is the previous location of the op.
  • If the operation was unlinked before it was inserted, then previous is empty.

Note: Creating an (unlinked) op does not trigger this notification.

Reimplemented from mlir::RewriterBase::ForwardingListener.

Definition at line 8 of file PatternLoggingListener.cpp.

References mlir::Operation::getName(), and mlir::RewriterBase::ForwardingListener::notifyOperationInserted().

◆ notifyOperationModified()

void RewriterBase::PatternLoggingListener::notifyOperationModified ( Operation op)
overridevirtual

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

Reimplemented from mlir::RewriterBase::ForwardingListener.

Definition at line 15 of file PatternLoggingListener.cpp.

References mlir::Operation::getName(), and mlir::RewriterBase::ForwardingListener::notifyOperationModified().

◆ notifyOperationReplaced() [1/2]

void RewriterBase::PatternLoggingListener::notifyOperationReplaced ( Operation op,
Operation replacement 
)
overridevirtual

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::ForwardingListener.

Definition at line 22 of file PatternLoggingListener.cpp.

References mlir::Operation::getName(), and mlir::RewriterBase::ForwardingListener::notifyOperationReplaced().

◆ notifyOperationReplaced() [2/2]

void RewriterBase::PatternLoggingListener::notifyOperationReplaced ( Operation op,
ValueRange  replacement 
)
overridevirtual

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::ForwardingListener.

Definition at line 29 of file PatternLoggingListener.cpp.

References mlir::Operation::getName(), and mlir::RewriterBase::ForwardingListener::notifyOperationReplaced().

◆ notifyPatternBegin()

void RewriterBase::PatternLoggingListener::notifyPatternBegin ( const Pattern pattern,
Operation op 
)
overridevirtual

Notify the listener that the specified pattern is about to be applied at the specified root operation.

Reimplemented from mlir::RewriterBase::ForwardingListener.

Definition at line 43 of file PatternLoggingListener.cpp.

References mlir::Operation::getName(), and mlir::RewriterBase::ForwardingListener::notifyPatternBegin().


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