Go to the documentation of this file.
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
43 for (
auto &MDKind : MDKinds) {
45 assert(
ID == MDKind.first &&
"metadata kind id drifted");
51 "deopt operand bundle id drifted!");
56 "funclet operand bundle id drifted!");
61 "gc-transition operand bundle id drifted!");
62 (void)GCTransitionEntry;
66 "cfguardtarget operand bundle id drifted!");
67 (void)CFGuardTargetEntry;
71 "preallocated operand bundle id drifted!");
72 (void)PreallocatedEntry;
76 "gc-transition operand bundle id drifted!");
79 auto *ClangAttachedCall =
82 "clang.arc.attachedcall operand bundle id drifted!");
83 (void)ClangAttachedCall;
87 "ptrauth operand bundle id drifted!");
93 "singlethread synchronization scope ID drifted!");
94 (void)SingleThreadSSID;
99 "system synchronization scope ID drifted!");
105 void LLVMContext::addModule(
Module *M) {
109 void LLVMContext::removeModule(
Module *M) {
119 void *DiagnosticContext,
bool RespectFilters) {
126 bool RespectFilters) {
169 std::unique_ptr<remarks::RemarkStreamer> RemarkStreamer) {
180 std::unique_ptr<LLVMRemarkStreamer> RemarkStreamer) {
209 assert (
I &&
"Invalid instruction");
221 if (
auto *
Remark = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
222 return Remark->isEnabled() &&
244 if (
auto *OptDiagBase = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
246 RS->emit(*OptDiagBase);
289 Names[
I->second] =
I->first();
void setDiagnosticsHotnessThreshold(Optional< uint64_t > Threshold)
Set the minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.
LLVMContextImpl *const pImpl
void enableDebugTypeODRUniquing()
This is an optimization pass for GlobalISel generic memory operations.
void emitError(uint64_t LocCookie, const Twine &ErrorStr)
emitError - Emit an error message to the currently installed error handler with optional location inf...
bool erase(PtrType Ptr)
erase - If the set contains the specified pointer, remove it and return true, otherwise return false.
bool getMisExpectWarningRequested() const
uint32_t getOperandBundleTagID(StringRef Tag) const
getOperandBundleTagID - Maps a bundle tag to an integer ID.
void setMisExpectWarningRequested(bool Requested)
bool DiscardValueNames
Flag to indicate if Value (other than GlobalValue) retains their name or not.
Optional< uint64_t > DiagnosticsMisExpectTolerance
The percentage of difference between profiling branch weights and.
uint64_t getDiagnosticsMisExpectTolerance() const
Basic diagnostic printer that uses an underlying raw_ostream.
void * getDiagnosticContext() const
getDiagnosticContext - Return the diagnostic context set by setDiagnosticContext.
void setLLVMRemarkStreamer(std::unique_ptr< LLVMRemarkStreamer > RemarkStreamer)
void setOptPassGate(OptPassGate &)
Set the object which can disable optional passes and individual optimizations at compile time.
virtual void print(DiagnosticPrinter &DP) const =0
Print using the given DP a user-friendly message.
remarks::RemarkStreamer * getMainRemarkStreamer()
The "main remark streamer" used by all the specialized remark streamers.
std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer
The main remark streamer used by all the other streamers (e.g.
bool hasSetOpaquePointersValue() const
Whether we've decided on using opaque pointers or typed pointers yet.
This is the base class for diagnostic handling in LLVM.
bool DiagnosticsHotnessRequested
void(*)(const DiagnosticInfo &DI, void *Context) DiagnosticHandlerTy
void getSyncScopeNames(SmallVectorImpl< StringRef > &SSNs) const
getSyncScopeNames - Populates client supplied SmallVector with synchronization scope names registered...
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
uint64_t getDiagnosticsHotnessThreshold() const
Return the minimum hotness value a diagnostic would need in order to be included in optimization diag...
void setOpaquePointers(bool Enable) const
Set whether opaque pointers are enabled.
static bool isDiagnosticEnabled(const DiagnosticInfo &DI)
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
void getSyncScopeNames(SmallVectorImpl< StringRef > &SSNs) const
getSyncScopeNames - Populates client supplied SmallVector with synchronization scope names registered...
bool supportsTypedPointers() const
Whether typed pointers are supported. If false, all pointers are opaque.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
uint32_t getOperandBundleTagID(StringRef Tag) const
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
DiagnosticHandler::DiagnosticHandlerTy getDiagnosticHandlerCallBack() const
getDiagnosticHandlerCallBack - Return the diagnostic handler call back set by setDiagnosticHandlerCal...
void yield()
Calls the yield callback (if applicable).
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
@ OB_clang_arc_attachedcall
StringMapEntry< uint32_t > * getOrInsertBundleTag(StringRef Tag)
bool isODRUniquingDebugTypes() const
Whether there is a string map for uniquing debug info identifiers across the context.
void disableDebugTypeODRUniquing()
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
const std::string & getGC(const Function &Fn)
Return the GC for a function.
SmallPtrSet< Module *, 4 > OwnedModules
OwnedModules - The set of modules instantiated in this context, and which will be automatically delet...
DiagnosticSeverity getSeverity() const
This is the base abstract class for diagnostic reporting in the backend.
@ System
Synchronized with respect to all concurrently executing threads.
void setDiagnosticHandler(std::unique_ptr< DiagnosticHandler > &&DH, bool RespectFilters=false)
setDiagnosticHandler - This method sets unique_ptr to object of DiagnosticHandler to provide custom d...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
SyncScope::ID getOrInsertSyncScopeID(StringRef SSN)
getOrInsertSyncScopeID - Maps synchronization scope name to synchronization scope ID.
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time.
bool RespectDiagnosticFilters
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Diagnostic information for inline asm reporting.
const DiagnosticHandler * getDiagHandlerPtr() const
getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler.
void(*)(LLVMContext *Context, void *OpaqueHandle) YieldCallbackTy
Defines the type of a yield callback.
void setOpaquePointers(bool OP)
std::unique_ptr< DiagnosticHandler > getDiagnosticHandler()
getDiagnosticHandler - transfers ownership of DiagnosticHandler unique_ptr to caller.
llvm::Any TargetDataStorage
bool shouldDiscardValueNames() const
Return true if the Context runtime configuration is set to discard all value names.
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
This is an important class for using LLVM in a threaded context.
void getOperandBundleTags(SmallVectorImpl< StringRef > &Tags) const
void setGC(const Function &Fn, std::string GCName)
Define the GC for a function.
void setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle)
Registers a yield callback with the given context.
bool hasOpaquePointersValue()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::unique_ptr< DiagnosticHandler > DiagHandler
void setDiagnosticsHotnessRequested(bool Requested)
Set if a code hotness metric should be included in optimization diagnostics.
A Module instance is used to store all the information related to an LLVM module.
LLVMContext::YieldCallbackTy YieldCallback
void setMainRemarkStreamer(std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer)
DenseMap< const Function *, std::string > GCNames
Maintain the GC name for each function.
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time.
StringRef - Represent a constant reference to a string, i.e.
Analysis the ScalarEvolution expression for r is this
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
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
SyncScope::ID getOrInsertSyncScopeID(StringRef SSN)
getOrInsertSyncScopeID - Maps synchronization scope name to synchronization scope ID.
bool isDiagnosticsHotnessThresholdSetFromPSI() const
Return if hotness threshold is requested from PSI.
constexpr bool has_value() const
LLVMRemarkStreamer * getLLVMRemarkStreamer()
The "LLVM remark streamer" used by LLVM to serialize remark diagnostics comming from IR and MIR passe...
static const char * getDiagnosticMessagePrefix(DiagnosticSeverity Severity)
Get the prefix that should be printed in front of a diagnostic of the given Severity.
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
StringMap< unsigned > CustomMDKindNames
CustomMDKindNames - Map to hold the metadata string to ID mapping.
void getMDKindNames(SmallVectorImpl< StringRef > &Result) const
getMDKindNames - Populate client supplied SmallVector with the name for custom metadata IDs registere...
bool MisExpectWarningRequested
void setOptPassGate(OptPassGate &)
Set the object which can disable optional passes and individual optimizations at compile time.
void setDiscardValueNames(bool Discard)
Set the Context runtime configuration to discard all value name (but GlobalValue).
Optional< uint64_t > DiagnosticsHotnessThreshold
The minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.
bool getDiagnosticsHotnessRequested() const
Return if a code hotness metric should be included in optimization diagnostics.
void getOperandBundleTags(SmallVectorImpl< StringRef > &Result) const
getOperandBundleTags - Populate client supplied SmallVector with the bundle tags registered in this L...
void deleteGC(const Function &Fn)
Remove the GC for a function.
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 ...
declare void exit(i32) noreturn nounwind This compiles into
void setDiagnosticsMisExpectTolerance(Optional< uint64_t > Tolerance)
Optional< DenseMap< const MDString *, DICompositeType * > > DITypeMap
unsigned getMDKindID(StringRef Name) const
getMDKindID - Return a unique non-zero ID for the specified metadata kind.
StringMapEntry< uint32_t > * getOrInsertBundleTag(StringRef TagName) const
getOrInsertBundleTag - Returns the Tag to use for an operand bundle of name TagName.
llvm::Any & getTargetData() const
Optionally target-spcific data can be attached to the context for lifetime management and bypassing l...
std::unique_ptr< LLVMRemarkStreamer > LLVMRS
The specialized remark streamer used by LLVM's OptimizationRemarkEmitter.
constexpr T value_or(U &&alt) const &
@ SingleThread
Synchronized with respect to signal handlers executing in the same thread.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.