MLIR  18.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/IR/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)
 Create a new TrackingListener for usage in the specified transform op. More...
 
- Public Member Functions inherited from mlir::RewriterBase::Listener
 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...
 
- 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
 
- 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...
 
LogicalResult 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 1023 of file TransformInterfaces.h.

Constructor & Destructor Documentation

◆ ~ErrorCheckingTrackingListener()

transform::ErrorCheckingTrackingListener::~ErrorCheckingTrackingListener ( )
override

Definition at line 1334 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 1342 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 1349 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 1353 of file TransformInterfaces.cpp.


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