LLVM: include/llvm/Analysis/OptimizationRemarkEmitter.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_ANALYSIS_OPTIMIZATIONREMARKEMITTER_H
15#define LLVM_ANALYSIS_OPTIMIZATIONREMARKEMITTER_H
16
23#include
24
25namespace llvm {
26
27
28
29
30
31
32
34public:
37
38
39
40
41
42
43
44
45
46
47
48
50
52 : F(Arg.F), BFI(Arg.BFI) {}
53
55 F = RHS.F;
56 BFI = RHS.BFI;
57 return *this;
58 }
59
60
62 FunctionAnalysisManager::Invalidator &Inv);
63
64
66 return F->getContext().getLLVMRemarkStreamer() ||
67 F->getContext().getDiagHandlerPtr()->isAnyRemarkEnabled();
68 }
69
70
71
73
74
76
77
78
79 template
80 void emit(T RemarkBuilder, decltype(RemarkBuilder()) * = nullptr) {
81
82
83
84
86 auto R = RemarkBuilder();
87 static_assert(
89 "the lambda passed to emit() must return a remark");
91 }
92 }
93
94
95
96
97
98
99
100
108 return Ctx.getLLVMRemarkStreamer() ||
109 Ctx.getDiagHandlerPtr()->isAnyRemarkEnabled(PassName);
110 }
111
112private:
114
116
117
118 std::unique_ptr OwnedBFI;
119
120
121
122 std::optional<uint64_t> computeHotness(const Value *V);
123
124
126
127
128
129 bool shouldEmitVerbose() { return BFI != nullptr; }
130
133};
134
135
136
137
143
144
145
146
147
148
150 std::unique_ptr ORE;
151
152public:
154
156
158
160 assert(ORE && "pass not run yet");
161 return *ORE;
162 }
163
165};
166
171
172public:
173
175
176
178};
179}
180#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool runOnFunction(Function &F, bool PostInlining)
This header defines various interfaces for pass management in LLVM.
static const char PassName[]
Represent the analysis usage information of a pass.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
Common features for diagnostics dealing with optimization remarks that are used by IR passes.
Common features for diagnostics dealing with optimization remarks that are used by both IR and MIR pa...
This is an important class for using LLVM in a threaded context.
A set of analyses that are preserved following a run of a transformation pass.
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
Add a small namespace to avoid name clashes with the classes used in the streaming interface.
Definition OptimizationRemarkEmitter.h:138
DiagnosticInfoOptimizationBase::Argument NV
Definition OptimizationRemarkEmitter.h:139
DiagnosticInfoOptimizationBase::setIsVerbose setIsVerbose
Definition OptimizationRemarkEmitter.h:140
DiagnosticInfoOptimizationBase::setExtraArgs setExtraArgs
Definition OptimizationRemarkEmitter.h:141
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
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...
Used in the streaming interface as the general argument type.
Used to set IsVerbose via the stream interface.