MLIR 24.0.0git
Remark Class Reference

#include "mlir/IR/Remarks.h"

Inheritance diagram for Remark:

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
llvm::StringRef getCategoryName () const
llvm::StringRef getCombinedCategoryName () const
StringRef getRemarkName () const
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).

Detailed Description

Definition at line 151 of file Remarks.h.

Constructor & Destructor Documentation

◆ Remark()

mlir::remark::detail::Remark::Remark ( RemarkKind remarkKind,
DiagnosticSeverity severity,
Location loc,
RemarkOpts opts )
inline

Definition at line 154 of file Remarks.h.

Member Function Documentation

◆ addRelatedRemark()

void mlir::remark::detail::Remark::addRelatedRemark ( RemarkId relatedId)
inline

Add a related ID and its generated argument.

Definition at line 272 of file Remarks.h.

◆ generateRemark()

llvm::remarks::Remark Remark::generateRemark ( ) const

Diagnostic -> Remark.

Definition at line 152 of file Remarks.cpp.

◆ getArgs()

ArrayRef< Arg > mlir::remark::detail::Remark::getArgs ( ) const
inline

Return arguments, owned until mutation or destruction.

Definition at line 247 of file Remarks.h.

◆ getCategoryName()

llvm::StringRef mlir::remark::detail::Remark::getCategoryName ( ) const
inline

Definition at line 226 of file Remarks.h.

◆ getCombinedCategoryName()

llvm::StringRef mlir::remark::detail::Remark::getCombinedCategoryName ( ) const
inline

Definition at line 228 of file Remarks.h.

◆ getFunction()

StringRef mlir::remark::detail::Remark::getFunction ( ) const
inline

Definition at line 220 of file Remarks.h.

◆ getId()

RemarkId mlir::remark::detail::Remark::getId ( ) const
inline

Get this remark's unique ID (0 if not assigned).

Definition at line 256 of file Remarks.h.

◆ getLocation()

Location mlir::remark::detail::Remark::getLocation ( ) const
inline

Definition at line 216 of file Remarks.h.

◆ getMsg()

std::string Remark::getMsg ( ) const

Definition at line 112 of file Remarks.cpp.

◆ getRelatedRemarkIds()

ArrayRef< RemarkId > mlir::remark::detail::Remark::getRelatedRemarkIds ( ) const
inline

Get the list of related remark IDs.

Definition at line 266 of file Remarks.h.

◆ getRemarkKind()

RemarkKind mlir::remark::detail::Remark::getRemarkKind ( ) const
inline

Get the remark kind.

Definition at line 285 of file Remarks.h.

◆ getRemarkName()

StringRef mlir::remark::detail::Remark::getRemarkName ( ) const
inline

Definition at line 238 of file Remarks.h.

◆ getRemarkType()

llvm::remarks::Type Remark::getRemarkType ( ) const

Definition at line 136 of file Remarks.cpp.

◆ getRemarkTypeString()

llvm::StringRef Remark::getRemarkTypeString ( ) const

Definition at line 120 of file Remarks.cpp.

◆ hasRelatedRemarks()

bool mlir::remark::detail::Remark::hasRelatedRemarks ( ) const
inline

Check if this remark has any related remarks.

Definition at line 282 of file Remarks.h.

◆ insert() [1/2]

void Remark::insert ( Arg a)

Definition at line 45 of file Remarks.cpp.

◆ insert() [2/2]

void Remark::insert ( llvm::StringRef s)

Definition at line 44 of file Remarks.cpp.

◆ print()

void Remark::print ( llvm::raw_ostream & os,
bool printLocation = false ) const

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 89 of file Remarks.cpp.

◆ setId()

void mlir::remark::detail::Remark::setId ( RemarkId newId)
inline

Set this remark's unique ID. Also adds it as an Arg for serialization.

Definition at line 259 of file Remarks.h.

◆ setRelatedRemarkIds()

void Remark::setRelatedRemarkIds ( ArrayRef< RemarkId > ids)

Replace the list of related remark IDs.

Definition at line 47 of file Remarks.cpp.

Member Data Documentation

◆ args

SmallVector<Arg, 4> mlir::remark::detail::Remark::args
protected

Args collected via the streaming interface.

Definition at line 314 of file Remarks.h.

◆ categoryName

std::string mlir::remark::detail::Remark::categoryName
protected

Category name e.g., "Unroll" or "UnrollAndJam".

Stored as std::string to ensure the Remark owns its data.

Definition at line 300 of file Remarks.h.

◆ fullCategoryName

SmallString<64> mlir::remark::detail::Remark::fullCategoryName
protected

Combined name for category and sub-category.

Definition at line 307 of file Remarks.h.

◆ functionName

std::string mlir::remark::detail::Remark::functionName
protected

Name of the covering function like interface.

Stored as std::string to ensure the Remark owns its data.

Definition at line 295 of file Remarks.h.

◆ id

RemarkId mlir::remark::detail::Remark::id
protected

Unique ID for this remark (assigned by RemarkEngine).

Definition at line 317 of file Remarks.h.

◆ loc

Location mlir::remark::detail::Remark::loc
protected

Definition at line 297 of file Remarks.h.

◆ relatedRemarks

SmallVector<RemarkId> mlir::remark::detail::Remark::relatedRemarks
protected

IDs of related remarks (e.g., parent analysis that enabled this opt).

Definition at line 320 of file Remarks.h.

◆ remarkKind

RemarkKind mlir::remark::detail::Remark::remarkKind
protected

Keeps the MLIR diagnostic kind, which is used to determine the diagnostic kind in the LLVM remark streamer.

Definition at line 292 of file Remarks.h.

◆ remarkName

std::string mlir::remark::detail::Remark::remarkName
protected

Remark identifier.

Stored as std::string to ensure the Remark owns its data.

Definition at line 311 of file Remarks.h.

◆ subCategoryName

std::string mlir::remark::detail::Remark::subCategoryName
protected

Sub category name e.g., "Loop Optimizer".

Stored as std::string to ensure the Remark owns its data.

Definition at line 304 of file Remarks.h.


The documentation for this class was generated from the following files: