MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::transform::TransformEachOpTrait< OpTy > Class Template Reference

Trait implementing the TransformOpInterface for operations applying a transformation to a single operation handle and producing an arbitrary number of handles and parameter values. More...

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

+ Inheritance diagram for mlir::transform::TransformEachOpTrait< OpTy >:

Public Member Functions

DiagnosedSilenceableFailure apply (transform::TransformRewriter &rewriter, TransformResults &transformResults, TransformState &state)
 Calls applyToOne for every payload operation associated with the operand of this transform IR op, the following case disjunction happens: More...
 

Static Public Member Functions

static LogicalResult verifyTrait (Operation *op)
 Checks that the op matches the expectations of this trait. More...
 

Additional Inherited Members

- Protected Member Functions inherited from mlir::OpTrait::TraitBase< OpTy, TransformEachOpTrait >
OperationgetOperation ()
 Return the ultimate Operation being worked on. More...
 

Detailed Description

template<typename OpTy>
class mlir::transform::TransformEachOpTrait< OpTy >

Trait implementing the TransformOpInterface for operations applying a transformation to a single operation handle and producing an arbitrary number of handles and parameter values.

The op must implement a method with the following signature:

The transform op having this trait is expected to have a single operand.

Definition at line 1206 of file TransformInterfaces.h.

Member Function Documentation

◆ apply()

template<typename OpTy >
mlir::DiagnosedSilenceableFailure mlir::transform::TransformEachOpTrait< OpTy >::apply ( transform::TransformRewriter rewriter,
TransformResults transformResults,
TransformState state 
)

Calls applyToOne for every payload operation associated with the operand of this transform IR op, the following case disjunction happens:

  1. If not target payload ops are associated to the operand then fill the results vector with the expected number of null elements and return success. This is the corner case handling that allows propagating the "no-op" case gracefully to improve usability.
  2. If any applyToOne returns definiteFailure, the transformation is immediately considered definitely failed and we return.
  3. All applications of applyToOne are checked to return a number of results expected by the transform IR op. If not, this is a definite failure and we return early.
  4. If applyToOne produces ops, associate them with the result of this transform op.
  5. If any applyToOne return silenceableFailure, the transformation is considered silenceable.
  6. Otherwise the transformation is considered successful.

Definition at line 1546 of file TransformInterfaces.h.

◆ verifyTrait()

template<typename OpTy >
llvm::LogicalResult mlir::transform::TransformEachOpTrait< OpTy >::verifyTrait ( Operation op)
static

Checks that the op matches the expectations of this trait.

Definition at line 1602 of file TransformInterfaces.h.

References mlir::Operation::emitError(), mlir::OperationName::getInterface(), and mlir::Operation::getName().


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