|
MLIR 24.0.0git
|
#include "mlir/IR/Remarks.h"
Classes | |
| struct | RemarkHistory |
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. | |
| void | enableHistory (bool enable=true) |
| Enable or disable history. | |
| void | clearHistory () |
| Discard recorded metadata without changing whether history is enabled. | |
| SmallVector< RemarkId > | findRemarks (const RemarkQuery &query) const |
| Find matching emitted remarks and pending candidates in ID order, each once. | |
| SmallVector< RemarkId > | findRemarks (const RemarkOpts &opts, std::optional< RemarkKind > kind=std::nullopt) const |
| Search using nonempty option fields as exact-match 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 483 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 423 of file Remarks.cpp.
| void RemarkEngine::clearHistory | ( | ) |
Discard recorded metadata without changing whether history is enabled.
Definition at line 256 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 369 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 387 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 381 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 375 of file Remarks.cpp.
References isMissedOptRemarkEnabled(), and mlir::remark::detail::Remark::loc.
Referenced by emitImportedRemark(), and mlir::remark::missed().
Enable or disable history.
Enabling records subsequent emissions and makes pending policy remarks searchable; disabling discards the recorded metadata and suppresses queries.
Definition at line 245 of file Remarks.cpp.
| SmallVector< RemarkId > RemarkEngine::findRemarks | ( | const RemarkOpts & | opts, |
| std::optional< RemarkKind > | kind = std::nullopt ) const |
Search using nonempty option fields as exact-match criteria.
The related ID in opts is ignored. Use RemarkQuery to match empty fields or a location.
Definition at line 304 of file Remarks.cpp.
References mlir::remark::RemarkOpts::categoryName, findRemarks(), mlir::remark::RemarkOpts::functionName, mlir::remark::RemarkOpts::remarkName, and mlir::remark::RemarkOpts::subCategoryName.
| SmallVector< RemarkId > RemarkEngine::findRemarks | ( | const RemarkQuery & | query | ) | const |
Find matching emitted remarks and pending candidates in ID order, each once.
Returns empty without history; otherwise scans all pending and emitted remarks. Candidates may be replaced before emission. Queries may overlap reports, but not Final::finalize(). Cross-function matches depend on thread timing; scope queries with function().
Definition at line 265 of file Remarks.cpp.
References mlir::remark::detail::RemarkEngine::RemarkHistory::Entry::from(), mlir::remark::detail::RemarkEngine::RemarkHistory::Entry::id, and result.
Referenced by findRemarks().
|
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 431 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 344 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 678 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 348 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 336 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 340 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 352 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 418 of file Remarks.cpp.