My Project
|
#include <DialectConversion.h>
Classes | |
class | SignatureConversion |
Public Member Functions | |
virtual | ~TypeConverter ()=default |
virtual LogicalResult | convertType (Type t, SmallVectorImpl< Type > &results) |
This hooks allows for converting a type. More... | |
virtual Type | convertType (Type t) |
LogicalResult | convertTypes (ArrayRef< Type > types, SmallVectorImpl< Type > &results) |
bool | isLegal (Type type) |
bool | isSignatureLegal (FunctionType funcType) |
virtual LogicalResult | convertSignatureArg (unsigned inputNo, Type type, SignatureConversion &result) |
This hook allows for converting a specific argument of a signature. More... | |
Optional< SignatureConversion > | convertBlockSignature (Block *block) |
virtual Operation * | materializeConversion (PatternRewriter &rewriter, Type resultType, ArrayRef< Value > inputs, Location loc) |
Base class for type conversion interface. Specific converters must derive this class and implement the pure virtual functions.
|
virtualdefault |
auto TypeConverter::convertBlockSignature | ( | Block * | block | ) |
This function converts the type signature of the given block, by invoking 'convertSignatureArg' for each argument. This function should return a valid conversion for the signature on success, None otherwise.
|
virtual |
This hook allows for converting a specific argument of a signature.
This hook allows for converting a specific argument of a signature. It takes as inputs the original argument input number, type. On success, this function should populate 'result' with any new mappings.
|
virtual |
This hooks allows for converting a type.
This hook allows for converting a type. This function should return failure if no valid conversion exists, success otherwise. If the new set of types is empty, the type is removed and any usages of the existing value are expected to be removed during conversion.
This hook simplifies defining 1-1 type conversions. This function returns the type to convert to on success, and a null type on failure.
Reimplemented in mlir::LLVMTypeConverter, mlir::SPIRVTypeConverter, and mlir::LinalgTypeConverter.
LogicalResult TypeConverter::convertTypes | ( | ArrayRef< Type > | types, |
SmallVectorImpl< Type > & | results | ||
) |
Convert the given set of types, filling 'results' as necessary. This returns failure if the conversion of any of the types fails, success otherwise.
bool TypeConverter::isLegal | ( | Type | type | ) |
Return true if the given type is legal for this type converter, i.e. the type converts to itself.
bool TypeConverter::isSignatureLegal | ( | FunctionType | funcType | ) |
Return true if the inputs and outputs of the given function type are legal.
|
inlinevirtual |
This hook allows for materializing a conversion from a set of types into one result type by generating a cast operation of some kind. The generated operation should produce one result, of 'resultType', with the provided 'inputs' as operands. This hook must be overridden when a type conversion results in more than one type, or if a type conversion may persist after the conversion has finished.