MLIR 22.0.0git
mlir::OperationConverter Struct Reference

Public Member Functions

 OperationConverter (MLIRContext *ctx, const ConversionTarget &target, const FrozenRewritePatternSet &patterns, const ConversionConfig &config, OpConversionMode mode)
LogicalResult applyConversion (ArrayRef< Operation * > ops)
 Applies the conversion to the given operations (and their nested operations).
template<typename Fn>
LogicalResult legalizeOperations (ArrayRef< Operation * > ops, Fn onFailure, bool isRecursiveLegalization=false)
 Legalizes the given operations (and their nested operations) to the conversion target.
LogicalResult legalizeOperations (ArrayRef< Operation * > ops, bool isRecursiveLegalization=false)
LogicalResult convert (Operation *op, bool isRecursiveLegalization=false)
 Converts a single operation.
const ConversionTargetgetTarget ()

Detailed Description

Definition at line 3251 of file DialectConversion.cpp.

Constructor & Destructor Documentation

◆ OperationConverter()

mlir::OperationConverter::OperationConverter ( MLIRContext * ctx,
const ConversionTarget & target,
const FrozenRewritePatternSet & patterns,
const ConversionConfig & config,
OpConversionMode mode )
inlineexplicit

Definition at line 3252 of file DialectConversion.cpp.

References mlir::config, mlir::patterns, and target.

Member Function Documentation

◆ applyConversion()

◆ convert()

LogicalResult OperationConverter::convert ( Operation * op,
bool isRecursiveLegalization = false )

Converts a single operation.

If isRecursiveLegalization is "true", the conversion is a recursive legalization request, triggered from within a pattern. In that case, do not emit errors because there will be another attempt at legalizing the operation later (via the regular pre-order legalization mechanism).

Definition at line 3295 of file DialectConversion.cpp.

References mlir::config, mlir::Operation::emitError(), mlir::Operation::getName(), and success().

Referenced by legalizeOperations().

◆ getTarget()

const ConversionTarget & mlir::OperationConverter::getTarget ( )
inline

Definition at line 3281 of file DialectConversion.cpp.

◆ legalizeOperations() [1/2]

LogicalResult mlir::OperationConverter::legalizeOperations ( ArrayRef< Operation * > ops,
bool isRecursiveLegalization = false )
inline

Definition at line 3268 of file DialectConversion.cpp.

References legalizeOperations().

◆ legalizeOperations() [2/2]

template<typename Fn>
LogicalResult OperationConverter::legalizeOperations ( ArrayRef< Operation * > ops,
Fn onFailure,
bool isRecursiveLegalization = false )

Legalizes the given operations (and their nested operations) to the conversion target.

Definition at line 3382 of file DialectConversion.cpp.

References mlir::WalkResult::advance(), convert(), mlir::PreOrder, mlir::WalkResult::skip(), success(), and target.

Referenced by applyConversion(), and legalizeOperations().


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