|
MLIR 24.0.0git
|
#include "mlir/IR/Remarks.h"
Classes | |
| struct | Arg |
Public Member Functions | |
| Remark (RemarkKind remarkKind, DiagnosticSeverity severity, Location loc, RemarkOpts opts) | |
| void | insert (llvm::StringRef s) |
| void | insert (Arg a) |
| void | print (llvm::raw_ostream &os, bool printLocation=false) const |
| Print the remark to the given output stream. | |
| Location | getLocation () const |
| llvm::remarks::Remark | generateRemark () const |
| Diagnostic -> Remark. | |
| StringRef | getFunction () const |
| StringRef | getRawFunction () const |
| Return the stored function name, which may be empty. | |
| llvm::StringRef | getCategoryName () const |
| llvm::StringRef | getSubCategoryName () const |
| llvm::StringRef | getCombinedCategoryName () const |
| StringRef | getRemarkName () const |
| StringRef | getRawRemarkName () const |
| Return the stored remark name, which may be empty. | |
| std::string | getMsg () const |
| ArrayRef< Arg > | getArgs () const |
| Return arguments, owned until mutation or destruction. | |
| llvm::remarks::Type | getRemarkType () const |
| RemarkId | getId () const |
| Get this remark's unique ID (0 if not assigned). | |
| void | setId (RemarkId newId) |
| Set this remark's unique ID. Also adds it as an Arg for serialization. | |
| ArrayRef< RemarkId > | getRelatedRemarkIds () const |
| Get the list of related remark IDs. | |
| void | setRelatedRemarkIds (ArrayRef< RemarkId > ids) |
| Replace the list of related remark IDs. | |
| void | addRelatedRemark (RemarkId relatedId) |
| Add a related ID and its generated argument. | |
| bool | hasRelatedRemarks () const |
| Check if this remark has any related remarks. | |
| RemarkKind | getRemarkKind () const |
| Get the remark kind. | |
| StringRef | getRemarkTypeString () const |
Protected Attributes | |
| RemarkKind | remarkKind |
| Keeps the MLIR diagnostic kind, which is used to determine the diagnostic kind in the LLVM remark streamer. | |
| std::string | functionName |
| Name of the covering function like interface. | |
| Location | loc |
| std::string | categoryName |
| Category name e.g., "Unroll" or "UnrollAndJam". | |
| std::string | subCategoryName |
| Sub category name e.g., "Loop Optimizer". | |
| SmallString< 64 > | fullCategoryName |
| Combined name for category and sub-category. | |
| std::string | remarkName |
| Remark identifier. | |
| SmallVector< Arg, 4 > | args |
| Args collected via the streaming interface. | |
| RemarkId | id |
| Unique ID for this remark (assigned by RemarkEngine). | |
| SmallVector< RemarkId > | relatedRemarks |
| IDs of related remarks (e.g., parent analysis that enabled this opt). | |
|
inline |
Definition at line 220 of file Remarks.h.
References addRelatedRemark(), categoryName, functionName, if(), loc, mlir::remark::RemarkOpts::relatedId, remarkKind, remarkName, and subCategoryName.
Referenced by mlir::remark::detail::OptRemarkBase< RemarkKind::RemarkAnalysis, DiagnosticSeverity::Remark >::OptRemarkBase().
Add a related ID and its generated argument.
Definition at line 346 of file Remarks.h.
References args, mlir::remark::RemarkId::getValue(), mlir::remark::detail::Remark::Arg::isLink, and relatedRemarks.
Referenced by Remark(), and setRelatedRemarkIds().
| llvm::remarks::Remark Remark::generateRemark | ( | ) | const |
Diagnostic -> Remark.
Definition at line 154 of file Remarks.cpp.
References getArgs(), getCombinedCategoryName(), getFunction(), getLocation(), getRemarkName(), and getRemarkType().
Return arguments, owned until mutation or destruction.
Definition at line 321 of file Remarks.h.
References args.
Referenced by generateRemark(), and print().
|
inline |
Definition at line 295 of file Remarks.h.
References categoryName.
|
inline |
Definition at line 299 of file Remarks.h.
References categoryName, fullCategoryName, and subCategoryName.
Referenced by generateRemark(), llvm::DenseMapInfo< mlir::remark::detail::Remark >::getHashValue(), and print().
|
inline |
Definition at line 286 of file Remarks.h.
References functionName.
Referenced by generateRemark(), and print().
|
inline |
|
inline |
Definition at line 282 of file Remarks.h.
References loc.
Referenced by generateRemark(), llvm::DenseMapInfo< mlir::remark::detail::Remark >::getHashValue(), and print().
| std::string Remark::getMsg | ( | ) | const |
Definition at line 114 of file Remarks.cpp.
References print().
|
inline |
Return the stored function name, which may be empty.
Definition at line 293 of file Remarks.h.
References functionName.
|
inline |
Return the stored remark name, which may be empty.
Definition at line 316 of file Remarks.h.
References remarkName.
Get the list of related remark IDs.
Definition at line 340 of file Remarks.h.
References relatedRemarks.
|
inline |
Get the remark kind.
Definition at line 359 of file Remarks.h.
References remarkKind.
Referenced by llvm::DenseMapInfo< mlir::remark::detail::Remark >::getHashValue().
|
inline |
Definition at line 309 of file Remarks.h.
References remarkName.
Referenced by generateRemark(), and llvm::DenseMapInfo< mlir::remark::detail::Remark >::getHashValue().
| llvm::remarks::Type Remark::getRemarkType | ( | ) | const |
Definition at line 138 of file Remarks.cpp.
References mlir::remark::RemarkAnalysis, mlir::remark::RemarkFailure, remarkKind, mlir::remark::RemarkMissed, mlir::remark::RemarkPassed, and mlir::remark::RemarkUnknown.
Referenced by generateRemark().
| llvm::StringRef Remark::getRemarkTypeString | ( | ) | const |
Definition at line 122 of file Remarks.cpp.
References mlir::remark::RemarkAnalysis, mlir::remark::RemarkFailure, remarkKind, mlir::remark::RemarkMissed, mlir::remark::RemarkPassed, and mlir::remark::RemarkUnknown.
Referenced by print().
|
inline |
Definition at line 297 of file Remarks.h.
References subCategoryName.
|
inline |
Check if this remark has any related remarks.
Definition at line 356 of file Remarks.h.
References relatedRemarks.
Definition at line 47 of file Remarks.cpp.
References args.
| void Remark::insert | ( | llvm::StringRef | s | ) |
Definition at line 46 of file Remarks.cpp.
References args.
Referenced by mlir::remark::detail::operator<<(), mlir::remark::detail::operator<<(), and mlir::remark::detail::operator<<().
Print the remark to the given output stream.
Example output: [Missed] Category: Loop | Pass:Unroller | Function=main | Reason="tripCount=4 < threshold=256" [Failure] LoopOptimizer | Reason="failed due to unsupported pattern"
Definition at line 91 of file Remarks.cpp.
References categoryName, functionName, getArgs(), getCombinedCategoryName(), getFunction(), getLocation(), getRemarkTypeString(), printArgs(), and remarkName.
Referenced by getMsg().
Replace the list of related remark IDs.
Definition at line 49 of file Remarks.cpp.
References addRelatedRemark(), args, copy(), mlir::remark::detail::Remark::Arg::isLink, and relatedRemarks.
|
protected |
Args collected via the streaming interface.
Definition at line 388 of file Remarks.h.
Referenced by addRelatedRemark(), getArgs(), insert(), insert(), printArgs(), setId(), and setRelatedRemarkIds().
|
protected |
Category name e.g., "Unroll" or "UnrollAndJam".
Stored as std::string to ensure the Remark owns its data.
Definition at line 374 of file Remarks.h.
Referenced by getCategoryName(), getCombinedCategoryName(), mlir::remark::detail::RemarkEngine::isAnalysisOptRemarkEnabled(), mlir::remark::detail::RemarkEngine::isFailedOptRemarkEnabled(), mlir::remark::detail::RemarkEngine::isMissedOptRemarkEnabled(), mlir::remark::detail::RemarkEngine::isPassedOptRemarkEnabled(), mlir::remark::detail::RemarkEngine::isRemarkEnabled(), print(), and Remark().
|
protected |
Combined name for category and sub-category.
Definition at line 381 of file Remarks.h.
Referenced by getCombinedCategoryName().
|
protected |
Name of the covering function like interface.
Stored as std::string to ensure the Remark owns its data.
Definition at line 369 of file Remarks.h.
Referenced by getFunction(), getRawFunction(), print(), and Remark().
|
protected |
Unique ID for this remark (assigned by RemarkEngine).
Definition at line 391 of file Remarks.h.
Referenced by getId().
|
protected |
Definition at line 371 of file Remarks.h.
Referenced by mlir::remark::detail::RemarkEngine::emitOptimizationRemark(), mlir::remark::detail::RemarkEngine::emitOptimizationRemarkAnalysis(), mlir::remark::detail::RemarkEngine::emitOptimizationRemarkFailure(), mlir::remark::detail::RemarkEngine::emitOptimizationRemarkMiss(), getLocation(), mlir::remark::detail::OptRemarkBase< RemarkKind::RemarkAnalysis, DiagnosticSeverity::Remark >::OptRemarkBase(), and Remark().
|
protected |
IDs of related remarks (e.g., parent analysis that enabled this opt).
Definition at line 394 of file Remarks.h.
Referenced by addRelatedRemark(), getRelatedRemarkIds(), hasRelatedRemarks(), and setRelatedRemarkIds().
|
protected |
Keeps the MLIR diagnostic kind, which is used to determine the diagnostic kind in the LLVM remark streamer.
Definition at line 366 of file Remarks.h.
Referenced by getRemarkKind(), getRemarkType(), getRemarkTypeString(), and Remark().
|
protected |
Remark identifier.
Stored as std::string to ensure the Remark owns its data.
Definition at line 385 of file Remarks.h.
Referenced by getRawRemarkName(), getRemarkName(), print(), and Remark().
|
protected |
Sub category name e.g., "Loop Optimizer".
Stored as std::string to ensure the Remark owns its data.
Definition at line 378 of file Remarks.h.
Referenced by getCombinedCategoryName(), getSubCategoryName(), and Remark().