|
MLIR 24.0.0git
|
Go to the source code of this file.
Classes | |
| struct | MlirRemark |
| An opaque reference to a remark. More... | |
| struct | MlirRemarkCategories |
| Regular expressions (llvm::Regex syntax, anchored by the engine) selecting the remark categories to report: all applies to every kind, the others to one kind each. More... | |
Typedefs | |
| typedef struct MlirRemark | MlirRemark |
| typedef enum MlirRemarkKind | MlirRemarkKind |
| typedef enum MlirRemarkPolicy | MlirRemarkPolicy |
| typedef enum MlirRemarkFileFormat | MlirRemarkFileFormat |
| typedef struct MlirRemarkCategories | MlirRemarkCategories |
| typedef void(* | MlirRemarkCallback) (MlirRemark remark, void *userData) |
| Callback receiving every remark the engine reports. | |
Enumerations | |
| enum | MlirRemarkKind { MlirRemarkKindUnknown , MlirRemarkKindPassed , MlirRemarkKindMissed , MlirRemarkKindFailure , MlirRemarkKindAnalysis } |
| The outcome a remark describes (see mlir::remark::RemarkKind). More... | |
| enum | MlirRemarkPolicy { MlirRemarkPolicyAll , MlirRemarkPolicyFinal } |
| The emitting policy of the remark engine. More... | |
| enum | MlirRemarkFileFormat { MlirRemarkFileFormatYAML , MlirRemarkFileFormatBitstream } |
| The serialization format of a remark output file. More... | |
Functions | |
| MLIR_CAPI_EXPORTED MlirLogicalResult | mlirContextEnableOptimizationRemarks (MlirContext context, MlirRemarkCategories categories, MlirRemarkPolicy policy, bool printAsEmitRemarks) |
| Enables the remark engine on the context without a streamer; when printAsEmitRemarks is set, every reported remark is emitted as an MLIR remark diagnostic at its location. | |
| MLIR_CAPI_EXPORTED MlirLogicalResult | mlirContextEnableOptimizationRemarksToFile (MlirContext context, MlirRemarkCategories categories, MlirRemarkPolicy policy, MlirRemarkFileFormat format, MlirStringRef path, bool printAsEmitRemarks) |
| Enables the remark engine on the context, streaming the reported remarks to the file at path in format. | |
| MLIR_CAPI_EXPORTED MlirLogicalResult | mlirContextEnableOptimizationRemarksWithCallback (MlirContext context, MlirRemarkCategories categories, MlirRemarkPolicy policy, MlirRemarkCallback callback, void *userData, void(*deleteUserData)(void *), bool printAsEmitRemarks) |
| Enables the remark engine on the context, delivering every reported remark to callback. | |
| MLIR_CAPI_EXPORTED void | mlirContextFinalizeOptimizationRemarks (MlirContext context) |
| Finalizes and removes the remark engine of the context: postponed remarks are reported, the output file is written and the callback's user data is released. | |
| MLIR_CAPI_EXPORTED bool | mlirContextHasRemarkEngine (MlirContext context) |
| Returns whether the context has a remark engine enabled. | |
| MLIR_CAPI_EXPORTED MlirRemarkKind | mlirRemarkGetKind (MlirRemark remark) |
| Returns the kind of the remark. | |
| MLIR_CAPI_EXPORTED MlirStringRef | mlirRemarkGetRemarkName (MlirRemark remark) |
| Returns the name identifying the remark. | |
| MLIR_CAPI_EXPORTED MlirStringRef | mlirRemarkGetCategoryName (MlirRemark remark) |
| Returns the category of the remark (the subject of the filters). | |
| MLIR_CAPI_EXPORTED MlirStringRef | mlirRemarkGetFullCategoryName (MlirRemark remark) |
| Returns the combined category:subcategory name of the remark. | |
| MLIR_CAPI_EXPORTED MlirStringRef | mlirRemarkGetFunctionName (MlirRemark remark) |
| Returns the name of the function the remark refers to. | |
| MLIR_CAPI_EXPORTED MlirLocation | mlirRemarkGetLocation (MlirRemark remark) |
| Returns the location of the remark. | |
| MLIR_CAPI_EXPORTED uint64_t | mlirRemarkGetId (MlirRemark remark) |
| Returns the unique id of the remark within its engine (0 when unset). | |
| MLIR_CAPI_EXPORTED intptr_t | mlirRemarkGetNumArgs (MlirRemark remark) |
| Returns the number of key/value arguments attached to the remark. | |
| MLIR_CAPI_EXPORTED MlirStringRef | mlirRemarkGetArgKey (MlirRemark remark, intptr_t pos) |
| Returns the key of the pos-th argument of the remark. | |
| MLIR_CAPI_EXPORTED MlirStringRef | mlirRemarkGetArgValue (MlirRemark remark, intptr_t pos) |
| Returns the value of the pos-th argument of the remark. | |
| MLIR_CAPI_EXPORTED void | mlirRemarkPrint (MlirRemark remark, MlirStringCallback callback, void *userData) |
| Prints the remark in its textual form, [Kind] name | Category:... |
/ Function=... | key=value, ... (without its location). | |
| MLIR_CAPI_EXPORTED bool | mlirEmitOptimizationRemark (MlirLocation location, MlirRemarkKind kind, MlirStringRef remarkName, MlirStringRef categoryName, MlirStringRef subCategoryName, MlirStringRef functionName, MlirStringRef message, intptr_t numArgs, const MlirStringRef *argKeys, const MlirStringRef *argValues) |
| Emits a remark of kind at location through the remark engine of the location's context. | |
| typedef void(* MlirRemarkCallback) (MlirRemark remark, void *userData) |
| typedef enum MlirRemarkFileFormat MlirRemarkFileFormat |
| typedef enum MlirRemarkKind MlirRemarkKind |
| typedef enum MlirRemarkPolicy MlirRemarkPolicy |
| enum MlirRemarkFileFormat |
| enum MlirRemarkKind |
The outcome a remark describes (see mlir::remark::RemarkKind).
| enum MlirRemarkPolicy |
| MLIR_CAPI_EXPORTED MlirLogicalResult mlirContextEnableOptimizationRemarks | ( | MlirContext | context, |
| MlirRemarkCategories | categories, | ||
| MlirRemarkPolicy | policy, | ||
| bool | printAsEmitRemarks ) |
Enables the remark engine on the context without a streamer; when printAsEmitRemarks is set, every reported remark is emitted as an MLIR remark diagnostic at its location.
Fails when the context already has a remark engine (finalize it first).
Definition at line 105 of file Remarks.cpp.
References createPolicy(), mlir::remark::enableOptimizationRemarks(), mlir::MLIRContext::getRemarkEngine(), mlirLogicalResultFailure(), unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyMlirContext::enableRemarks().
| MLIR_CAPI_EXPORTED MlirLogicalResult mlirContextEnableOptimizationRemarksToFile | ( | MlirContext | context, |
| MlirRemarkCategories | categories, | ||
| MlirRemarkPolicy | policy, | ||
| MlirRemarkFileFormat | format, | ||
| MlirStringRef | path, | ||
| bool | printAsEmitRemarks ) |
Enables the remark engine on the context, streaming the reported remarks to the file at path in format.
The file is written when the engine is finalized. Fails when the file cannot be created or the context already has a remark engine.
Definition at line 116 of file Remarks.cpp.
References createPolicy(), mlir::remark::enableOptimizationRemarksWithLLVMStreamer(), mlir::MLIRContext::getRemarkEngine(), mlirLogicalResultFailure(), unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyMlirContext::enableRemarks().
| MLIR_CAPI_EXPORTED MlirLogicalResult mlirContextEnableOptimizationRemarksWithCallback | ( | MlirContext | context, |
| MlirRemarkCategories | categories, | ||
| MlirRemarkPolicy | policy, | ||
| MlirRemarkCallback | callback, | ||
| void * | userData, | ||
| void(* | deleteUserData )(void *), | ||
| bool | printAsEmitRemarks ) |
Enables the remark engine on the context, delivering every reported remark to callback.
userData is passed to the callback unchanged and released through deleteUserData (may be null) when the engine is finalized or the context is destroyed. Fails when the context already has a remark engine.
Definition at line 128 of file Remarks.cpp.
References createPolicy(), mlir::remark::enableOptimizationRemarks(), mlir::MLIRContext::getRemarkEngine(), mlirLogicalResultFailure(), unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyMlirContext::enableRemarks().
| MLIR_CAPI_EXPORTED void mlirContextFinalizeOptimizationRemarks | ( | MlirContext | context | ) |
Finalizes and removes the remark engine of the context: postponed remarks are reported, the output file is written and the callback's user data is released.
Does nothing when no engine is enabled.
Definition at line 147 of file Remarks.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyMlirContext::finalizeRemarks().
| MLIR_CAPI_EXPORTED bool mlirContextHasRemarkEngine | ( | MlirContext | context | ) |
Returns whether the context has a remark engine enabled.
Definition at line 153 of file Remarks.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyMlirContext::enableRemarks(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyMlirContext::getRemarksEnabled().
| MLIR_CAPI_EXPORTED bool mlirEmitOptimizationRemark | ( | MlirLocation | location, |
| MlirRemarkKind | kind, | ||
| MlirStringRef | remarkName, | ||
| MlirStringRef | categoryName, | ||
| MlirStringRef | subCategoryName, | ||
| MlirStringRef | functionName, | ||
| MlirStringRef | message, | ||
| intptr_t | numArgs, | ||
| const MlirStringRef * | argKeys, | ||
| const MlirStringRef * | argValues ) |
Emits a remark of kind at location through the remark engine of the location's context.
message (when non-empty) and the numArgs key/value pairs become the arguments of the remark. Returns false, emitting nothing, when the context has no remark engine, the category is filtered out, or kind is MlirRemarkKindUnknown.
Definition at line 217 of file Remarks.cpp.
References mlir::remark::analysis(), mlir::remark::RemarkOpts::category(), mlir::remark::failed(), mlir::remark::RemarkOpts::function(), MlirStringRef::length, mlir::remark::missed(), MlirRemarkKindAnalysis, MlirRemarkKindFailure, MlirRemarkKindMissed, MlirRemarkKindPassed, MlirRemarkKindUnknown, mlir::remark::RemarkOpts::name(), mlir::remark::passed(), mlir::remark::RemarkOpts::subCategory(), and unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
| MLIR_CAPI_EXPORTED MlirStringRef mlirRemarkGetArgKey | ( | MlirRemark | remark, |
| intptr_t | pos ) |
Returns the key of the pos-th argument of the remark.
Definition at line 193 of file Remarks.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRemark::getArgs().
| MLIR_CAPI_EXPORTED MlirStringRef mlirRemarkGetArgValue | ( | MlirRemark | remark, |
| intptr_t | pos ) |
Returns the value of the pos-th argument of the remark.
Definition at line 200 of file Remarks.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRemark::getArgs().
| MLIR_CAPI_EXPORTED MlirStringRef mlirRemarkGetCategoryName | ( | MlirRemark | remark | ) |
Returns the category of the remark (the subject of the filters).
Definition at line 169 of file Remarks.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRemark::getCategoryName().
| MLIR_CAPI_EXPORTED MlirStringRef mlirRemarkGetFullCategoryName | ( | MlirRemark | remark | ) |
Returns the combined category:subcategory name of the remark.
Definition at line 173 of file Remarks.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRemark::getFullCategoryName().
| MLIR_CAPI_EXPORTED MlirStringRef mlirRemarkGetFunctionName | ( | MlirRemark | remark | ) |
Returns the name of the function the remark refers to.
Definition at line 177 of file Remarks.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRemark::getFunctionName().
| MLIR_CAPI_EXPORTED uint64_t mlirRemarkGetId | ( | MlirRemark | remark | ) |
Returns the unique id of the remark within its engine (0 when unset).
Definition at line 185 of file Remarks.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRemark::getId().
| MLIR_CAPI_EXPORTED MlirRemarkKind mlirRemarkGetKind | ( | MlirRemark | remark | ) |
Returns the kind of the remark.
Definition at line 161 of file Remarks.cpp.
References getRemarkKind(), unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRemark::getKind().
| MLIR_CAPI_EXPORTED MlirLocation mlirRemarkGetLocation | ( | MlirRemark | remark | ) |
Returns the location of the remark.
Definition at line 181 of file Remarks.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRemark::getLocation().
| MLIR_CAPI_EXPORTED intptr_t mlirRemarkGetNumArgs | ( | MlirRemark | remark | ) |
Returns the number of key/value arguments attached to the remark.
Definition at line 189 of file Remarks.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRemark::getArgs().
| MLIR_CAPI_EXPORTED MlirStringRef mlirRemarkGetRemarkName | ( | MlirRemark | remark | ) |
Returns the name identifying the remark.
Definition at line 165 of file Remarks.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRemark::getRemarkName().
| MLIR_CAPI_EXPORTED void mlirRemarkPrint | ( | MlirRemark | remark, |
| MlirStringCallback | callback, | ||
| void * | userData ) |
Prints the remark in its textual form, [Kind] name | Category:... | / Function=... | key=value, ... (without its location).
Definition at line 207 of file Remarks.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRemark::getMessage().