31 matchAndRewrite(CallOp op, OpAdaptor adaptor,
38 if (!adaptor.getOperandMapping().hasNonIdentityConversion() &&
45 adaptor.getFlatOperands(), op->getAttrs());
47 rewriter.
replaceOp(op, newOp->getResults(), resultMapping);
57 matchAndRewrite(ReturnOp op, OpAdaptor adaptor,
60 if (!adaptor.getOperandMapping().hasNonIdentityConversion())
65 op, [&] { op->setOperands(adaptor.getFlatOperands()); });
79 ConvertTypesInFuncCallOp,
80 ConvertTypesInFuncReturnOp
83 populateOneToNFunctionOpInterfaceTypeConversionPattern<func::FuncOp>(
84 typeConverter, patterns);
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
This class is a wrapper around OneToNConversionPattern for matching against instances of a particular...
Specialization of PatternRewriter that OneToNConversionPatterns use.
void replaceOp(Operation *op, ValueRange newValues, const OneToNTypeMapping &resultMapping)
Replaces the results of the operation with the specified list of values mapped back to the original t...
Stores a 1:N mapping of types and provides several useful accessors.
TypeRange getConvertedTypes(unsigned originalTypeNo) const
Returns the list of types that corresponds to the original type at the given index.
bool hasNonIdentityConversion() const
Returns true iff at least one type conversion maps an input type to a type that is different from its...
Operation * create(const OperationState &state)
Creates an operation given the fields represented as an OperationState.
MLIRContext * getContext() const
RewritePatternSet & add(ConstructorArg &&arg, ConstructorArgs &&...args)
Add an instance of each of the pattern types 'Ts' to the pattern list with the given arguments.
void modifyOpInPlace(Operation *root, CallableT &&callable)
This method is a utility wrapper around an in-place modification of an operation.
Include the generated interface declarations.
void populateFuncTypeConversionPatterns(const TypeConverter &typeConverter, RewritePatternSet &patterns)