LLVM  14.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"
23 #include "llvm/IR/Metadata.h"
24 #include "llvm/IR/Module.h"
26 #include "llvm/Support/Casting.h"
29 #include <cassert>
30 #include <cstdlib>
31 #include <string>
32 #include <utility>
33 
34 using namespace llvm;
35 
37  // Create the fixed metadata kinds. This is done in the same order as the
38  // MD_* enum values so that they correspond.
39  std::pair<unsigned, StringRef> MDKinds[] = {
40 #define LLVM_FIXED_MD_KIND(EnumID, Name, Value) {EnumID, Name},
41 #include "llvm/IR/FixedMetadataKinds.def"
42 #undef LLVM_FIXED_MD_KIND
43  };
44 
45  for (auto &MDKind : MDKinds) {
46  unsigned ID = getMDKindID(MDKind.second);
47  assert(ID == MDKind.first && "metadata kind id drifted");
48  (void)ID;
49  }
50 
51  auto *DeoptEntry = pImpl->getOrInsertBundleTag("deopt");
52  assert(DeoptEntry->second == LLVMContext::OB_deopt &&
53  "deopt operand bundle id drifted!");
54  (void)DeoptEntry;
55 
56  auto *FuncletEntry = pImpl->getOrInsertBundleTag("funclet");
57  assert(FuncletEntry->second == LLVMContext::OB_funclet &&
58  "funclet operand bundle id drifted!");
59  (void)FuncletEntry;
60 
61  auto *GCTransitionEntry = pImpl->getOrInsertBundleTag("gc-transition");
62  assert(GCTransitionEntry->second == LLVMContext::OB_gc_transition &&
63  "gc-transition operand bundle id drifted!");
64  (void)GCTransitionEntry;
65 
66  auto *CFGuardTargetEntry = pImpl->getOrInsertBundleTag("cfguardtarget");
67  assert(CFGuardTargetEntry->second == LLVMContext::OB_cfguardtarget &&
68  "cfguardtarget operand bundle id drifted!");
69  (void)CFGuardTargetEntry;
70 
71  auto *PreallocatedEntry = pImpl->getOrInsertBundleTag("preallocated");
72  assert(PreallocatedEntry->second == LLVMContext::OB_preallocated &&
73  "preallocated operand bundle id drifted!");
74  (void)PreallocatedEntry;
75 
76  auto *GCLiveEntry = pImpl->getOrInsertBundleTag("gc-live");
77  assert(GCLiveEntry->second == LLVMContext::OB_gc_live &&
78  "gc-transition operand bundle id drifted!");
79  (void)GCLiveEntry;
80 
81  auto *ClangAttachedCall =
82  pImpl->getOrInsertBundleTag("clang.arc.attachedcall");
83  assert(ClangAttachedCall->second == LLVMContext::OB_clang_arc_attachedcall &&
84  "clang.arc.attachedcall operand bundle id drifted!");
85  (void)ClangAttachedCall;
86 
87  SyncScope::ID SingleThreadSSID =
88  pImpl->getOrInsertSyncScopeID("singlethread");
89  assert(SingleThreadSSID == SyncScope::SingleThread &&
90  "singlethread synchronization scope ID drifted!");
91  (void)SingleThreadSSID;
92 
93  SyncScope::ID SystemSSID =
95  assert(SystemSSID == SyncScope::System &&
96  "system synchronization scope ID drifted!");
97  (void)SystemSSID;
98 }
99 
101 
102 void LLVMContext::addModule(Module *M) {
104 }
105 
106 void LLVMContext::removeModule(Module *M) {
108 }
109 
110 //===----------------------------------------------------------------------===//
111 // Recoverable Backend Errors
112 //===----------------------------------------------------------------------===//
113 
116  void *DiagnosticContext, bool RespectFilters) {
117  pImpl->DiagHandler->DiagHandlerCallback = DiagnosticHandler;
118  pImpl->DiagHandler->DiagnosticContext = DiagnosticContext;
119  pImpl->RespectDiagnosticFilters = RespectFilters;
120 }
121 
122 void LLVMContext::setDiagnosticHandler(std::unique_ptr<DiagnosticHandler> &&DH,
123  bool RespectFilters) {
124  pImpl->DiagHandler = std::move(DH);
125  pImpl->RespectDiagnosticFilters = RespectFilters;
126 }
127 
129  pImpl->DiagnosticsHotnessRequested = Requested;
130 }
133 }
134 
137 }
138 
141 }
142 
145 }
146 
148  return pImpl->MainRemarkStreamer.get();
149 }
151  return const_cast<LLVMContext *>(this)->getMainRemarkStreamer();
152 }
154  std::unique_ptr<remarks::RemarkStreamer> RemarkStreamer) {
155  pImpl->MainRemarkStreamer = std::move(RemarkStreamer);
156 }
157 
159  return pImpl->LLVMRS.get();
160 }
162  return const_cast<LLVMContext *>(this)->getLLVMRemarkStreamer();
163 }
165  std::unique_ptr<LLVMRemarkStreamer> RemarkStreamer) {
166  pImpl->LLVMRS = std::move(RemarkStreamer);
167 }
168 
171  return pImpl->DiagHandler->DiagHandlerCallback;
172 }
173 
175  return pImpl->DiagHandler->DiagnosticContext;
176 }
177 
178 void LLVMContext::setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle)
179 {
180  pImpl->YieldCallback = Callback;
181  pImpl->YieldOpaqueHandle = OpaqueHandle;
182 }
183 
185  if (pImpl->YieldCallback)
187 }
188 
189 void LLVMContext::emitError(const Twine &ErrorStr) {
191 }
192 
193 void LLVMContext::emitError(const Instruction *I, const Twine &ErrorStr) {
194  assert (I && "Invalid instruction");
195  diagnose(DiagnosticInfoInlineAsm(*I, ErrorStr));
196 }
197 
198 static bool isDiagnosticEnabled(const DiagnosticInfo &DI) {
199  // Optimization remarks are selective. They need to check whether the regexp
200  // pattern, passed via one of the -pass-remarks* flags, matches the name of
201  // the pass that is emitting the diagnostic. If there is no match, ignore the
202  // diagnostic and return.
203  //
204  // Also noisy remarks are only enabled if we have hotness information to sort
205  // them.
206  if (auto *Remark = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
207  return Remark->isEnabled() &&
208  (!Remark->isVerbose() || Remark->getHotness());
209 
210  return true;
211 }
212 
213 const char *
215  switch (Severity) {
216  case DS_Error:
217  return "error";
218  case DS_Warning:
219  return "warning";
220  case DS_Remark:
221  return "remark";
222  case DS_Note:
223  return "note";
224  }
225  llvm_unreachable("Unknown DiagnosticSeverity");
226 }
227 
229  if (auto *OptDiagBase = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
231  RS->emit(*OptDiagBase);
232 
233  // If there is a report handler, use it.
234  if (pImpl->DiagHandler &&
236  pImpl->DiagHandler->handleDiagnostics(DI))
237  return;
238 
239  if (!isDiagnosticEnabled(DI))
240  return;
241 
242  // Otherwise, print the message with a prefix based on the severity.
244  errs() << getDiagnosticMessagePrefix(DI.getSeverity()) << ": ";
245  DI.print(DP);
246  errs() << "\n";
247  if (DI.getSeverity() == DS_Error)
248  exit(1);
249 }
250 
251 void LLVMContext::emitError(uint64_t LocCookie, const Twine &ErrorStr) {
252  diagnose(DiagnosticInfoInlineAsm(LocCookie, ErrorStr));
253 }
254 
255 //===----------------------------------------------------------------------===//
256 // Metadata Kind Uniquing
257 //===----------------------------------------------------------------------===//
258 
259 /// Return a unique non-zero ID for the specified metadata kind.
261  // If this is new, assign it its ID.
263  std::make_pair(
265  .first->second;
266 }
267 
268 /// getHandlerNames - Populate client-supplied smallvector using custom
269 /// metadata name and ID.
273  E = pImpl->CustomMDKindNames.end(); I != E; ++I)
274  Names[I->second] = I->first();
275 }
276 
279 }
280 
283  return pImpl->getOrInsertBundleTag(TagName);
284 }
285 
287  return pImpl->getOperandBundleTagID(Tag);
288 }
289 
291  return pImpl->getOrInsertSyncScopeID(SSN);
292 }
293 
295  pImpl->getSyncScopeNames(SSNs);
296 }
297 
298 void LLVMContext::setGC(const Function &Fn, std::string GCName) {
299  auto It = pImpl->GCNames.find(&Fn);
300 
301  if (It == pImpl->GCNames.end()) {
302  pImpl->GCNames.insert(std::make_pair(&Fn, std::move(GCName)));
303  return;
304  }
305  It->second = std::move(GCName);
306 }
307 
308 const std::string &LLVMContext::getGC(const Function &Fn) {
309  return pImpl->GCNames[&Fn];
310 }
311 
313  pImpl->GCNames.erase(&Fn);
314 }
315 
317  return pImpl->DiscardValueNames;
318 }
319 
321 
323  if (pImpl->DITypeMap)
324  return;
325 
326  pImpl->DITypeMap.emplace();
327 }
328 
330 
332  pImpl->DiscardValueNames = Discard;
333 }
334 
336  return pImpl->getOptPassGate();
337 }
338 
340  pImpl->setOptPassGate(OPG);
341 }
342 
344  return pImpl->DiagHandler.get();
345 }
346 
347 std::unique_ptr<DiagnosticHandler> LLVMContext::getDiagnosticHandler() {
348  return std::move(pImpl->DiagHandler);
349 }
350 
352  assert(pImpl->PointerTypes.empty() && pImpl->ASPointerTypes.empty() &&
353  "Must be called before creating any pointer types");
354  pImpl->OpaquePointers = true;
355 }
356 
358  return !pImpl->OpaquePointers;
359 }
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::LLVMContextImpl::OwnedModules
SmallPtrSet< Module *, 4 > OwnedModules
OwnedModules - The set of modules instantiated in this context, and which will be automatically delet...
Definition: LLVMContextImpl.h:1345
llvm::LLVMContext::pImpl
LLVMContextImpl *const pImpl
Definition: LLVMContext.h:70
llvm::LLVMContext::enableDebugTypeODRUniquing
void enableDebugTypeODRUniquing()
Definition: LLVMContext.cpp:322
llvm
---------------------— PointerInfo ------------------------------------—
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
llvm::LLVMContextImpl::OpaquePointers
bool OpaquePointers
Definition: LLVMContextImpl.h:1467
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:378
llvm::remarks::RemarkStreamer
Definition: RemarkStreamer.h:42
Metadata.h
llvm::LLVMContext::getOperandBundleTagID
uint32_t getOperandBundleTagID(StringRef Tag) const
getOperandBundleTagID - Maps a bundle tag to an integer ID.
Definition: LLVMContext.cpp:286
llvm::LLVMContextImpl::DiscardValueNames
bool DiscardValueNames
Flag to indicate if Value (other than GlobalValue) retains their name or not.
Definition: LLVMContextImpl.h:1527
llvm::Function
Definition: Function.h:61
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:174
llvm::LLVMContext::setLLVMRemarkStreamer
void setLLVMRemarkStreamer(std::unique_ptr< LLVMRemarkStreamer > RemarkStreamer)
Definition: LLVMContext.cpp:164
llvm::SyncScope::SingleThread
@ SingleThread
Synchronized with respect to signal handlers executing in the same thread.
Definition: LLVMContext.h:55
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:233
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:147
llvm::StringMap::end
iterator end()
Definition: StringMap.h:203
Module.h
llvm::LLVMContextImpl::MainRemarkStreamer
std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer
The main remark streamer used by all the other streamers (e.g.
Definition: LLVMContextImpl.h:1350
llvm::DiagnosticHandler
This is the base class for diagnostic handling in LLVM.
Definition: DiagnosticHandler.h:24
llvm::LLVMContextImpl::DiagnosticsHotnessRequested
bool DiagnosticsHotnessRequested
Definition: LLVMContextImpl.h:1354
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
llvm::LLVMContext::~LLVMContext
~LLVMContext()
Definition: LLVMContext.cpp:100
llvm::errs
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Definition: raw_ostream.cpp:892
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
llvm::LLVMContext::OB_clang_arc_attachedcall
@ OB_clang_arc_attachedcall
Definition: LLVMContext.h:96
isDiagnosticEnabled
static bool isDiagnosticEnabled(const DiagnosticInfo &DI)
Definition: LLVMContext.cpp:198
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:218
llvm::Optional::hasValue
constexpr bool hasValue() const
Definition: Optional.h:288
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
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::LLVMContextImpl::getOperandBundleTagID
uint32_t getOperandBundleTagID(StringRef Tag) const
Definition: LLVMContextImpl.cpp:205
llvm::DS_Warning
@ DS_Warning
Definition: DiagnosticInfo.h:46
llvm::LLVMContextImpl
Definition: LLVMContextImpl.h:1341
Twine.h
llvm::StringMap::insert
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
Definition: StringMap.h:274
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::LLVMContextImpl::getOrInsertBundleTag
StringMapEntry< uint32_t > * getOrInsertBundleTag(StringRef Tag)
Definition: LLVMContextImpl.cpp:194
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: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:44
LLVMContextImpl.h
llvm::LLVMContext::getGC
const std::string & getGC(const Function &Fn)
Return the GC for a function.
Definition: LLVMContext.cpp:308
llvm::LLVMContext::OB_gc_live
@ OB_gc_live
Definition: LLVMContext.h:95
llvm::SmallVectorImpl::resize
void resize(size_type N)
Definition: SmallVector.h:606
llvm::DiagnosticInfo::getSeverity
DiagnosticSeverity getSeverity() const
Definition: DiagnosticInfo.h:117
llvm::DiagnosticInfo
This is the base abstract class for diagnostic reporting in the backend.
Definition: DiagnosticInfo.h:102
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: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::LLVMContextImpl::RespectDiagnosticFilters
bool RespectDiagnosticFilters
Definition: LLVMContextImpl.h:1353
llvm::StringMap
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:108
llvm::DiagnosticInfoInlineAsm
Diagnostic information for inline asm reporting.
Definition: DiagnosticInfo.h:132
llvm::LLVMContext::getDiagHandlerPtr
const DiagnosticHandler * getDiagHandlerPtr() const
getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler.
Definition: LLVMContext.cpp:343
llvm::HighlightColor::Remark
@ Remark
llvm::Optional::getValueOr
constexpr T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION
Definition: Optional.h:297
llvm::LLVMContext::YieldCallbackTy
void(*)(LLVMContext *Context, void *OpaqueHandle) YieldCallbackTy
Defines the type of a yield callback.
Definition: LLVMContext.h:158
llvm::LLVMContext::OB_deopt
@ OB_deopt
Definition: LLVMContext.h:90
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::DS_Remark
@ DS_Remark
Definition: DiagnosticInfo.h:47
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:59
llvm::LLVMContextImpl::ASPointerTypes
DenseMap< std::pair< Type *, unsigned >, PointerType * > ASPointerTypes
Definition: LLVMContextImpl.h:1469
llvm::LLVMContextImpl::getOperandBundleTags
void getOperandBundleTags(SmallVectorImpl< StringRef > &Tags) const
Definition: LLVMContextImpl.cpp:199
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
llvm::StringMap::begin
iterator begin()
Definition: StringMap.h:202
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::LLVMContextImpl::DiagHandler
std::unique_ptr< DiagnosticHandler > DiagHandler
Definition: LLVMContextImpl.h:1352
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::LLVMContextImpl::YieldCallback
LLVMContext::YieldCallbackTy YieldCallback
Definition: LLVMContextImpl.h:1378
llvm::StringMapImpl::size
unsigned size() const
Definition: StringMap.h:93
llvm::LLVMContext::setMainRemarkStreamer
void setMainRemarkStreamer(std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer)
Definition: LLVMContext.cpp:153
llvm::LLVMContext::OB_preallocated
@ OB_preallocated
Definition: LLVMContext.h:94
llvm::LLVMContextImpl::getOptPassGate
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time.
Definition: LLVMContextImpl.cpp:227
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_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
uint32_t
llvm::LLVMContext::OB_cfguardtarget
@ OB_cfguardtarget
Definition: LLVMContext.h:93
llvm::LLVMContextImpl::getOrInsertSyncScopeID
SyncScope::ID getOrInsertSyncScopeID(StringRef SSN)
getOrInsertSyncScopeID - Maps synchronization scope name to synchronization scope ID.
Definition: LLVMContextImpl.cpp:211
llvm::LLVMContext::isDiagnosticsHotnessThresholdSetFromPSI
bool isDiagnosticsHotnessThresholdSetFromPSI() const
Return if hotness threshold is requested from PSI.
Definition: LLVMContext.cpp:143
llvm::LLVMContextImpl::GCNames
DenseMap< const Function *, std::string > GCNames
Maintain the GC name for each function.
Definition: LLVMContextImpl.h:1523
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::LLVMContextImpl::CustomMDKindNames
StringMap< unsigned > CustomMDKindNames
CustomMDKindNames - Map to hold the metadata string to ID mapping.
Definition: LLVMContextImpl.h:1478
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
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: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::LLVMContextImpl::DiagnosticsHotnessThreshold
Optional< uint64_t > DiagnosticsHotnessThreshold
The minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.
Definition: LLVMContextImpl.h:1373
llvm::SyncScope::System
@ System
Synchronized with respect to all concurrently executing threads.
Definition: LLVMContext.h:58
DP
So we should use XX3Form_Rcr to implement instrinsic 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::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
SmallVector.h
exit
declare void exit(i32) noreturn nounwind This compiles into
Definition: README.txt:1072
llvm::LLVMContext::OB_funclet
@ OB_funclet
Definition: LLVMContext.h:91
llvm::LLVMContextImpl::DITypeMap
Optional< DenseMap< const MDString *, DICompositeType * > > DITypeMap
Definition: LLVMContextImpl.h:1404
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::LLVMContextImpl::PointerTypes
DenseMap< Type *, PointerType * > PointerTypes
Definition: LLVMContextImpl.h:1468
llvm::LLVMContextImpl::YieldOpaqueHandle
void * YieldOpaqueHandle
Definition: LLVMContextImpl.h:1379
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:1376
DiagnosticPrinter.h
llvm::DS_Error
@ DS_Error
Definition: DiagnosticInfo.h:45
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:364
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:37
llvm::DS_Note
@ DS_Note
Definition: DiagnosticInfo.h:50