16 #ifndef LLVM_CODEGEN_MACHINEOPTIMIZATIONREMARKEMITTER_H 17 #define LLVM_CODEGEN_MACHINEOPTIMIZATIONREMARKEMITTER_H 23 class MachineBasicBlock;
24 class MachineBlockFrequencyInfo;
68 RemarkName, Loc, MBB) {}
94 PassName, RemarkName, Loc, MBB) {}
120 PassName, RemarkName, Loc, MBB) {}
149 : MF(MF), MBFI(MBFI) {}
162 return (MF.getFunction().getContext().getDiagnosticsOutputFile() ||
163 MF.getFunction().getContext()
164 .getDiagHandlerPtr()->isAnyRemarkEnabled(PassName));
169 template <
typename T>
170 void emit(
T RemarkBuilder, decltype(RemarkBuilder()) * =
nullptr) {
175 if (MF.getFunction().getContext().getDiagnosticsOutputFile() ||
176 MF.getFunction().getContext().getDiagHandlerPtr()->isAnyRemarkEnabled()) {
177 auto R = RemarkBuilder();
197 bool shouldEmitVerbose() {
return MBFI !=
nullptr; }
206 std::unique_ptr<MachineOptimizationRemarkEmitter> ORE;
216 assert(ORE &&
"pass not run yet");
const char * PassName
Name of the pass that triggers this report.
DiagnosticKind
Defines the different supported kind of a diagnostic.
This class represents lattice values for constants.
MI-specific kinds of diagnostic Arguments.
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
DiagnosticInfoMIROptimization(enum DiagnosticKind Kind, const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, const MachineBasicBlock *MBB)
static bool classof(const DiagnosticInfo *DI)
StringRef RemarkName
Textual identifier for the remark (single-word, camel-case).
MachineArgument(StringRef Key, const MachineInstr &MI)
Print an entire MachineInstr.
This is the base abstract class for diagnostic reporting in the backend.
const Function & getFunction() const
This is an important class for using LLVM in a threaded context.
Represent the analysis usage information of a pass.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
Used in the streaming interface as the general argument type.
virtual bool isMissedOptRemarkEnabled(StringRef PassName) const
Return true if missed optimization remarks are enabled, override to provide different implementation...
Common features for diagnostics dealing with optimization remarks that are used by both IR and MIR pa...
virtual bool isPassedOptRemarkEnabled(StringRef PassName) const
Return true if passed optimization remarks are enabled, override to provide different implementation...
Representation of each machine instruction.
virtual bool isAnalysisRemarkEnabled(StringRef PassName) const
Return true if analysis remarks are enabled, override to provide different implementation.
const MachineBasicBlock * getBlock() const
const DiagnosticHandler * getDiagHandlerPtr() const
getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static const Function * getParent(const Value *V)
StringRef - Represent a constant reference to a string, i.e.
Common features for diagnostics dealing with optimization remarks that are used by machine passes...
StringRef getPassName() const