|
MLIR 24.0.0git
|
#include "mlir/IR/Remarks.h"
Public Member Functions | |
| RemarkEngine ()=delete | |
| Default constructor is deleted, use the other constructor. | |
| RemarkEngine (bool printAsEmitRemarks, const RemarkCategories &cats) | |
| Constructs Remark engine with optional category names. | |
| ~RemarkEngine () | |
| Destructor that will close the output file and reset the main remark streamer. | |
| LogicalResult | initialize (std::unique_ptr< MLIRRemarkStreamerBase > streamer, std::unique_ptr< RemarkEmittingPolicyBase > remarkEmittingPolicy, std::string *errMsg) |
| Setup the remark engine with the given output path and format. | |
| RemarkEmittingPolicyBase * | getRemarkEmittingPolicy () const |
| Get the remark emitting policy. | |
| RemarkId | generateRemarkId () |
| Generate a unique ID for a new remark. | |
| bool | isMissedOptRemarkEnabled (StringRef categoryName) const |
| Return true if missed optimization remarks are enabled for the given category. | |
| bool | isPassedOptRemarkEnabled (StringRef categoryName) const |
| Return true if passed optimization remarks are enabled for the given category. | |
| bool | isAnalysisOptRemarkEnabled (StringRef categoryName) const |
| Return true if analysis remarks are enabled for the given category. | |
| bool | isFailedOptRemarkEnabled (StringRef categoryName) const |
| Return true if failed optimization remarks are enabled for the given category. | |
| bool | isRemarkEnabled (RemarkKind kind, StringRef categoryName) const |
| Return true if remarks of the given kind are enabled for the given category. | |
| bool | isAnyRemarkEnabled (StringRef categoryName) const |
| Return true if any kind of remark is enabled for the given category. | |
| bool | isAnyRemarkEnabled () const |
| Return true if any kind of remark is enabled for any category, i.e. | |
| SmallVector< RemarkId > | findRemarks (const RemarkOpts &opts, std::optional< RemarkKind > kind=std::nullopt) const |
| Find all remarks matching the given criteria. | |
| void | report (const Remark &&remark) |
| Report a remark. | |
| InFlightRemark | emitOptimizationRemark (Location loc, RemarkOpts opts) |
| Report a successful remark, this will create an InFlightRemark that can be used to build the remark using the << operator. | |
| InFlightRemark | emitOptimizationRemarkMiss (Location loc, RemarkOpts opts) |
| Report a missed optimization remark that can be used to build the remark using the << operator. | |
| InFlightRemark | emitOptimizationRemarkFailure (Location loc, RemarkOpts opts) |
| Report a failed optimization remark, this will create an InFlightRemark that can be used to build the remark using the << operator. | |
| InFlightRemark | emitOptimizationRemarkAnalysis (Location loc, RemarkOpts opts) |
| Report an analysis remark, this will create an InFlightRemark that can be used to build the remark using the << operator. | |
|
delete |
Default constructor is deleted, use the other constructor.
| RemarkEngine::RemarkEngine | ( | bool | printAsEmitRemarks, |
| const RemarkCategories & | cats ) |
Constructs Remark engine with optional category names.
If a category name is not provided, it is not enabled. The category names are used to filter the remarks that are emitted.
Definition at line 329 of file Remarks.cpp.
References mlir::remark::RemarkCategories::analysis, buildFilter(), mlir::remark::RemarkCategories::failed, if(), mlir::remark::RemarkCategories::missed, and mlir::remark::RemarkCategories::passed.
| RemarkEngine::~RemarkEngine | ( | ) |
Destructor that will close the output file and reset the main remark streamer.
Definition at line 269 of file Remarks.cpp.
| InFlightRemark RemarkEngine::emitOptimizationRemark | ( | Location | loc, |
| RemarkOpts | opts ) |
Report a successful remark, this will create an InFlightRemark that can be used to build the remark using the << operator.
Definition at line 225 of file Remarks.cpp.
References isPassedOptRemarkEnabled(), and mlir::remark::detail::Remark::loc.
Referenced by emitImportedRemark(), and mlir::remark::passed().
| InFlightRemark RemarkEngine::emitOptimizationRemarkAnalysis | ( | Location | loc, |
| RemarkOpts | opts ) |
Report an analysis remark, this will create an InFlightRemark that can be used to build the remark using the << operator.
Definition at line 243 of file Remarks.cpp.
References isAnalysisOptRemarkEnabled(), and mlir::remark::detail::Remark::loc.
Referenced by mlir::remark::analysis(), and emitImportedRemark().
| InFlightRemark RemarkEngine::emitOptimizationRemarkFailure | ( | Location | loc, |
| RemarkOpts | opts ) |
Report a failed optimization remark, this will create an InFlightRemark that can be used to build the remark using the << operator.
Definition at line 237 of file Remarks.cpp.
References isFailedOptRemarkEnabled(), and mlir::remark::detail::Remark::loc.
Referenced by emitImportedRemark(), and mlir::remark::failed().
| InFlightRemark RemarkEngine::emitOptimizationRemarkMiss | ( | Location | loc, |
| RemarkOpts | opts ) |
Report a missed optimization remark that can be used to build the remark using the << operator.
Definition at line 231 of file Remarks.cpp.
References isMissedOptRemarkEnabled(), and mlir::remark::detail::Remark::loc.
Referenced by emitImportedRemark(), and mlir::remark::missed().
| SmallVector< RemarkId > mlir::remark::detail::RemarkEngine::findRemarks | ( | const RemarkOpts & | opts, |
| std::optional< RemarkKind > | kind = std::nullopt ) const |
Find all remarks matching the given criteria.
Delegates to the emitting policy. Only works with policies that store remarks (e.g. RemarkEmittingPolicyFinal); returns empty for PolicyAll.
|
inline |
|
inline |
| llvm::LogicalResult RemarkEngine::initialize | ( | std::unique_ptr< MLIRRemarkStreamerBase > | streamer, |
| std::unique_ptr< RemarkEmittingPolicyBase > | remarkEmittingPolicy, | ||
| std::string * | errMsg ) |
Setup the remark engine with the given output path and format.
Definition at line 277 of file Remarks.cpp.
References success().
| bool RemarkEngine::isAnalysisOptRemarkEnabled | ( | StringRef | categoryName | ) | const |
Return true if analysis remarks are enabled for the given category.
Definition at line 200 of file Remarks.cpp.
References mlir::remark::detail::Remark::categoryName.
Referenced by emitOptimizationRemarkAnalysis(), isAnyRemarkEnabled(), and isRemarkEnabled().
|
inline |
|
inline |
Return true if any kind of remark is enabled for the given category.
Definition at line 584 of file Remarks.h.
References isAnalysisOptRemarkEnabled(), isFailedOptRemarkEnabled(), isMissedOptRemarkEnabled(), and isPassedOptRemarkEnabled().
| bool RemarkEngine::isFailedOptRemarkEnabled | ( | StringRef | categoryName | ) | const |
Return true if failed optimization remarks are enabled for the given category.
Definition at line 204 of file Remarks.cpp.
References mlir::remark::detail::Remark::categoryName.
Referenced by emitOptimizationRemarkFailure(), isAnyRemarkEnabled(), and isRemarkEnabled().
| bool RemarkEngine::isMissedOptRemarkEnabled | ( | StringRef | categoryName | ) | const |
Return true if missed optimization remarks are enabled for the given category.
Definition at line 192 of file Remarks.cpp.
References mlir::remark::detail::Remark::categoryName.
Referenced by emitOptimizationRemarkMiss(), isAnyRemarkEnabled(), and isRemarkEnabled().
| bool RemarkEngine::isPassedOptRemarkEnabled | ( | StringRef | categoryName | ) | const |
Return true if passed optimization remarks are enabled for the given category.
Definition at line 196 of file Remarks.cpp.
References mlir::remark::detail::Remark::categoryName.
Referenced by emitOptimizationRemark(), isAnyRemarkEnabled(), and isRemarkEnabled().
| bool RemarkEngine::isRemarkEnabled | ( | RemarkKind | kind, |
| StringRef | categoryName ) const |
Return true if remarks of the given kind are enabled for the given category.
Always returns false for RemarkKind::RemarkUnknown.
Definition at line 208 of file Remarks.cpp.
References mlir::remark::detail::Remark::categoryName, isAnalysisOptRemarkEnabled(), isFailedOptRemarkEnabled(), isMissedOptRemarkEnabled(), isPassedOptRemarkEnabled(), mlir::remark::RemarkAnalysis, mlir::remark::RemarkFailure, mlir::remark::RemarkMissed, mlir::remark::RemarkPassed, and mlir::remark::RemarkUnknown.
Report a remark.
Definition at line 264 of file Remarks.cpp.