LLVM: include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef LLVM_CODEGEN_MACHINEOPTIMIZATIONREMARKEMITTER_H
16#define LLVM_CODEGEN_MACHINEOPTIMIZATIONREMARKEMITTER_H
17
23#include
24
25namespace llvm {
29
30
31
33public:
41
42
47
52
54
55private:
57};
58
59
61public:
62
63
64
65
66
72
76
77
83};
84
85
87public:
88
89
90
91
92
98
102
103
109};
110
111
113public:
114
115
116
117
118
124
130
134
135
141};
142
143
144namespace ore {
146}
147
148
149
150
151
152
153
155public:
158 : MF(MF), MBFI(MBFI) {}
159
161 default;
162
163
165 MachineFunctionAnalysisManager::Invalidator &Inv);
166
167
169
170
171
172
173
174
175
176
178 return (
179 MF.getFunction().getContext().getLLVMRemarkStreamer() ||
180 MF.getFunction().getContext().getDiagHandlerPtr()->isAnyRemarkEnabled(
182 }
183
184
185
186 template
187 void emit(T RemarkBuilder, decltype(RemarkBuilder()) * = nullptr) {
188
189
190
191
192 if (MF.getFunction().getContext().getLLVMRemarkStreamer() ||
193 MF.getFunction()
194 .getContext()
195 .getDiagHandlerPtr()
196 ->isAnyRemarkEnabled()) {
197 auto R = RemarkBuilder();
199 }
200 }
201
205
206private:
208
209
211
212
213
215
216
218
219
220
221 bool shouldEmitVerbose() { return MBFI != nullptr; }
222};
223
224
226 : public AnalysisInfoMixin {
229
230public:
234};
235
236
237
238
239
240
243 std::unique_ptr ORE;
244
245public:
247
249
251
253 assert(ORE && "pass not run yet");
254 return *ORE;
255 }
256
258};
259}
260
261#endif
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 DebugLoc that has line number information, 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.
Definition MachineOptimizationRemarkEmitter.h:32
static bool classof(const DiagnosticInfo *DI)
Definition MachineOptimizationRemarkEmitter.h:48
const MachineBasicBlock * getBlock() const
Definition MachineOptimizationRemarkEmitter.h:53
DiagnosticInfoMIROptimization(enum DiagnosticKind Kind, const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, const MachineBasicBlock *MBB)
Definition MachineOptimizationRemarkEmitter.h:34
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
Definition MachineOptimizationRemarkEmitter.h:145
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.
Definition MachineOptimizationRemarkEmitter.h:43
LLVM_ABI MachineArgument(StringRef Key, const MachineInstr &MI)
Print an entire MachineInstr.
Used in the streaming interface as the general argument type.