MLIR  19.0.0git
Public Member Functions | Protected Member Functions | List of all members
mlir::transform::ErrorCheckingTrackingListener Class Reference

A specialized listener that keeps track of cases in which no replacement payload could be found. More...

#include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.h"

+ Inheritance diagram for mlir::transform::ErrorCheckingTrackingListener:

Public Member Functions

 ~ErrorCheckingTrackingListener () override
 
DiagnosedSilenceableFailure checkAndResetError ()
 Check and return the current error state of this listener. More...
 
bool failed () const
 Return "true" if this tracking listener had a failure. More...
 
- 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. More...
 
- 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. 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 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...
 
- 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. More...
 
virtual void notifyBlockInserted (Block *block, Region *previous, Region::iterator previousIt)
 Notify the listener that the specified block was inserted. More...
 
- 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. More...
 

Protected Member Functions

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. More...
 
- 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. More...
 
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. More...
 
TransformOpInterface getTransformOp () const
 Return the transform op in which this TrackingListener is used. More...
 
- 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. More...
 
const TransformStategetTransformState () const
 Provides read-only access to the parent TransformState object. More...
 
LogicalResult replacePayloadOp (Operation *op, Operation *replacement)
 Replaces the given payload op with another op. More...
 
LogicalResult replacePayloadValue (Value value, Value replacement)
 Replaces the given payload value with another value. More...
 

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 OperationgetCommonDefiningOp (ValueRange values)
 Return the single op that defines all given values (if any). More...
 

Detailed Description

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 1051 of file TransformInterfaces.h.

Constructor & Destructor Documentation

◆ ~ErrorCheckingTrackingListener()

transform::ErrorCheckingTrackingListener::~ErrorCheckingTrackingListener ( )
override

Definition at line 1350 of file TransformInterfaces.cpp.

Member Function Documentation

◆ checkAndResetError()

DiagnosedSilenceableFailure transform::ErrorCheckingTrackingListener::checkAndResetError ( )

Check and return the current error state of this listener.

Afterwards, resets the error state to "success".

Definition at line 1358 of file TransformInterfaces.cpp.

References mlir::DiagnosedSilenceableFailure::success().

◆ failed()

bool transform::ErrorCheckingTrackingListener::failed ( ) const

Return "true" if this tracking listener had a failure.

Definition at line 1365 of file TransformInterfaces.cpp.

◆ notifyPayloadReplacementNotFound()

void transform::ErrorCheckingTrackingListener::notifyPayloadReplacementNotFound ( Operation op,
ValueRange  values,
DiagnosedSilenceableFailure &&  diag 
)
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 1369 of file TransformInterfaces.cpp.


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