18 #include "llvm/Support/MathExtras.h"
28 unsigned targetBitwidth)
29 : loadStoreBitwidth(targetBitwidth) {
30 assert(llvm::isPowerOf2_32(targetBitwidth) &&
31 "Only power-of-two integers are supported");
37 addConversion([
this](FunctionType ty) -> std::optional<Type> {
54 populateFunctionOpInterfaceTypeConversionPattern<func::FuncOp>(
patterns,
void addConversion(FnT &&callback)
Register a conversion function.
LogicalResult convertTypes(TypeRange types, SmallVectorImpl< Type > &results) const
Convert the given types, filling 'results' as necessary.
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.
Converts narrow integer or float types that are not supported by the target hardware to wider types.
NarrowTypeEmulationConverter(unsigned targetBitwidth)
void populateArithNarrowTypeEmulationPatterns(const NarrowTypeEmulationConverter &typeConverter, RewritePatternSet &patterns)
Adds patterns to emulate narrow Arith and Function ops into wide supported types.
Include the generated interface declarations.
void populateReturnOpTypeConversionPattern(RewritePatternSet &patterns, const TypeConverter &converter, PatternBenefit benefit=1)
Add a pattern to the given pattern list to rewrite return ops to use operands that have been legalize...
void populateCallOpTypeConversionPattern(RewritePatternSet &patterns, const TypeConverter &converter, PatternBenefit benefit=1)
Add a pattern to the given pattern list to convert the operand and result types of a CallOp with the ...
const FrozenRewritePatternSet & patterns
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...