15#ifndef LLVM_CODEGEN_MACHINEOPTIMIZATIONREMARKEMITTER_H
16#define LLVM_CODEGEN_MACHINEOPTIMIZATIONREMARKEMITTER_H
158 : MF(MF), MBFI(MBFI) {}
165 MachineFunctionAnalysisManager::Invalidator &Inv);
179 MF.getFunction().getContext().getLLVMRemarkStreamer() ||
180 MF.getFunction().getContext().getDiagHandlerPtr()->isAnyRemarkEnabled(
186 template <
typename T>
187 void emit(
T RemarkBuilder,
decltype(RemarkBuilder()) * =
nullptr) {
192 if (MF.getFunction().getContext().getLLVMRemarkStreamer() ||
196 ->isAnyRemarkEnabled()) {
197 auto R = RemarkBuilder();
221 bool shouldEmitVerbose() {
return MBFI !=
nullptr; }
243 std::unique_ptr<MachineOptimizationRemarkEmitter> ORE;
253 assert(ORE &&
"pass not run yet");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static const Function * getParent(const Value *V)
static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
Return the first found DebugLoc that has a DILocation, given a range of instructions.
static const char PassName[]
Represent the analysis usage information of a pass.
Common features for diagnostics dealing with optimization remarks that are used by machine passes.
static bool classof(const DiagnosticInfo *DI)
const MachineBasicBlock * getBlock() const
DiagnosticInfoMIROptimization(enum DiagnosticKind Kind, const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, const MachineBasicBlock *MBB)
Common features for diagnostics dealing with optimization remarks that are used by both IR and MIR pa...
const char * PassName
Name of the pass that triggers this report.
StringRef getPassName() const
StringRef RemarkName
Textual identifier for the remark (single-word, CamelCase).
DiagnosticInfoOptimizationBase(enum DiagnosticKind Kind, enum DiagnosticSeverity Severity, const char *PassName, StringRef RemarkName, const Function &Fn, const DiagnosticLocation &Loc)
PassName is the name of the pass emitting this diagnostic.
const Function & getFunction() const
This is the base abstract class for diagnostic reporting in the backend.
This is an important class for using LLVM in a threaded context.
LLVM_ABI const DiagnosticHandler * getDiagHandlerPtr() const
getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler.
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
MachineFunctionPass(char &ID)
Representation of each machine instruction.
A set of analyses that are preserved following a run of a transformation pass.
StringRef - Represent a constant reference to a string, i.e.
DiagnosticInfoMIROptimization::MachineArgument MNV
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
DiagnosticKind
Defines the different supported kind of a diagnostic.
@ DK_MachineOptimizationRemark
@ DK_MachineOptimizationRemarkAnalysis
@ DK_MachineOptimizationRemarkMissed
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
virtual bool isPassedOptRemarkEnabled(StringRef PassName) const
Return true if passed optimization remarks are enabled, override to provide different implementation.
virtual bool isAnalysisRemarkEnabled(StringRef PassName) const
Return true if analysis remarks are enabled, override to provide different implementation.
virtual bool isMissedOptRemarkEnabled(StringRef PassName) const
Return true if missed optimization remarks are enabled, override to provide different implementation.
MI-specific kinds of diagnostic Arguments.
LLVM_ABI MachineArgument(StringRef Key, const MachineInstr &MI)
Print an entire MachineInstr.
Used in the streaming interface as the general argument type.