LLVM  16.0.0git
LLVMContext.cpp
Go to the documentation of this file.
1 //===-- LLVMContext.cpp - Implement LLVMContext ---------------------------===//
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 implements LLVMContext, as a wrapper around the opaque
10 // class LLVMContextImpl.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "llvm/IR/LLVMContext.h"
15 #include "LLVMContextImpl.h"
16 #include "llvm/ADT/SmallVector.h"
17 #include "llvm/ADT/StringMap.h"
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/ADT/Twine.h"
20 #include "llvm/IR/DiagnosticInfo.h"
24 #include "llvm/Support/Casting.h"
27 #include <cassert>
28 #include <cstdlib>
29 #include <string>
30 #include <utility>
31 
32 using namespace llvm;
33 
35  // Create the fixed metadata kinds. This is done in the same order as the
36  // MD_* enum values so that they correspond.
37  std::pair<unsigned, StringRef> MDKinds[] = {
38 #define LLVM_FIXED_MD_KIND(EnumID, Name, Value) {EnumID, Name},
39 #include "llvm/IR/FixedMetadataKinds.def"
40 #undef LLVM_FIXED_MD_KIND
41  };
42 
43  for (auto &MDKind : MDKinds) {
44  unsigned ID = getMDKindID(MDKind.second);
45  assert(ID == MDKind.first && "metadata kind id drifted");
46  (void)ID;
47  }
48 
49  auto *DeoptEntry = pImpl->getOrInsertBundleTag("deopt");
50  assert(DeoptEntry->second == LLVMContext::OB_deopt &&
51  "deopt operand bundle id drifted!");
52  (void)DeoptEntry;
53 
54  auto *FuncletEntry = pImpl->getOrInsertBundleTag("funclet");
55  assert(FuncletEntry->second == LLVMContext::OB_funclet &&
56  "funclet operand bundle id drifted!");
57  (void)FuncletEntry;
58 
59  auto *GCTransitionEntry = pImpl->getOrInsertBundleTag("gc-transition");
60  assert(GCTransitionEntry->second == LLVMContext::OB_gc_transition &&
61  "gc-transition operand bundle id drifted!");
62  (void)GCTransitionEntry;
63 
64  auto *CFGuardTargetEntry = pImpl->getOrInsertBundleTag("cfguardtarget");
65  assert(CFGuardTargetEntry->second == LLVMContext::OB_cfguardtarget &&
66  "cfguardtarget operand bundle id drifted!");
67  (void)CFGuardTargetEntry;
68 
69  auto *PreallocatedEntry = pImpl->getOrInsertBundleTag("preallocated");
70  assert(PreallocatedEntry->second == LLVMContext::OB_preallocated &&
71  "preallocated operand bundle id drifted!");
72  (void)PreallocatedEntry;
73 
74  auto *GCLiveEntry = pImpl->getOrInsertBundleTag("gc-live");
75  assert(GCLiveEntry->second == LLVMContext::OB_gc_live &&
76  "gc-transition operand bundle id drifted!");
77  (void)GCLiveEntry;
78 
79  auto *ClangAttachedCall =
80  pImpl->getOrInsertBundleTag("clang.arc.attachedcall");
81  assert(ClangAttachedCall->second == LLVMContext::OB_clang_arc_attachedcall &&
82  "clang.arc.attachedcall operand bundle id drifted!");
83  (void)ClangAttachedCall;
84 
85  auto *PtrauthEntry = pImpl->getOrInsertBundleTag("ptrauth");
86  assert(PtrauthEntry->second == LLVMContext::OB_ptrauth &&
87  "ptrauth operand bundle id drifted!");
88  (void)PtrauthEntry;
89 
90  auto *KCFIEntry = pImpl->getOrInsertBundleTag("kcfi");
91  assert(KCFIEntry->second == LLVMContext::OB_kcfi &&
92  "kcfi operand bundle id drifted!");
93  (void)KCFIEntry;
94 
95  SyncScope::ID SingleThreadSSID =
96  pImpl->getOrInsertSyncScopeID("singlethread");
97  assert(SingleThreadSSID == SyncScope::SingleThread &&
98  "singlethread synchronization scope ID drifted!");
99  (void)SingleThreadSSID;
100 
101  SyncScope::ID SystemSSID =
103  assert(SystemSSID == SyncScope::System &&
104  "system synchronization scope ID drifted!");
105  (void)SystemSSID;
106 }
107 
109 
110 void LLVMContext::addModule(Module *M) {
112 }
113 
114 void LLVMContext::removeModule(Module *M) {
116 }
117 
118 //===----------------------------------------------------------------------===//
119 // Recoverable Backend Errors
120 //===----------------------------------------------------------------------===//
121 
124  void *DiagnosticContext, bool RespectFilters) {
125  pImpl->DiagHandler->DiagHandlerCallback = DiagnosticHandler;
126  pImpl->DiagHandler->DiagnosticContext = DiagnosticContext;
127  pImpl->RespectDiagnosticFilters = RespectFilters;
128 }
129 
130 void LLVMContext::setDiagnosticHandler(std::unique_ptr<DiagnosticHandler> &&DH,
131  bool RespectFilters) {
132  pImpl->DiagHandler = std::move(DH);
133  pImpl->RespectDiagnosticFilters = RespectFilters;
134 }
135 
137  pImpl->DiagnosticsHotnessRequested = Requested;
138 }
141 }
142 
144  pImpl->DiagnosticsHotnessThreshold = Threshold;
145 }
147  pImpl->MisExpectWarningRequested = Requested;
148 }
151 }
154 }
156  Optional<uint32_t> Tolerance) {
158 }
161 }
162 
165 }
166 
168  return pImpl->MainRemarkStreamer.get();
169 }
171  return const_cast<LLVMContext *>(this)->getMainRemarkStreamer();
172 }
174  std::unique_ptr<remarks::RemarkStreamer> RemarkStreamer) {
175  pImpl->MainRemarkStreamer = std::move(RemarkStreamer);
176 }
177 
179  return pImpl->LLVMRS.get();
180 }
182  return const_cast<LLVMContext *>(this)->getLLVMRemarkStreamer();
183 }
185  std::unique_ptr<LLVMRemarkStreamer> RemarkStreamer) {
186  pImpl->LLVMRS = std::move(RemarkStreamer);
187 }
188 
191  return pImpl->DiagHandler->DiagHandlerCallback;
192 }
193 
195  return pImpl->DiagHandler->DiagnosticContext;
196 }
197 
198 void LLVMContext::setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle)
199 {
200  pImpl->YieldCallback = Callback;
201  pImpl->YieldOpaqueHandle = OpaqueHandle;
202 }
203 
205  if (pImpl->YieldCallback)
207 }
208 
209 void LLVMContext::emitError(const Twine &ErrorStr) {
211 }
212 
213 void LLVMContext::emitError(const Instruction *I, const Twine &ErrorStr) {
214  assert (I && "Invalid instruction");
215  diagnose(DiagnosticInfoInlineAsm(*I, ErrorStr));
216 }
217 
218 static bool isDiagnosticEnabled(const DiagnosticInfo &DI) {
219  // Optimization remarks are selective. They need to check whether the regexp
220  // pattern, passed via one of the -pass-remarks* flags, matches the name of
221  // the pass that is emitting the diagnostic. If there is no match, ignore the
222  // diagnostic and return.
223  //
224  // Also noisy remarks are only enabled if we have hotness information to sort
225  // them.
226  if (auto *Remark = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
227  return Remark->isEnabled() &&
228  (!Remark->isVerbose() || Remark->getHotness());
229 
230  return true;
231 }
232 
233 const char *
235  switch (Severity) {
236  case DS_Error:
237  return "error";
238  case DS_Warning:
239  return "warning";
240  case DS_Remark:
241  return "remark";
242  case DS_Note:
243  return "note";
244  }
245  llvm_unreachable("Unknown DiagnosticSeverity");
246 }
247 
249  if (auto *OptDiagBase = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
251  RS->emit(*OptDiagBase);
252 
253  // If there is a report handler, use it.
254  if (pImpl->DiagHandler &&
256  pImpl->DiagHandler->handleDiagnostics(DI))
257  return;
258 
259  if (!isDiagnosticEnabled(DI))
260  return;
261 
262  // Otherwise, print the message with a prefix based on the severity.
264  errs() << getDiagnosticMessagePrefix(DI.getSeverity()) << ": ";
265  DI.print(DP);
266  errs() << "\n";
267  if (DI.getSeverity() == DS_Error)
268  exit(1);
269 }
270 
271 void LLVMContext::emitError(uint64_t LocCookie, const Twine &ErrorStr) {
272  diagnose(DiagnosticInfoInlineAsm(LocCookie, ErrorStr));
273 }
274 
275 //===----------------------------------------------------------------------===//
276 // Metadata Kind Uniquing
277 //===----------------------------------------------------------------------===//
278 
279 /// Return a unique non-zero ID for the specified metadata kind.
281  // If this is new, assign it its ID.
283  std::make_pair(
285  .first->second;
286 }
287 
288 /// getHandlerNames - Populate client-supplied smallvector using custom
289 /// metadata name and ID.
293  E = pImpl->CustomMDKindNames.end(); I != E; ++I)
294  Names[I->second] = I->first();
295 }
296 
299 }
300 
303  return pImpl->getOrInsertBundleTag(TagName);
304 }
305 
308 }
309 
311  return pImpl->getOrInsertSyncScopeID(SSN);
312 }
313 
315  pImpl->getSyncScopeNames(SSNs);
316 }
317 
318 void LLVMContext::setGC(const Function &Fn, std::string GCName) {
319  auto It = pImpl->GCNames.find(&Fn);
320 
321  if (It == pImpl->GCNames.end()) {
322  pImpl->GCNames.insert(std::make_pair(&Fn, std::move(GCName)));
323  return;
324  }
325  It->second = std::move(GCName);
326 }
327 
328 const std::string &LLVMContext::getGC(const Function &Fn) {
329  return pImpl->GCNames[&Fn];
330 }
331 
333  pImpl->GCNames.erase(&Fn);
334 }
335 
337  return pImpl->DiscardValueNames;
338 }
339 
341 
343  if (pImpl->DITypeMap)
344  return;
345 
346  pImpl->DITypeMap.emplace();
347 }
348 
350 
352  pImpl->DiscardValueNames = Discard;
353 }
354 
356  return pImpl->getOptPassGate();
357 }
358 
360  pImpl->setOptPassGate(OPG);
361 }
362 
364  return pImpl->DiagHandler.get();
365 }
366 
367 std::unique_ptr<DiagnosticHandler> LLVMContext::getDiagnosticHandler() {
368  return std::move(pImpl->DiagHandler);
369 }
370 
372  return pImpl->hasOpaquePointersValue();
373 }
374 
375 void LLVMContext::setOpaquePointers(bool Enable) const {
377 }
378 
380  return !pImpl->getOpaquePointers();
381 }
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:143
llvm::LLVMContext::pImpl
LLVMContextImpl *const pImpl
Definition: LLVMContext.h:69
llvm::LLVMContext::enableDebugTypeODRUniquing
void enableDebugTypeODRUniquing()
Definition: LLVMContext.cpp:342
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
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:271
llvm::StringMapEntry< uint32_t >
llvm::SmallPtrSetImpl::erase
bool erase(PtrType Ptr)
erase - If the set contains the specified pointer, remove it and return true, otherwise return false.
Definition: SmallPtrSet.h:379
llvm::LLVMContext::getMisExpectWarningRequested
bool getMisExpectWarningRequested() const
Definition: LLVMContext.cpp:149
llvm::remarks::RemarkStreamer
Definition: RemarkStreamer.h:44
llvm::LLVMContext::getOperandBundleTagID
uint32_t getOperandBundleTagID(StringRef Tag) const
getOperandBundleTagID - Maps a bundle tag to an integer ID.
Definition: LLVMContext.cpp:306
llvm::LLVMContext::setMisExpectWarningRequested
void setMisExpectWarningRequested(bool Requested)
Definition: LLVMContext.cpp:146
llvm::LLVMContextImpl::DiscardValueNames
bool DiscardValueNames
Flag to indicate if Value (other than GlobalValue) retains their name or not.
Definition: LLVMContextImpl.h:1549
llvm::Function
Definition: Function.h:60
StringRef.h
llvm::DiagnosticPrinterRawOStream
Basic diagnostic printer that uses an underlying raw_ostream.
Definition: DiagnosticPrinter.h:61
llvm::LLVMContext::getDiagnosticContext
void * getDiagnosticContext() const
getDiagnosticContext - Return the diagnostic context set by setDiagnosticContext.
Definition: LLVMContext.cpp:194
llvm::LLVMContext::setLLVMRemarkStreamer
void setLLVMRemarkStreamer(std::unique_ptr< LLVMRemarkStreamer > RemarkStreamer)
Definition: LLVMContext.cpp:184
ErrorHandling.h
llvm::SyncScope::System
@ System
Synchronized with respect to all concurrently executing threads.
Definition: LLVMContext.h:57
llvm::LLVMContextImpl::setOptPassGate
void setOptPassGate(OptPassGate &)
Set the object which can disable optional passes and individual optimizations at compile time.
Definition: LLVMContextImpl.cpp:247
llvm::DiagnosticInfo::print
virtual void print(DiagnosticPrinter &DP) const =0
Print using the given DP a user-friendly message.
llvm::LLVMContext::getMainRemarkStreamer
remarks::RemarkStreamer * getMainRemarkStreamer()
The "main remark streamer" used by all the specialized remark streamers.
Definition: LLVMContext.cpp:167
llvm::StringMap::end
iterator end()
Definition: StringMap.h:204
llvm::LLVMContextImpl::MainRemarkStreamer
std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer
The main remark streamer used by all the other streamers (e.g.
Definition: LLVMContextImpl.h:1364
llvm::LLVMContext::hasSetOpaquePointersValue
bool hasSetOpaquePointersValue() const
Whether we've decided on using opaque pointers or typed pointers yet.
Definition: LLVMContext.cpp:371
llvm::DiagnosticHandler
This is the base class for diagnostic handling in LLVM.
Definition: DiagnosticHandler.h:24
llvm::LLVMContextImpl::DiagnosticsHotnessRequested
bool DiagnosticsHotnessRequested
Definition: LLVMContextImpl.h:1368
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:314
llvm::LLVMContext::~LLVMContext
~LLVMContext()
Definition: LLVMContext.cpp:108
llvm::errs
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Definition: raw_ostream.cpp:891
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:152
llvm::LLVMContext::setOpaquePointers
void setOpaquePointers(bool Enable) const
Set whether opaque pointers are enabled.
Definition: LLVMContext.cpp:375
llvm::LLVMContext::LLVMContext
LLVMContext()
Definition: LLVMContext.cpp:34
llvm::dwarf::Tag
Tag
Definition: Dwarf.h:105
isDiagnosticEnabled
static bool isDiagnosticEnabled(const DiagnosticInfo &DI)
Definition: LLVMContext.cpp:218
new
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM ID Predecessors according to mbb< bb27, 0x8b0a7c0 > Note ADDri is not a two address instruction its result reg1037 is an operand of the PHI node in bb76 and its operand reg1039 is the result of the PHI node We should treat it as a two address code and make sure the ADDri is scheduled after any node that reads reg1039 Use info(i.e. register scavenger) to assign it a free register to allow reuse the collector could move the objects and invalidate the derived pointer This is bad enough in the first but safe points can crop up unpredictably **array_addr i32 n y store obj * new
Definition: README.txt:125
llvm::LLVMContextImpl::getSyncScopeNames
void getSyncScopeNames(SmallVectorImpl< StringRef > &SSNs) const
getSyncScopeNames - Populates client supplied SmallVector with synchronization scope names registered...
Definition: LLVMContextImpl.cpp:232
llvm::LLVMContextImpl::DiagnosticsMisExpectTolerance
Optional< uint32_t > DiagnosticsMisExpectTolerance
The percentage of difference between profiling branch weights and llvm.expect branch weights to toler...
Definition: LLVMContextImpl.h:1391
llvm::LLVMContext::supportsTypedPointers
bool supportsTypedPointers() const
Whether typed pointers are supported. If false, all pointers are opaque.
Definition: LLVMContext.cpp:379
llvm::LLVMRemarkStreamer
Streamer for LLVM remarks which has logic for dealing with DiagnosticInfo objects.
Definition: LLVMRemarkStreamer.h:33
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::LLVMContextImpl::getOperandBundleTagID
uint32_t getOperandBundleTagID(StringRef Tag) const
Definition: LLVMContextImpl.cpp:219
llvm::DS_Warning
@ DS_Warning
Definition: DiagnosticInfo.h:51
llvm::LLVMContextImpl
Definition: LLVMContextImpl.h:1355
Twine.h
llvm::LLVMContext::OB_preallocated
@ OB_preallocated
Definition: LLVMContext.h:93
llvm::StringMap::insert
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
Definition: StringMap.h:275
llvm::LLVMContext::getDiagnosticHandlerCallBack
DiagnosticHandler::DiagnosticHandlerTy getDiagnosticHandlerCallBack() const
getDiagnosticHandlerCallBack - Return the diagnostic handler call back set by setDiagnosticHandlerCal...
Definition: LLVMContext.cpp:190
llvm::LLVMContext::yield
void yield()
Calls the yield callback (if applicable).
Definition: LLVMContext.cpp:204
llvm::OptPassGate
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
Definition: OptBisect.h:26
llvm::SyncScope::SingleThread
@ SingleThread
Synchronized with respect to signal handlers executing in the same thread.
Definition: LLVMContext.h:54
llvm::LLVMContextImpl::getOrInsertBundleTag
StringMapEntry< uint32_t > * getOrInsertBundleTag(StringRef Tag)
Definition: LLVMContextImpl.cpp:208
UINT64_MAX
#define UINT64_MAX
Definition: DataTypes.h:77
llvm::LLVMContext::isODRUniquingDebugTypes
bool isODRUniquingDebugTypes() const
Whether there is a string map for uniquing debug info identifiers across the context.
Definition: LLVMContext.cpp:340
llvm::LLVMContext::disableDebugTypeODRUniquing
void disableDebugTypeODRUniquing()
Definition: LLVMContext.cpp:349
llvm::Instruction
Definition: Instruction.h:42
llvm::DiagnosticSeverity
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
Definition: DiagnosticInfo.h:49
LLVMContextImpl.h
llvm::LLVMContext::getGC
const std::string & getGC(const Function &Fn)
Return the GC for a function.
Definition: LLVMContext.cpp:328
llvm::LLVMContextImpl::OwnedModules
SmallPtrSet< Module *, 4 > OwnedModules
OwnedModules - The set of modules instantiated in this context, and which will be automatically delet...
Definition: LLVMContextImpl.h:1359
llvm::SmallVectorImpl::resize
void resize(size_type N)
Definition: SmallVector.h:624
llvm::DiagnosticInfo::getSeverity
DiagnosticSeverity getSeverity() const
Definition: DiagnosticInfo.h:123
llvm::DiagnosticInfo
This is the base abstract class for diagnostic reporting in the backend.
Definition: DiagnosticInfo.h:108
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:130
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
llvm::LLVMContext::getOrInsertSyncScopeID
SyncScope::ID getOrInsertSyncScopeID(StringRef SSN)
getOrInsertSyncScopeID - Maps synchronization scope name to synchronization scope ID.
Definition: LLVMContext.cpp:310
llvm::LLVMContext::getOptPassGate
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time.
Definition: LLVMContext.cpp:355
llvm::LLVMContextImpl::RespectDiagnosticFilters
bool RespectDiagnosticFilters
Definition: LLVMContextImpl.h:1367
llvm::StringMap
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:110
llvm::DiagnosticInfoInlineAsm
Diagnostic information for inline asm reporting.
Definition: DiagnosticInfo.h:138
llvm::LLVMContext::getDiagHandlerPtr
const DiagnosticHandler * getDiagHandlerPtr() const
getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler.
Definition: LLVMContext.cpp:363
llvm::HighlightColor::Remark
@ Remark
llvm::LLVMContext::getDiagnosticsMisExpectTolerance
uint32_t getDiagnosticsMisExpectTolerance() const
Definition: LLVMContext.cpp:159
llvm::LLVMContext::YieldCallbackTy
void(*)(LLVMContext *Context, void *OpaqueHandle) YieldCallbackTy
Defines the type of a yield callback.
Definition: LLVMContext.h:159
llvm::LLVMContextImpl::setOpaquePointers
void setOpaquePointers(bool OP)
Definition: LLVMContextImpl.cpp:261
llvm::LLVMContext::getDiagnosticHandler
std::unique_ptr< DiagnosticHandler > getDiagnosticHandler()
getDiagnosticHandler - transfers ownership of DiagnosticHandler unique_ptr to caller.
Definition: LLVMContext.cpp:367
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:336
llvm::LLVMContext::setDiagnosticsMisExpectTolerance
void setDiagnosticsMisExpectTolerance(Optional< uint32_t > Tolerance)
Definition: LLVMContext.cpp:155
llvm::DS_Remark
@ DS_Remark
Definition: DiagnosticInfo.h:52
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:67
llvm::SyncScope::ID
uint8_t ID
Definition: LLVMContext.h:46
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::LLVMContextImpl::getOperandBundleTags
void getOperandBundleTags(SmallVectorImpl< StringRef > &Tags) const
Definition: LLVMContextImpl.cpp:213
llvm::LLVMContext::setGC
void setGC(const Function &Fn, std::string GCName)
Define the GC for a function.
Definition: LLVMContext.cpp:318
llvm::LLVMContext::setYieldCallback
void setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle)
Registers a yield callback with the given context.
Definition: LLVMContext.cpp:198
Enable
@ Enable
Definition: DwarfDebug.cpp:85
llvm::StringMap::begin
iterator begin()
Definition: StringMap.h:203
llvm::LLVMContextImpl::hasOpaquePointersValue
bool hasOpaquePointersValue()
Definition: LLVMContextImpl.cpp:251
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::LLVMContextImpl::DiagHandler
std::unique_ptr< DiagnosticHandler > DiagHandler
Definition: LLVMContextImpl.h:1366
llvm::LLVMContext::setDiagnosticsHotnessRequested
void setDiagnosticsHotnessRequested(bool Requested)
Set if a code hotness metric should be included in optimization diagnostics.
Definition: LLVMContext.cpp:136
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::LLVMContextImpl::YieldCallback
LLVMContext::YieldCallbackTy YieldCallback
Definition: LLVMContextImpl.h:1397
llvm::StringMapImpl::size
unsigned size() const
Definition: StringMap.h:95
llvm::LLVMContext::setMainRemarkStreamer
void setMainRemarkStreamer(std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer)
Definition: LLVMContext.cpp:173
llvm::LLVMContextImpl::GCNames
DenseMap< const Function *, std::string > GCNames
Maintain the GC name for each function.
Definition: LLVMContextImpl.h:1545
llvm::LLVMContextImpl::getOptPassGate
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time.
Definition: LLVMContextImpl.cpp:241
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
this
Analysis the ScalarEvolution expression for r is this
Definition: README.txt:8
llvm::LLVMContextImpl::getOpaquePointers
bool getOpaquePointers()
Definition: LLVMContextImpl.cpp:255
DP
So we should use XX3Form_Rcr to implement intrinsic Convert DP outs ins xscvdpsp No builtin are required Round &Convert QP DP(dword[1] is set to zero) No builtin are required Round to Quad Precision because you need to assign rounding mode in instruction Provide builtin(set f128:$vT,(int_ppc_vsx_xsrqpi f128:$vB))(set f128 yields< n x< ty > >< result > yields< ty >< result > No builtin are required Load Store load store see def memrix16 in PPCInstrInfo td Load Store Vector load store outs ins lxsdx set load store with conversion from to DP
Definition: README_P9.txt:520
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
uint32_t
llvm::LLVMContextImpl::getOrInsertSyncScopeID
SyncScope::ID getOrInsertSyncScopeID(StringRef SSN)
getOrInsertSyncScopeID - Maps synchronization scope name to synchronization scope ID.
Definition: LLVMContextImpl.cpp:225
llvm::LLVMContext::isDiagnosticsHotnessThresholdSetFromPSI
bool isDiagnosticsHotnessThresholdSetFromPSI() const
Return if hotness threshold is requested from PSI.
Definition: LLVMContext.cpp:163
llvm::Optional::has_value
constexpr bool has_value() const
Definition: Optional.h:324
llvm::LLVMContext::OB_kcfi
@ OB_kcfi
Definition: LLVMContext.h:97
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:178
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:234
llvm::LLVMContext::diagnose
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
Definition: LLVMContext.cpp:248
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
llvm::LLVMContextImpl::CustomMDKindNames
StringMap< unsigned > CustomMDKindNames
CustomMDKindNames - Map to hold the metadata string to ID mapping.
Definition: LLVMContextImpl.h:1497
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:290
llvm::LLVMContextImpl::MisExpectWarningRequested
bool MisExpectWarningRequested
Definition: LLVMContextImpl.h:1392
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
LLVMRemarkStreamer.h
llvm::LLVMContext::OB_deopt
@ OB_deopt
Definition: LLVMContext.h:89
llvm::LLVMContext::OB_gc_transition
@ OB_gc_transition
Definition: LLVMContext.h:91
RemarkStreamer.h
Casting.h
DiagnosticInfo.h
llvm::LLVMContext::setOptPassGate
void setOptPassGate(OptPassGate &)
Set the object which can disable optional passes and individual optimizations at compile time.
Definition: LLVMContext.cpp:359
llvm::LLVMContext::setDiscardValueNames
void setDiscardValueNames(bool Discard)
Set the Context runtime configuration to discard all value name (but GlobalValue).
Definition: LLVMContext.cpp:351
llvm::LLVMContextImpl::DiagnosticsHotnessThreshold
Optional< uint64_t > DiagnosticsHotnessThreshold
The minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.
Definition: LLVMContextImpl.h:1387
llvm::LLVMContext::getDiagnosticsHotnessRequested
bool getDiagnosticsHotnessRequested() const
Return if a code hotness metric should be included in optimization diagnostics.
Definition: LLVMContext.cpp:139
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:297
llvm::LLVMContext::deleteGC
void deleteGC(const Function &Fn)
Remove the GC for a function.
Definition: LLVMContext.cpp:332
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:122
llvm::LLVMContext::OB_ptrauth
@ OB_ptrauth
Definition: LLVMContext.h:96
SmallVector.h
exit
declare void exit(i32) noreturn nounwind This compiles into
Definition: README.txt:1072
llvm::LLVMContext::OB_gc_live
@ OB_gc_live
Definition: LLVMContext.h:94
llvm::LLVMContextImpl::DITypeMap
Optional< DenseMap< const MDString *, DICompositeType * > > DITypeMap
Definition: LLVMContextImpl.h:1423
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:280
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:302
llvm::LLVMContext::OB_clang_arc_attachedcall
@ OB_clang_arc_attachedcall
Definition: LLVMContext.h:95
llvm::LLVMContextImpl::YieldOpaqueHandle
void * YieldOpaqueHandle
Definition: LLVMContextImpl.h:1398
StringMap.h
LLVMContext.h
llvm::LLVMContext::OB_cfguardtarget
@ OB_cfguardtarget
Definition: LLVMContext.h:92
raw_ostream.h
llvm::LLVMContextImpl::LLVMRS
std::unique_ptr< LLVMRemarkStreamer > LLVMRS
The specialized remark streamer used by LLVM's OptimizationRemarkEmitter.
Definition: LLVMContextImpl.h:1395
llvm::LLVMContext::OB_funclet
@ OB_funclet
Definition: LLVMContext.h:90
DiagnosticPrinter.h
llvm::Optional::value_or
constexpr T value_or(U &&alt) const &
Definition: Optional.h:334
llvm::DS_Error
@ DS_Error
Definition: DiagnosticInfo.h:50
llvm::SmallPtrSetImpl::insert
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Definition: SmallPtrSet.h:365
llvm::DS_Note
@ DS_Note
Definition: DiagnosticInfo.h:55