29 return remarks::Type::Unknown;
32 return remarks::Type::Passed;
35 return remarks::Type::Missed;
38 return remarks::Type::Analysis;
40 return remarks::Type::AnalysisFPCommute;
42 return remarks::Type::AnalysisAliasing;
44 return remarks::Type::Failure;
49static std::optional<remarks::RemarkLocation>
54 unsigned Line =
DL.getLine();
55 unsigned Col =
DL.getColumn();
72 R.Args.emplace_back();
73 R.Args.back().Key = Arg.Key;
74 R.Args.back().Val = Arg.Val;
109 return make_error<LLVMRemarkSetupFormatError>(std::move(E));
125 return make_error<LLVMRemarkSetupFormatError>(std::move(E));
137 return make_error<LLVMRemarkSetupPatternError>(std::move(E));
139 return std::move(RemarksFile);
153 return make_error<LLVMRemarkSetupFormatError>(std::move(E));
159 return make_error<LLVMRemarkSetupFormatError>(std::move(E));
163 std::make_unique<remarks::RemarkStreamer>(std::move(*RemarkSerializer)));
171 return make_error<LLVMRemarkSetupPatternError>(std::move(E));
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Common features for diagnostics dealing with optimization remarks that are used by both IR and MIR pa...
ArrayRef< Argument > getArgs() const
StringRef getPassName() const
StringRef getRemarkName() const
std::optional< uint64_t > getHotness() const
const Function & getFunction() const
void getLocation(StringRef &RelativePath, unsigned &Line, unsigned &Column) const
Return location information for this diagnostic in three parts: the relative source file path,...
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
static StringRef dropLLVMManglingEscape(StringRef Name)
If the given string begins with the GlobalValue name mangling escape character '\1',...
This is an important class for using LLVM in a threaded context.
remarks::RemarkStreamer * getMainRemarkStreamer()
The "main remark streamer" used by all the specialized remark streamers.
void setLLVMRemarkStreamer(std::unique_ptr< LLVMRemarkStreamer > RemarkStreamer)
void setDiagnosticsHotnessThreshold(std::optional< uint64_t > Threshold)
Set the minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.
void setMainRemarkStreamer(std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer)
void setDiagnosticsHotnessRequested(bool Requested)
Set if a code hotness metric should be included in optimization diagnostics.
StringRef - Represent a constant reference to a string, i.e.
StringRef getName() const
Return a constant reference to the value's name.
This class implements an extremely fast bulk output stream that can only output to a stream.
@ OF_TextWithCRLF
The file should be opened in text mode and use a carriage linefeed '\r '.
This is an optimization pass for GlobalISel generic memory operations.
cl::opt< std::string > RemarksFormat("lto-pass-remarks-format", cl::desc("The format used for serializing remarks (default: YAML)"), cl::value_desc("format"), cl::init("yaml"))
cl::opt< std::string > RemarksPasses("lto-pass-remarks-filter", cl::desc("Only record optimization remarks from passes whose " "names match the given regular expression"), cl::value_desc("regex"))
DiagnosticKind
Defines the different supported kind of a diagnostic.
@ DK_OptimizationRemarkAnalysis
@ DK_OptimizationRemarkAnalysisAliasing
@ DK_MachineOptimizationRemark
@ DK_OptimizationRemarkMissed
@ DK_MachineOptimizationRemarkAnalysis
@ DK_MachineOptimizationRemarkMissed
@ DK_OptimizationRemarkAnalysisFPCommute
Expected< std::unique_ptr< ToolOutputFile > > setupLLVMOptimizationRemarks(LLVMContext &Context, StringRef RemarksFilename, StringRef RemarksPasses, StringRef RemarksFormat, bool RemarksWithHotness, std::optional< uint64_t > RemarksHotnessThreshold=0)
Setup optimization remarks that output to a file.
cl::opt< bool > RemarksWithHotness("lto-pass-remarks-with-hotness", cl::desc("With PGO, include profile count in optimization remarks"), cl::Hidden)
cl::opt< std::string > RemarksFilename("lto-pass-remarks-output", cl::desc("Output filename for pass remarks"), cl::value_desc("filename"))
cl::opt< std::optional< uint64_t >, false, remarks::HotnessThresholdParser > RemarksHotnessThreshold("lto-pass-remarks-hotness-threshold", cl::desc("Minimum profile count required for an " "optimization remark to be output." " Use 'auto' to apply the threshold from profile summary."), cl::value_desc("uint or 'auto'"), cl::init(0), cl::Hidden)
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
Used in the streaming interface as the general argument type.