LLVM  15.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  SyncScope::ID SingleThreadSSID =
91  pImpl->getOrInsertSyncScopeID("singlethread");
92  assert(SingleThreadSSID == SyncScope::SingleThread &&
93  "singlethread synchronization scope ID drifted!");
94  (void)SingleThreadSSID;
95 
96  SyncScope::ID SystemSSID =
98  assert(SystemSSID == SyncScope::System &&
99  "system synchronization scope ID drifted!");
100  (void)SystemSSID;
101 }
102 
104 
105 void LLVMContext::addModule(Module *M) {
107 }
108 
109 void LLVMContext::removeModule(Module *M) {
111 }
112 
113 //===----------------------------------------------------------------------===//
114 // Recoverable Backend Errors
115 //===----------------------------------------------------------------------===//
116 
119  void *DiagnosticContext, bool RespectFilters) {
120  pImpl->DiagHandler->DiagHandlerCallback = DiagnosticHandler;
121  pImpl->DiagHandler->DiagnosticContext = DiagnosticContext;
122  pImpl->RespectDiagnosticFilters = RespectFilters;
123 }
124 
125 void LLVMContext::setDiagnosticHandler(std::unique_ptr<DiagnosticHandler> &&DH,
126  bool RespectFilters) {
127  pImpl->DiagHandler = std::move(DH);
128  pImpl->RespectDiagnosticFilters = RespectFilters;
129 }
130 
132  pImpl->DiagnosticsHotnessRequested = Requested;
133 }
136 }
137 
139  pImpl->DiagnosticsHotnessThreshold = Threshold;
140 }
142  pImpl->MisExpectWarningRequested = Requested;
143 }
146 }
149 }
151  Optional<uint64_t> Tolerance) {
153 }
156 }
157 
160 }
161 
163  return pImpl->MainRemarkStreamer.get();
164 }
166  return const_cast<LLVMContext *>(this)->getMainRemarkStreamer();
167 }
169  std::unique_ptr<remarks::RemarkStreamer> RemarkStreamer) {
170  pImpl->MainRemarkStreamer = std::move(RemarkStreamer);
171 }
172 
174  return pImpl->LLVMRS.get();
175 }
177  return const_cast<LLVMContext *>(this)->getLLVMRemarkStreamer();
178 }
180  std::unique_ptr<LLVMRemarkStreamer> RemarkStreamer) {
181  pImpl->LLVMRS = std::move(RemarkStreamer);
182 }
183 
186  return pImpl->DiagHandler->DiagHandlerCallback;
187 }
188 
190  return pImpl->DiagHandler->DiagnosticContext;
191 }
192 
193 void LLVMContext::setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle)
194 {
195  pImpl->YieldCallback = Callback;
196  pImpl->YieldOpaqueHandle = OpaqueHandle;
197 }
198 
200  if (pImpl->YieldCallback)
202 }
203 
204 void LLVMContext::emitError(const Twine &ErrorStr) {
206 }
207 
208 void LLVMContext::emitError(const Instruction *I, const Twine &ErrorStr) {
209  assert (I && "Invalid instruction");
210  diagnose(DiagnosticInfoInlineAsm(*I, ErrorStr));
211 }
212 
213 static bool isDiagnosticEnabled(const DiagnosticInfo &DI) {
214  // Optimization remarks are selective. They need to check whether the regexp
215  // pattern, passed via one of the -pass-remarks* flags, matches the name of
216  // the pass that is emitting the diagnostic. If there is no match, ignore the
217  // diagnostic and return.
218  //
219  // Also noisy remarks are only enabled if we have hotness information to sort
220  // them.
221  if (auto *Remark = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
222  return Remark->isEnabled() &&
223  (!Remark->isVerbose() || Remark->getHotness());
224 
225  return true;
226 }
227 
228 const char *
230  switch (Severity) {
231  case DS_Error:
232  return "error";
233  case DS_Warning:
234  return "warning";
235  case DS_Remark:
236  return "remark";
237  case DS_Note:
238  return "note";
239  }
240  llvm_unreachable("Unknown DiagnosticSeverity");
241 }
242 
244  if (auto *OptDiagBase = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
246  RS->emit(*OptDiagBase);
247 
248  // If there is a report handler, use it.
249  if (pImpl->DiagHandler &&
251  pImpl->DiagHandler->handleDiagnostics(DI))
252  return;
253 
254  if (!isDiagnosticEnabled(DI))
255  return;
256 
257  // Otherwise, print the message with a prefix based on the severity.
259  errs() << getDiagnosticMessagePrefix(DI.getSeverity()) << ": ";
260  DI.print(DP);
261  errs() << "\n";
262  if (DI.getSeverity() == DS_Error)
263  exit(1);
264 }
265 
266 void LLVMContext::emitError(uint64_t LocCookie, const Twine &ErrorStr) {
267  diagnose(DiagnosticInfoInlineAsm(LocCookie, ErrorStr));
268 }
269 
270 //===----------------------------------------------------------------------===//
271 // Metadata Kind Uniquing
272 //===----------------------------------------------------------------------===//
273 
274 /// Return a unique non-zero ID for the specified metadata kind.
276  // If this is new, assign it its ID.
278  std::make_pair(
280  .first->second;
281 }
282 
283 /// getHandlerNames - Populate client-supplied smallvector using custom
284 /// metadata name and ID.
288  E = pImpl->CustomMDKindNames.end(); I != E; ++I)
289  Names[I->second] = I->first();
290 }
291 
294 }
295 
298  return pImpl->getOrInsertBundleTag(TagName);
299 }
300 
303 }
304 
306  return pImpl->getOrInsertSyncScopeID(SSN);
307 }
308 
310  pImpl->getSyncScopeNames(SSNs);
311 }
312 
313 void LLVMContext::setGC(const Function &Fn, std::string GCName) {
314  auto It = pImpl->GCNames.find(&Fn);
315 
316  if (It == pImpl->GCNames.end()) {
317  pImpl->GCNames.insert(std::make_pair(&Fn, std::move(GCName)));
318  return;
319  }
320  It->second = std::move(GCName);
321 }
322 
323 const std::string &LLVMContext::getGC(const Function &Fn) {
324  return pImpl->GCNames[&Fn];
325 }
326 
328  pImpl->GCNames.erase(&Fn);
329 }
330 
332  return pImpl->DiscardValueNames;
333 }
334 
336 
338  if (pImpl->DITypeMap)
339  return;
340 
341  pImpl->DITypeMap.emplace();
342 }
343 
345 
347  pImpl->DiscardValueNames = Discard;
348 }
349 
351  return pImpl->getOptPassGate();
352 }
353 
355  pImpl->setOptPassGate(OPG);
356 }
357 
359  return pImpl->DiagHandler.get();
360 }
361 
362 std::unique_ptr<DiagnosticHandler> LLVMContext::getDiagnosticHandler() {
363  return std::move(pImpl->DiagHandler);
364 }
365 
367  return pImpl->hasOpaquePointersValue();
368 }
369 
370 void LLVMContext::setOpaquePointers(bool Enable) const {
372 }
373 
375  return !pImpl->getOpaquePointers();
376 }
377 
379  return pImpl->TargetDataStorage;
380 }
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:138
llvm::LLVMContext::pImpl
LLVMContextImpl *const pImpl
Definition: LLVMContext.h:70
llvm::LLVMContext::enableDebugTypeODRUniquing
void enableDebugTypeODRUniquing()
Definition: LLVMContext.cpp:337
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
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:266
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:144
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:301
llvm::LLVMContext::setMisExpectWarningRequested
void setMisExpectWarningRequested(bool Requested)
Definition: LLVMContext.cpp:141
llvm::LLVMContextImpl::DiscardValueNames
bool DiscardValueNames
Flag to indicate if Value (other than GlobalValue) retains their name or not.
Definition: LLVMContextImpl.h:1547
llvm::Function
Definition: Function.h:60
StringRef.h
llvm::LLVMContextImpl::DiagnosticsMisExpectTolerance
Optional< uint64_t > DiagnosticsMisExpectTolerance
The percentage of difference between profiling branch weights and.
Definition: LLVMContextImpl.h:1390
llvm::LLVMContext::getDiagnosticsMisExpectTolerance
uint64_t getDiagnosticsMisExpectTolerance() const
Definition: LLVMContext.cpp:154
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:189
llvm::LLVMContext::setLLVMRemarkStreamer
void setLLVMRemarkStreamer(std::unique_ptr< LLVMRemarkStreamer > RemarkStreamer)
Definition: LLVMContext.cpp:179
ErrorHandling.h
llvm::LLVMContextImpl::setOptPassGate
void setOptPassGate(OptPassGate &)
Set the object which can disable optional passes and individual optimizations at compile time.
Definition: LLVMContextImpl.cpp:248
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:162
llvm::StringMap::end
iterator end()
Definition: StringMap.h:205
llvm::LLVMContextImpl::MainRemarkStreamer
std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer
The main remark streamer used by all the other streamers (e.g.
Definition: LLVMContextImpl.h:1363
llvm::LLVMContext::hasSetOpaquePointersValue
bool hasSetOpaquePointersValue() const
Whether we've decided on using opaque pointers or typed pointers yet.
Definition: LLVMContext.cpp:366
llvm::DiagnosticHandler
This is the base class for diagnostic handling in LLVM.
Definition: DiagnosticHandler.h:24
llvm::LLVMContextImpl::DiagnosticsHotnessRequested
bool DiagnosticsHotnessRequested
Definition: LLVMContextImpl.h:1367
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:309
llvm::LLVMContext::~LLVMContext
~LLVMContext()
Definition: LLVMContext.cpp:103
llvm::errs
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Definition: raw_ostream.cpp:893
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:147
llvm::LLVMContext::setOpaquePointers
void setOpaquePointers(bool Enable) const
Set whether opaque pointers are enabled.
Definition: LLVMContext.cpp:370
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:213
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:233
llvm::LLVMContext::supportsTypedPointers
bool supportsTypedPointers() const
Whether typed pointers are supported. If false, all pointers are opaque.
Definition: LLVMContext.cpp:374
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:220
llvm::DS_Warning
@ DS_Warning
Definition: DiagnosticInfo.h:51
llvm::LLVMContextImpl
Definition: LLVMContextImpl.h:1354
Twine.h
llvm::StringMap::insert
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
Definition: StringMap.h:276
llvm::LLVMContext::getDiagnosticHandlerCallBack
DiagnosticHandler::DiagnosticHandlerTy getDiagnosticHandlerCallBack() const
getDiagnosticHandlerCallBack - Return the diagnostic handler call back set by setDiagnosticHandlerCal...
Definition: LLVMContext.cpp:185
llvm::LLVMContext::yield
void yield()
Calls the yield callback (if applicable).
Definition: LLVMContext.cpp:199
llvm::OptPassGate
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
Definition: OptBisect.h:27
llvm::LLVMContext::OB_clang_arc_attachedcall
@ OB_clang_arc_attachedcall
Definition: LLVMContext.h:96
llvm::LLVMContextImpl::getOrInsertBundleTag
StringMapEntry< uint32_t > * getOrInsertBundleTag(StringRef Tag)
Definition: LLVMContextImpl.cpp:209
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:335
llvm::LLVMContext::disableDebugTypeODRUniquing
void disableDebugTypeODRUniquing()
Definition: LLVMContext.cpp:344
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:323
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:1358
llvm::SmallVectorImpl::resize
void resize(size_type N)
Definition: SmallVector.h:619
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::SyncScope::System
@ System
Synchronized with respect to all concurrently executing threads.
Definition: LLVMContext.h:58
StringMap.h
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:125
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:305
llvm::LLVMContext::getOptPassGate
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time.
Definition: LLVMContext.cpp:350
llvm::LLVMContextImpl::RespectDiagnosticFilters
bool RespectDiagnosticFilters
Definition: LLVMContextImpl.h:1366
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:358
llvm::HighlightColor::Remark
@ Remark
llvm::LLVMContext::OB_funclet
@ OB_funclet
Definition: LLVMContext.h:91
llvm::LLVMContext::OB_gc_live
@ OB_gc_live
Definition: LLVMContext.h:95
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:262
llvm::LLVMContext::getDiagnosticHandler
std::unique_ptr< DiagnosticHandler > getDiagnosticHandler()
getDiagnosticHandler - transfers ownership of DiagnosticHandler unique_ptr to caller.
Definition: LLVMContext.cpp:362
llvm::LLVMContextImpl::TargetDataStorage
llvm::Any TargetDataStorage
Definition: LLVMContextImpl.h:1574
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:331
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:68
llvm::SyncScope::ID
uint8_t ID
Definition: LLVMContext.h:47
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::LLVMContext::OB_gc_transition
@ OB_gc_transition
Definition: LLVMContext.h:92
llvm::LLVMContextImpl::getOperandBundleTags
void getOperandBundleTags(SmallVectorImpl< StringRef > &Tags) const
Definition: LLVMContextImpl.cpp:214
llvm::LLVMContext::setGC
void setGC(const Function &Fn, std::string GCName)
Define the GC for a function.
Definition: LLVMContext.cpp:313
llvm::LLVMContext::setYieldCallback
void setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle)
Registers a yield callback with the given context.
Definition: LLVMContext.cpp:193
Enable
@ Enable
Definition: DwarfDebug.cpp:85
llvm::StringMap::begin
iterator begin()
Definition: StringMap.h:204
llvm::LLVMContextImpl::hasOpaquePointersValue
bool hasOpaquePointersValue()
Definition: LLVMContextImpl.cpp:252
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::LLVMContext::OB_cfguardtarget
@ OB_cfguardtarget
Definition: LLVMContext.h:93
llvm::LLVMContextImpl::DiagHandler
std::unique_ptr< DiagnosticHandler > DiagHandler
Definition: LLVMContextImpl.h:1365
llvm::LLVMContext::setDiagnosticsHotnessRequested
void setDiagnosticsHotnessRequested(bool Requested)
Set if a code hotness metric should be included in optimization diagnostics.
Definition: LLVMContext.cpp:131
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:1396
llvm::StringMapImpl::size
unsigned size() const
Definition: StringMap.h:95
llvm::LLVMContext::setMainRemarkStreamer
void setMainRemarkStreamer(std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer)
Definition: LLVMContext.cpp:168
llvm::LLVMContext::OB_preallocated
@ OB_preallocated
Definition: LLVMContext.h:94
llvm::LLVMContextImpl::GCNames
DenseMap< const Function *, std::string > GCNames
Maintain the GC name for each function.
Definition: LLVMContextImpl.h:1543
llvm::LLVMContextImpl::getOptPassGate
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time.
Definition: LLVMContextImpl.cpp:242
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
this
Analysis the ScalarEvolution expression for r is this
Definition: README.txt:8
llvm::LLVMContextImpl::getOpaquePointers
bool getOpaquePointers()
Definition: LLVMContextImpl.cpp:256
llvm::LLVMContext::OB_deopt
@ OB_deopt
Definition: LLVMContext.h:90
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:226
llvm::LLVMContext::isDiagnosticsHotnessThresholdSetFromPSI
bool isDiagnosticsHotnessThresholdSetFromPSI() const
Return if hotness threshold is requested from PSI.
Definition: LLVMContext.cpp:158
llvm::Optional::has_value
constexpr bool has_value() const
Definition: Optional.h:311
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:173
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:229
llvm::LLVMContext::diagnose
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
Definition: LLVMContext.cpp:243
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
llvm::Any
Definition: Any.h:28
llvm::LLVMContextImpl::CustomMDKindNames
StringMap< unsigned > CustomMDKindNames
CustomMDKindNames - Map to hold the metadata string to ID mapping.
Definition: LLVMContextImpl.h:1495
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:285
llvm::LLVMContextImpl::MisExpectWarningRequested
bool MisExpectWarningRequested
Definition: LLVMContextImpl.h:1391
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
LLVMRemarkStreamer.h
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:354
llvm::LLVMContext::setDiscardValueNames
void setDiscardValueNames(bool Discard)
Set the Context runtime configuration to discard all value name (but GlobalValue).
Definition: LLVMContext.cpp:346
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:1386
llvm::LLVMContext::getDiagnosticsHotnessRequested
bool getDiagnosticsHotnessRequested() const
Return if a code hotness metric should be included in optimization diagnostics.
Definition: LLVMContext.cpp:134
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:292
llvm::LLVMContext::deleteGC
void deleteGC(const Function &Fn)
Remove the GC for a function.
Definition: LLVMContext.cpp:327
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:117
SmallVector.h
exit
declare void exit(i32) noreturn nounwind This compiles into
Definition: README.txt:1072
llvm::LLVMContext::setDiagnosticsMisExpectTolerance
void setDiagnosticsMisExpectTolerance(Optional< uint64_t > Tolerance)
Definition: LLVMContext.cpp:150
llvm::LLVMContextImpl::DITypeMap
Optional< DenseMap< const MDString *, DICompositeType * > > DITypeMap
Definition: LLVMContextImpl.h:1422
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:275
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:297
llvm::LLVMContext::getTargetData
llvm::Any & getTargetData() const
Optionally target-spcific data can be attached to the context for lifetime management and bypassing l...
Definition: LLVMContext.cpp:378
llvm::LLVMContextImpl::YieldOpaqueHandle
void * YieldOpaqueHandle
Definition: LLVMContextImpl.h:1397
LLVMContext.h
raw_ostream.h
llvm::LLVMContextImpl::LLVMRS
std::unique_ptr< LLVMRemarkStreamer > LLVMRS
The specialized remark streamer used by LLVM's OptimizationRemarkEmitter.
Definition: LLVMContextImpl.h:1394
DiagnosticPrinter.h
llvm::Optional::value_or
constexpr T value_or(U &&alt) const &
Definition: Optional.h:318
llvm::LLVMContext::OB_ptrauth
@ OB_ptrauth
Definition: LLVMContext.h:97
llvm::DS_Error
@ DS_Error
Definition: DiagnosticInfo.h:50
llvm::SyncScope::SingleThread
@ SingleThread
Synchronized with respect to signal handlers executing in the same thread.
Definition: LLVMContext.h:55
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