MLIR
22.0.0git
|
Classes | |
struct | Placeholder |
Typedefs | |
using | ReplacementItem = std::variant< StringRef, Placeholder > |
Enumerations | |
enum class | LanguageTarget { c99 , cpp11 } |
Enum to specify the language target for EmitC code generation. More... | |
Functions | |
void | buildTerminatedBody (OpBuilder &builder, Location loc) |
Default callback for builders of ops carrying a region. More... | |
bool | isSupportedEmitCType (mlir::Type type) |
Determines whether type is valid in EmitC. More... | |
bool | isSupportedIntegerType (mlir::Type type) |
Determines whether type is a valid integer type in EmitC. More... | |
bool | isIntegerIndexOrOpaqueType (Type type) |
Determines whether type is integer like, i.e. More... | |
bool | isSupportedFloatType (mlir::Type type) |
Determines whether type is a valid floating-point type in EmitC. More... | |
bool | isPointerWideType (mlir::Type type) |
Determines whether type is a emitc.size_t/ssize_t type. More... | |
ExpressionOp | createExpression (Operation *op, OpBuilder &builder) |
void | populateExpressionPatterns (RewritePatternSet &patterns) |
Populates patterns with expression-related patterns. More... | |
void | populateFuncPatterns (RewritePatternSet &patterns, StringRef namedAttribute) |
Populates 'patterns' with func-related patterns. More... | |
std::optional< Type > | getUnsignedTypeFor (Type ty) |
Get an unsigned integer or size data type corresponding to ty . More... | |
std::optional< Type > | getSignedTypeFor (Type ty) |
Get a signed integer or size data type corresponding to ty that supports arithmetic on negative values. More... | |
LogicalResult | translateToCpp (Operation *op, raw_ostream &os, bool declareVariablesAtTop=false, StringRef fileId={}) |
Translates the given operation to C++ code. More... | |
using mlir::emitc::ReplacementItem = typedef std::variant<StringRef, Placeholder> |
|
strong |
Enum to specify the language target for EmitC code generation.
Enumerator | |
---|---|
c99 | |
cpp11 |
Definition at line 16 of file MathToEmitC.h.
Default callback for builders of ops carrying a region.
Inserts a yield without arguments.
Definition at line 55 of file EmitC.cpp.
References mlir::OpBuilder::create().
Definition at line 17 of file Transforms.cpp.
References mlir::OpBuilder::create(), mlir::Region::emplaceBlock(), mlir::Operation::getLoc(), mlir::Operation::getNumResults(), mlir::Operation::getResult(), mlir::Value::getType(), mlir::Operation::moveBefore(), mlir::Value::replaceAllUsesWith(), mlir::OpBuilder::setInsertionPointAfter(), and mlir::OpBuilder::setInsertionPointToEnd().
Get a signed integer or size data type corresponding to ty
that supports arithmetic on negative values.
Definition at line 52 of file TypeConversions.cpp.
References mlir::get(), mlir::Type::getContext(), mlir::Type::getIntOrFloatBitWidth(), mlir::Type::isInteger(), and mlir::quant::QuantizationFlags::Signed.
Get an unsigned integer or size data type corresponding to ty
.
Definition at line 39 of file TypeConversions.cpp.
References mlir::get(), mlir::Type::getContext(), mlir::Type::getIntOrFloatBitWidth(), and mlir::Type::isInteger().
bool mlir::emitc::isIntegerIndexOrOpaqueType | ( | Type | type | ) |
Determines whether type
is integer like, i.e.
it's a supported integer, an index or opaque type.
Definition at line 109 of file EmitC.cpp.
References isPointerWideType(), and isSupportedIntegerType().
bool mlir::emitc::isPointerWideType | ( | mlir::Type | type | ) |
Determines whether type
is a emitc.size_t/ssize_t type.
Definition at line 132 of file EmitC.cpp.
Referenced by isIntegerIndexOrOpaqueType(), isSupportedEmitCType(), and verifyInitializationAttribute().
bool mlir::emitc::isSupportedEmitCType | ( | mlir::Type | type | ) |
Determines whether type
is valid in EmitC.
Definition at line 59 of file EmitC.cpp.
References mlir::Type::isIndex(), isPointerWideType(), isSupportedFloatType(), and isSupportedIntegerType().
bool mlir::emitc::isSupportedFloatType | ( | mlir::Type | type | ) |
Determines whether type
is a valid floating-point type in EmitC.
Definition at line 114 of file EmitC.cpp.
Referenced by isSupportedEmitCType().
bool mlir::emitc::isSupportedIntegerType | ( | mlir::Type | type | ) |
Determines whether type
is a valid integer type in EmitC.
Definition at line 93 of file EmitC.cpp.
Referenced by isIntegerIndexOrOpaqueType(), and isSupportedEmitCType().
void mlir::emitc::populateExpressionPatterns | ( | RewritePatternSet & | patterns | ) |
Populates patterns
with expression-related patterns.
Definition at line 108 of file Transforms.cpp.
References mlir::patterns.
void mlir::emitc::populateFuncPatterns | ( | RewritePatternSet & | patterns, |
StringRef | namedAttribute | ||
) |
Populates 'patterns' with func-related patterns.
Definition at line 109 of file WrapFuncInClass.cpp.
References mlir::patterns.
LogicalResult mlir::emitc::translateToCpp | ( | Operation * | op, |
raw_ostream & | os, | ||
bool | declareVariablesAtTop = false , |
||
StringRef | fileId = {} |
||
) |
Translates the given operation to C++ code.
The operation or operations in the region of 'op' need almost all be in EmitC dialect. The parameter 'declareVariablesAtTop' enforces that all variables for op results and block arguments are declared at the beginning of the function. If parameter 'fileId' is non-empty, then body of emitc.file
ops with matching id are emitted.
Definition at line 1899 of file TranslateToCpp.cpp.
Referenced by mlir::registerToCppTranslation().