LLVM  14.0.0git
LLVMContext.h
Go to the documentation of this file.
1 //===- llvm/LLVMContext.h - Class for managing "global" state ---*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares LLVMContext, a container of "global" state in LLVM, such
10 // as the global type and constant uniquing tables.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_IR_LLVMCONTEXT_H
15 #define LLVM_IR_LLVMCONTEXT_H
16 
17 #include "llvm-c/Types.h"
20 #include <cstdint>
21 #include <memory>
22 #include <string>
23 
24 namespace llvm {
25 
26 class DiagnosticInfo;
27 enum DiagnosticSeverity : char;
28 class Function;
29 class Instruction;
30 class LLVMContextImpl;
31 class Module;
32 class OptPassGate;
33 template <typename T> class SmallVectorImpl;
34 template <typename T> class StringMapEntry;
35 class SMDiagnostic;
36 class StringRef;
37 class Twine;
38 class LLVMRemarkStreamer;
39 class raw_ostream;
40 
41 namespace remarks {
42 class RemarkStreamer;
43 }
44 
45 namespace SyncScope {
46 
47 typedef uint8_t ID;
48 
49 /// Known synchronization scope IDs, which always have the same value. All
50 /// synchronization scope IDs that LLVM has special knowledge of are listed
51 /// here. Additionally, this scheme allows LLVM to efficiently check for
52 /// specific synchronization scope ID without comparing strings.
53 enum {
54  /// Synchronized with respect to signal handlers executing in the same thread.
56 
57  /// Synchronized with respect to all concurrently executing threads.
58  System = 1
59 };
60 
61 } // end namespace SyncScope
62 
63 /// This is an important class for using LLVM in a threaded context. It
64 /// (opaquely) owns and manages the core "global" data of LLVM's core
65 /// infrastructure, including the type and constant uniquing tables.
66 /// LLVMContext itself provides no locking guarantees, so you should be careful
67 /// to have one context per thread.
68 class LLVMContext {
69 public:
71  LLVMContext();
72  LLVMContext(LLVMContext &) = delete;
73  LLVMContext &operator=(const LLVMContext &) = delete;
74  ~LLVMContext();
75 
76  // Pinned metadata names, which always have the same value. This is a
77  // compile-time performance optimization, not a correctness optimization.
78  enum : unsigned {
79 #define LLVM_FIXED_MD_KIND(EnumID, Name, Value) EnumID = Value,
80 #include "llvm/IR/FixedMetadataKinds.def"
81 #undef LLVM_FIXED_MD_KIND
82  };
83 
84  /// Known operand bundle tag IDs, which always have the same value. All
85  /// operand bundle tags that LLVM has special knowledge of are listed here.
86  /// Additionally, this scheme allows LLVM to efficiently check for specific
87  /// operand bundle tags without comparing strings. Keep this in sync with
88  /// LLVMContext::LLVMContext().
89  enum : unsigned {
90  OB_deopt = 0, // "deopt"
91  OB_funclet = 1, // "funclet"
92  OB_gc_transition = 2, // "gc-transition"
93  OB_cfguardtarget = 3, // "cfguardtarget"
94  OB_preallocated = 4, // "preallocated"
95  OB_gc_live = 5, // "gc-live"
96  OB_clang_arc_attachedcall = 6, // "clang.arc.attachedcall"
97  };
98 
99  /// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
100  /// This ID is uniqued across modules in the current LLVMContext.
101  unsigned getMDKindID(StringRef Name) const;
102 
103  /// getMDKindNames - Populate client supplied SmallVector with the name for
104  /// custom metadata IDs registered in this LLVMContext.
105  void getMDKindNames(SmallVectorImpl<StringRef> &Result) const;
106 
107  /// getOperandBundleTags - Populate client supplied SmallVector with the
108  /// bundle tags registered in this LLVMContext. The bundle tags are ordered
109  /// by increasing bundle IDs.
110  /// \see LLVMContext::getOperandBundleTagID
112 
113  /// getOrInsertBundleTag - Returns the Tag to use for an operand bundle of
114  /// name TagName.
116 
117  /// getOperandBundleTagID - Maps a bundle tag to an integer ID. Every bundle
118  /// tag registered with an LLVMContext has an unique ID.
120 
121  /// getOrInsertSyncScopeID - Maps synchronization scope name to
122  /// synchronization scope ID. Every synchronization scope registered with
123  /// LLVMContext has unique ID except pre-defined ones.
125 
126  /// getSyncScopeNames - Populates client supplied SmallVector with
127  /// synchronization scope names registered with LLVMContext. Synchronization
128  /// scope names are ordered by increasing synchronization scope IDs.
130 
131  /// Define the GC for a function
132  void setGC(const Function &Fn, std::string GCName);
133 
134  /// Return the GC for a function
135  const std::string &getGC(const Function &Fn);
136 
137  /// Remove the GC for a function
138  void deleteGC(const Function &Fn);
139 
140  /// Return true if the Context runtime configuration is set to discard all
141  /// value names. When true, only GlobalValue names will be available in the
142  /// IR.
143  bool shouldDiscardValueNames() const;
144 
145  /// Set the Context runtime configuration to discard all value name (but
146  /// GlobalValue). Clients can use this flag to save memory and runtime,
147  /// especially in release mode.
148  void setDiscardValueNames(bool Discard);
149 
150  /// Whether there is a string map for uniquing debug info
151  /// identifiers across the context. Off by default.
152  bool isODRUniquingDebugTypes() const;
155 
156  /// Defines the type of a yield callback.
157  /// \see LLVMContext::setYieldCallback.
158  using YieldCallbackTy = void (*)(LLVMContext *Context, void *OpaqueHandle);
159 
160  /// setDiagnosticHandlerCallBack - This method sets a handler call back
161  /// that is invoked when the backend needs to report anything to the user.
162  /// The first argument is a function pointer and the second is a context pointer
163  /// that gets passed into the DiagHandler. The third argument should be set to
164  /// true if the handler only expects enabled diagnostics.
165  ///
166  /// LLVMContext doesn't take ownership or interpret either of these
167  /// pointers.
170  void *DiagContext = nullptr, bool RespectFilters = false);
171 
172  /// setDiagnosticHandler - This method sets unique_ptr to object of
173  /// DiagnosticHandler to provide custom diagnostic handling. The first
174  /// argument is unique_ptr of object of type DiagnosticHandler or a derived
175  /// of that. The second argument should be set to true if the handler only
176  /// expects enabled diagnostics.
177  ///
178  /// Ownership of this pointer is moved to LLVMContextImpl.
179  void setDiagnosticHandler(std::unique_ptr<DiagnosticHandler> &&DH,
180  bool RespectFilters = false);
181 
182  /// getDiagnosticHandlerCallBack - Return the diagnostic handler call back set by
183  /// setDiagnosticHandlerCallBack.
185 
186  /// getDiagnosticContext - Return the diagnostic context set by
187  /// setDiagnosticContext.
188  void *getDiagnosticContext() const;
189 
190  /// getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by
191  /// setDiagnosticHandler.
192  const DiagnosticHandler *getDiagHandlerPtr() const;
193 
194  /// getDiagnosticHandler - transfers ownership of DiagnosticHandler unique_ptr
195  /// to caller.
196  std::unique_ptr<DiagnosticHandler> getDiagnosticHandler();
197 
198  /// Return if a code hotness metric should be included in optimization
199  /// diagnostics.
200  bool getDiagnosticsHotnessRequested() const;
201  /// Set if a code hotness metric should be included in optimization
202  /// diagnostics.
203  void setDiagnosticsHotnessRequested(bool Requested);
204 
205  /// Return the minimum hotness value a diagnostic would need in order
206  /// to be included in optimization diagnostics.
207  ///
208  /// Three possible return values:
209  /// 0 - threshold is disabled. Everything will be printed out.
210  /// positive int - threshold is set.
211  /// UINT64_MAX - threshold is not yet set, and needs to be synced from
212  /// profile summary. Note that in case of missing profile
213  /// summary, threshold will be kept at "MAX", effectively
214  /// suppresses all remarks output.
216 
217  /// Set the minimum hotness value a diagnostic needs in order to be
218  /// included in optimization diagnostics.
220 
221  /// Return if hotness threshold is requested from PSI.
223 
224  /// The "main remark streamer" used by all the specialized remark streamers.
225  /// This streamer keeps generic remark metadata in memory throughout the life
226  /// of the LLVMContext. This metadata may be emitted in a section in object
227  /// files depending on the format requirements.
228  ///
229  /// All specialized remark streamers should convert remarks to
230  /// llvm::remarks::Remark and emit them through this streamer.
234  std::unique_ptr<remarks::RemarkStreamer> MainRemarkStreamer);
235 
236  /// The "LLVM remark streamer" used by LLVM to serialize remark diagnostics
237  /// comming from IR and MIR passes.
238  ///
239  /// If it does not exist, diagnostics are not saved in a file but only emitted
240  /// via the diagnostic handler.
243  void
244  setLLVMRemarkStreamer(std::unique_ptr<LLVMRemarkStreamer> RemarkStreamer);
245 
246  /// Get the prefix that should be printed in front of a diagnostic of
247  /// the given \p Severity
248  static const char *getDiagnosticMessagePrefix(DiagnosticSeverity Severity);
249 
250  /// Report a message to the currently installed diagnostic handler.
251  ///
252  /// This function returns, in particular in the case of error reporting
253  /// (DI.Severity == \a DS_Error), so the caller should leave the compilation
254  /// process in a self-consistent state, even though the generated code
255  /// need not be correct.
256  ///
257  /// The diagnostic message will be implicitly prefixed with a severity keyword
258  /// according to \p DI.getSeverity(), i.e., "error: " for \a DS_Error,
259  /// "warning: " for \a DS_Warning, and "note: " for \a DS_Note.
260  void diagnose(const DiagnosticInfo &DI);
261 
262  /// Registers a yield callback with the given context.
263  ///
264  /// The yield callback function may be called by LLVM to transfer control back
265  /// to the client that invoked the LLVM compilation. This can be used to yield
266  /// control of the thread, or perform periodic work needed by the client.
267  /// There is no guaranteed frequency at which callbacks must occur; in fact,
268  /// the client is not guaranteed to ever receive this callback. It is at the
269  /// sole discretion of LLVM to do so and only if it can guarantee that
270  /// suspending the thread won't block any forward progress in other LLVM
271  /// contexts in the same process.
272  ///
273  /// At a suspend point, the state of the current LLVM context is intentionally
274  /// undefined. No assumptions about it can or should be made. Only LLVM
275  /// context API calls that explicitly state that they can be used during a
276  /// yield callback are allowed to be used. Any other API calls into the
277  /// context are not supported until the yield callback function returns
278  /// control to LLVM. Other LLVM contexts are unaffected by this restriction.
279  void setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle);
280 
281  /// Calls the yield callback (if applicable).
282  ///
283  /// This transfers control of the current thread back to the client, which may
284  /// suspend the current thread. Only call this method when LLVM doesn't hold
285  /// any global mutex or cannot block the execution in another LLVM context.
286  void yield();
287 
288  /// emitError - Emit an error message to the currently installed error handler
289  /// with optional location information. This function returns, so code should
290  /// be prepared to drop the erroneous construct on the floor and "not crash".
291  /// The generated code need not be correct. The error message will be
292  /// implicitly prefixed with "error: " and should not end with a ".".
293  void emitError(uint64_t LocCookie, const Twine &ErrorStr);
294  void emitError(const Instruction *I, const Twine &ErrorStr);
295  void emitError(const Twine &ErrorStr);
296 
297  /// Access the object which can disable optional passes and individual
298  /// optimizations at compile time.
299  OptPassGate &getOptPassGate() const;
300 
301  /// Set the object which can disable optional passes and individual
302  /// optimizations at compile time.
303  ///
304  /// The lifetime of the object must be guaranteed to extend as long as the
305  /// LLVMContext is used by compilation.
307 
308  /// Enable opaque pointers. Can only be called before creating the first
309  /// pointer type.
310  void enableOpaquePointers() const;
311 
312  /// Whether typed pointers are supported. If false, all pointers are opaque.
313  bool supportsTypedPointers() const;
314 
315 private:
316  // Module needs access to the add/removeModule methods.
317  friend class Module;
318 
319  /// addModule - Register a module as being instantiated in this context. If
320  /// the context is deleted, the module will be deleted as well.
321  void addModule(Module*);
322 
323  /// removeModule - Unregister a module from this context.
324  void removeModule(Module*);
325 };
326 
327 // Create wrappers for C Binding types (see CBindingWrapping.h).
329 
330 /* Specialized opaque context conversions.
331  */
333  return reinterpret_cast<LLVMContext**>(Tys);
334 }
335 
336 inline LLVMContextRef *wrap(const LLVMContext **Tys) {
337  return reinterpret_cast<LLVMContextRef*>(const_cast<LLVMContext**>(Tys));
338 }
339 
340 } // end namespace llvm
341 
342 #endif // LLVM_IR_LLVMCONTEXT_H
llvm::LLVMContext::setDiagnosticsHotnessThreshold
void setDiagnosticsHotnessThreshold(Optional< uint64_t > Threshold)
Set the minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.
Definition: LLVMContext.cpp:135
llvm::LLVMContext::pImpl
LLVMContextImpl *const pImpl
Definition: LLVMContext.h:70
llvm::LLVMContext::enableDebugTypeODRUniquing
void enableDebugTypeODRUniquing()
Definition: LLVMContext.cpp:322
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::LLVMContext::emitError
void emitError(uint64_t LocCookie, const Twine &ErrorStr)
emitError - Emit an error message to the currently installed error handler with optional location inf...
Definition: LLVMContext.cpp:251
LLVMContextRef
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition: Types.h:53
llvm::StringMapEntry< uint32_t >
llvm::remarks::RemarkStreamer
Definition: RemarkStreamer.h:42
llvm::LLVMContext::getOperandBundleTagID
uint32_t getOperandBundleTagID(StringRef Tag) const
getOperandBundleTagID - Maps a bundle tag to an integer ID.
Definition: LLVMContext.cpp:286
llvm::Function
Definition: Function.h:62
llvm::LLVMContext::getDiagnosticContext
void * getDiagnosticContext() const
getDiagnosticContext - Return the diagnostic context set by setDiagnosticContext.
Definition: LLVMContext.cpp:174
llvm::LLVMContext::setLLVMRemarkStreamer
void setLLVMRemarkStreamer(std::unique_ptr< LLVMRemarkStreamer > RemarkStreamer)
Definition: LLVMContext.cpp:164
Types.h
llvm::LLVMContext::OB_clang_arc_attachedcall
@ OB_clang_arc_attachedcall
Definition: LLVMContext.h:96
llvm::LLVMContext::getMainRemarkStreamer
remarks::RemarkStreamer * getMainRemarkStreamer()
The "main remark streamer" used by all the specialized remark streamers.
Definition: LLVMContext.cpp:147
llvm::DiagnosticHandler
This is the base class for diagnostic handling in LLVM.
Definition: DiagnosticHandler.h:24
llvm::DiagnosticHandler::DiagnosticHandlerTy
void(*)(const DiagnosticInfo &DI, void *Context) DiagnosticHandlerTy
Definition: DiagnosticHandler.h:30
llvm::Optional< uint64_t >
llvm::LLVMContext::getSyncScopeNames
void getSyncScopeNames(SmallVectorImpl< StringRef > &SSNs) const
getSyncScopeNames - Populates client supplied SmallVector with synchronization scope names registered...
Definition: LLVMContext.cpp:294
CBindingWrapping.h
llvm::LLVMContext::~LLVMContext
~LLVMContext()
Definition: LLVMContext.cpp:100
llvm::LLVMContext::getDiagnosticsHotnessThreshold
uint64_t getDiagnosticsHotnessThreshold() const
Return the minimum hotness value a diagnostic would need in order to be included in optimization diag...
Definition: LLVMContext.cpp:139
llvm::LLVMContext::LLVMContext
LLVMContext()
Definition: LLVMContext.cpp:36
DEFINE_SIMPLE_CONVERSION_FUNCTIONS
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
Definition: CBindingWrapping.h:19
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::LLVMContext::supportsTypedPointers
bool supportsTypedPointers() const
Whether typed pointers are supported. If false, all pointers are opaque.
Definition: LLVMContext.cpp:357
llvm::LLVMRemarkStreamer
Streamer for LLVM remarks which has logic for dealing with DiagnosticInfo objects.
Definition: LLVMRemarkStreamer.h:27
llvm::LLVMContext::OB_gc_transition
@ OB_gc_transition
Definition: LLVMContext.h:92
llvm::LLVMContextImpl
Definition: LLVMContextImpl.h:1341
llvm::LLVMContext::getDiagnosticHandlerCallBack
DiagnosticHandler::DiagnosticHandlerTy getDiagnosticHandlerCallBack() const
getDiagnosticHandlerCallBack - Return the diagnostic handler call back set by setDiagnosticHandlerCal...
Definition: LLVMContext.cpp:170
llvm::LLVMContext::yield
void yield()
Calls the yield callback (if applicable).
Definition: LLVMContext.cpp:184
llvm::OptPassGate
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
Definition: OptBisect.h:27
llvm::LLVMContext::OB_funclet
@ OB_funclet
Definition: LLVMContext.h:91
remarks
annotation remarks
Definition: AnnotationRemarks.cpp:117
llvm::LLVMContext::isODRUniquingDebugTypes
bool isODRUniquingDebugTypes() const
Whether there is a string map for uniquing debug info identifiers across the context.
Definition: LLVMContext.cpp:320
llvm::LLVMContext::disableDebugTypeODRUniquing
void disableDebugTypeODRUniquing()
Definition: LLVMContext.cpp:329
llvm::Instruction
Definition: Instruction.h:45
llvm::DiagnosticSeverity
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
Definition: DiagnosticInfo.h:45
llvm::LLVMContext::OB_cfguardtarget
@ OB_cfguardtarget
Definition: LLVMContext.h:93
llvm::LLVMContext::getGC
const std::string & getGC(const Function &Fn)
Return the GC for a function.
Definition: LLVMContext.cpp:308
DiagnosticHandler.h
llvm::unwrap
Attribute unwrap(LLVMAttributeRef Attr)
Definition: Attributes.h:257
llvm::LLVMContext::OB_gc_live
@ OB_gc_live
Definition: LLVMContext.h:95
llvm::DiagnosticInfo
This is the base abstract class for diagnostic reporting in the backend.
Definition: DiagnosticInfo.h:103
llvm::LLVMContext::setDiagnosticHandler
void setDiagnosticHandler(std::unique_ptr< DiagnosticHandler > &&DH, bool RespectFilters=false)
setDiagnosticHandler - This method sets unique_ptr to object of DiagnosticHandler to provide custom d...
Definition: LLVMContext.cpp:122
llvm::LLVMContext::getOrInsertSyncScopeID
SyncScope::ID getOrInsertSyncScopeID(StringRef SSN)
getOrInsertSyncScopeID - Maps synchronization scope name to synchronization scope ID.
Definition: LLVMContext.cpp:290
llvm::LLVMContext::getOptPassGate
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time.
Definition: LLVMContext.cpp:335
llvm::LLVMContext::getDiagHandlerPtr
const DiagnosticHandler * getDiagHandlerPtr() const
getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler.
Definition: LLVMContext.cpp:343
llvm::LLVMContext::YieldCallbackTy
void(*)(LLVMContext *Context, void *OpaqueHandle) YieldCallbackTy
Defines the type of a yield callback.
Definition: LLVMContext.h:158
llvm::LLVMContext::getDiagnosticHandler
std::unique_ptr< DiagnosticHandler > getDiagnosticHandler()
getDiagnosticHandler - transfers ownership of DiagnosticHandler unique_ptr to caller.
Definition: LLVMContext.cpp:347
uint64_t
llvm::LLVMContext::shouldDiscardValueNames
bool shouldDiscardValueNames() const
Return true if the Context runtime configuration is set to discard all value names.
Definition: LLVMContext.cpp:316
llvm::LLVMContext::enableOpaquePointers
void enableOpaquePointers() const
Enable opaque pointers.
Definition: LLVMContext.cpp:351
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::SyncScope::ID
uint8_t ID
Definition: LLVMContext.h:47
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::LLVMContext::setGC
void setGC(const Function &Fn, std::string GCName)
Define the GC for a function.
Definition: LLVMContext.cpp:298
llvm::LLVMContext::setYieldCallback
void setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle)
Registers a yield callback with the given context.
Definition: LLVMContext.cpp:178
inline
into xmm2 addss xmm2 xmm1 xmm3 addss xmm3 movaps xmm0 unpcklps xmm0 ret seems silly when it could just be one addps Expand libm rounding functions inline
Definition: README-SSE.txt:72
llvm::LLVMContext::setDiagnosticsHotnessRequested
void setDiagnosticsHotnessRequested(bool Requested)
Set if a code hotness metric should be included in optimization diagnostics.
Definition: LLVMContext.cpp:128
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::LLVMContext::setMainRemarkStreamer
void setMainRemarkStreamer(std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer)
Definition: LLVMContext.cpp:153
llvm::wrap
LLVMAttributeRef wrap(Attribute Attr)
Definition: Attributes.h:252
llvm::ReplayInlineScope::Function
@ Function
DiagHandler
static void DiagHandler(const SMDiagnostic &Diag, void *Context)
Definition: TextStub.cpp:1095
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
uint32_t
llvm::LLVMContext::isDiagnosticsHotnessThresholdSetFromPSI
bool isDiagnosticsHotnessThresholdSetFromPSI() const
Return if hotness threshold is requested from PSI.
Definition: LLVMContext.cpp:143
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
llvm::LLVMContext::getLLVMRemarkStreamer
LLVMRemarkStreamer * getLLVMRemarkStreamer()
The "LLVM remark streamer" used by LLVM to serialize remark diagnostics comming from IR and MIR passe...
Definition: LLVMContext.cpp:158
llvm::LLVMContext::getDiagnosticMessagePrefix
static const char * getDiagnosticMessagePrefix(DiagnosticSeverity Severity)
Get the prefix that should be printed in front of a diagnostic of the given Severity.
Definition: LLVMContext.cpp:214
llvm::LLVMContext::diagnose
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
Definition: LLVMContext.cpp:228
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
llvm::LLVMContext::getMDKindNames
void getMDKindNames(SmallVectorImpl< StringRef > &Result) const
getMDKindNames - Populate client supplied SmallVector with the name for custom metadata IDs registere...
Definition: LLVMContext.cpp:270
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::SyncScope::SingleThread
@ SingleThread
Synchronized with respect to signal handlers executing in the same thread.
Definition: LLVMContext.h:55
llvm::LLVMContext::OB_deopt
@ OB_deopt
Definition: LLVMContext.h:90
llvm::LLVMContext::setOptPassGate
void setOptPassGate(OptPassGate &)
Set the object which can disable optional passes and individual optimizations at compile time.
Definition: LLVMContext.cpp:339
llvm::LLVMContext::setDiscardValueNames
void setDiscardValueNames(bool Discard)
Set the Context runtime configuration to discard all value name (but GlobalValue).
Definition: LLVMContext.cpp:331
llvm::LLVMContext::getDiagnosticsHotnessRequested
bool getDiagnosticsHotnessRequested() const
Return if a code hotness metric should be included in optimization diagnostics.
Definition: LLVMContext.cpp:131
llvm::LLVMContext::getOperandBundleTags
void getOperandBundleTags(SmallVectorImpl< StringRef > &Result) const
getOperandBundleTags - Populate client supplied SmallVector with the bundle tags registered in this L...
Definition: LLVMContext.cpp:277
llvm::LLVMContext::deleteGC
void deleteGC(const Function &Fn)
Remove the GC for a function.
Definition: LLVMContext.cpp:312
llvm::LLVMContext::setDiagnosticHandlerCallBack
void setDiagnosticHandlerCallBack(DiagnosticHandler::DiagnosticHandlerTy DiagHandler, void *DiagContext=nullptr, bool RespectFilters=false)
setDiagnosticHandlerCallBack - This method sets a handler call back that is invoked when the backend ...
Definition: LLVMContext.cpp:114
llvm::LLVMContext::OB_preallocated
@ OB_preallocated
Definition: LLVMContext.h:94
Threshold
static cl::opt< unsigned > Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"), cl::init(100), cl::Hidden)
llvm::SmallVectorImpl< StringRef >
llvm::LLVMContext::getMDKindID
unsigned getMDKindID(StringRef Name) const
getMDKindID - Return a unique non-zero ID for the specified metadata kind.
Definition: LLVMContext.cpp:260
llvm::LLVMContext::getOrInsertBundleTag
StringMapEntry< uint32_t > * getOrInsertBundleTag(StringRef TagName) const
getOrInsertBundleTag - Returns the Tag to use for an operand bundle of name TagName.
Definition: LLVMContext.cpp:282
llvm::LLVMContext::operator=
LLVMContext & operator=(const LLVMContext &)=delete
llvm::SyncScope::System
@ System
Synchronized with respect to all concurrently executing threads.
Definition: LLVMContext.h:58