22 #define GEN_PASS_DEF_CONVERTMEMREFTOEMITC
23 #include "mlir/Conversion/Passes.h.inc"
29 struct ConvertMemRefToEmitCPass
30 :
public impl::ConvertMemRefToEmitCBase<ConvertMemRefToEmitCPass> {
31 void runOnOperation()
override {
43 auto materializeAsUnrealizedCast = [](
OpBuilder &builder,
Type resultType,
46 if (inputs.size() != 1)
49 return builder.
create<UnrealizedConversionCastOp>(loc, resultType, inputs)
64 std::move(patterns))))
65 return signalPassFailure();
static MLIRContext * getContext(OpFoldResult val)
This class describes a specific conversion target.
void addLegalDialect(StringRef name, Names... names)
Register the operations of the given dialects as legal.
void addIllegalDialect(StringRef name, Names... names)
Register the operations of the given dialects as illegal, i.e.
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
This class helps build Operations.
Operation * create(const OperationState &state)
Creates an operation given the fields represented as an OperationState.
void addConversion(FnT &&callback)
Register a conversion function.
void addSourceMaterialization(FnT &&callback)
This method registers a materialization that will be called when converting a legal replacement value...
void addTargetMaterialization(FnT &&callback)
This method registers a materialization that will be called when converting an illegal (source) value...
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
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...
bool isSupportedEmitCType(mlir::Type type)
Determines whether type is valid in EmitC.
Include the generated interface declarations.
void populateMemRefToEmitCTypeConversion(TypeConverter &typeConverter)
void populateMemRefToEmitCConversionPatterns(RewritePatternSet &patterns, const TypeConverter &converter)
LogicalResult applyPartialConversion(ArrayRef< Operation * > ops, const ConversionTarget &target, const FrozenRewritePatternSet &patterns, ConversionConfig config=ConversionConfig())
Below we define several entry points for operation conversion.