21 converter.addConversion([&](
Type type) -> std::optional<Type> {
24 IntegerType::SignednessSemantics::Signless);
28 converter.addConversion([&](
TensorType type) -> std::optional<Type> {
29 auto converted = converter.convertType(type.getElementType());
32 return type.clone(converted);
34 converter.addSourceMaterialization([&](
OpBuilder &builder,
Type resultType,
37 if (inputs.size() != 1)
40 return UnrealizedConversionCastOp::create(builder, loc, resultType, inputs)
43 converter.addTargetMaterialization([&](
OpBuilder &builder,
Type resultType,
46 if (inputs.size() != 1)
49 return UnrealizedConversionCastOp::create(builder, loc, resultType, inputs)
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
This class helps build Operations.
Tensor types represent multi-dimensional arrays, and have two variants: RankedTensorType and Unranked...
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
MLIRContext * getContext() const
Return the MLIRContext in which this type was uniqued.
bool isUnsignedInteger() const
Return true if this is an unsigned integer type (with the specified width).
unsigned getIntOrFloatBitWidth() const
Return the bit width of an integer or a float type, assert failure on other types.
This class provides an abstraction over the different types of ranges over Values.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
void populateTosaTypeConversion(TypeConverter &converter)
Include the generated interface declarations.