Go to the documentation of this file.
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
45 for (
auto &MDKind : MDKinds) {
47 assert(
ID == MDKind.first &&
"metadata kind id drifted");
53 "deopt operand bundle id drifted!");
58 "funclet operand bundle id drifted!");
63 "gc-transition operand bundle id drifted!");
64 (void)GCTransitionEntry;
68 "cfguardtarget operand bundle id drifted!");
69 (void)CFGuardTargetEntry;
73 "preallocated operand bundle id drifted!");
74 (void)PreallocatedEntry;
78 "gc-transition operand bundle id drifted!");
81 auto *ClangAttachedCall =
84 "clang.arc.attachedcall operand bundle id drifted!");
85 (void)ClangAttachedCall;
90 "singlethread synchronization scope ID drifted!");
91 (void)SingleThreadSSID;
96 "system synchronization scope ID drifted!");
102 void LLVMContext::addModule(
Module *M) {
106 void LLVMContext::removeModule(
Module *M) {
116 void *DiagnosticContext,
bool RespectFilters) {
123 bool RespectFilters) {
154 std::unique_ptr<remarks::RemarkStreamer> RemarkStreamer) {
165 std::unique_ptr<LLVMRemarkStreamer> RemarkStreamer) {
194 assert (
I &&
"Invalid instruction");
206 if (
auto *
Remark = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
207 return Remark->isEnabled() &&
229 if (
auto *OptDiagBase = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
231 RS->emit(*OptDiagBase);
274 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.
SmallPtrSet< Module *, 4 > OwnedModules
OwnedModules - The set of modules instantiated in this context, and which will be automatically delet...
LLVMContextImpl *const pImpl
void enableDebugTypeODRUniquing()
bool erase(PtrType Ptr)
erase - If the set contains the specified pointer, remove it and return true, otherwise return false.
uint32_t getOperandBundleTagID(StringRef Tag) const
getOperandBundleTagID - Maps a bundle tag to an integer ID.
bool DiscardValueNames
Flag to indicate if Value (other than GlobalValue) retains their name or not.
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.
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...
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
@ SingleThread
Synchronized with respect to signal handlers executing in the same thread.
void getSyncScopeNames(SmallVectorImpl< StringRef > &SSNs) const
getSyncScopeNames - Populates client supplied SmallVector with synchronization scope names registered...
constexpr bool hasValue() const
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...
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.
DiagnosticSeverity getSeverity() const
This is the base abstract class for diagnostic reporting in the backend.
void setDiagnosticHandler(std::unique_ptr< DiagnosticHandler > &&DH, bool RespectFilters=false)
setDiagnosticHandler - This method sets unique_ptr to object of DiagnosticHandler to provide custom d...
@ OB_clang_arc_attachedcall
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 emitError(unsigned LocCookie, const Twine &ErrorStr)
emitError - Emit an error message to the currently installed error handler with optional location inf...
constexpr T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION
void(*)(LLVMContext *Context, void *OpaqueHandle) YieldCallbackTy
Defines the type of a yield callback.
std::unique_ptr< DiagnosticHandler > getDiagnosticHandler()
getDiagnosticHandler - transfers ownership of DiagnosticHandler unique_ptr to caller.
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.
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)
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
#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.
DenseMap< const Function *, std::string > GCNames
Maintain the GC name for each function.
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...
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.
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
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
@ System
Synchronized with respect to all concurrently executing threads.
Optional< DenseMap< const MDString *, DICompositeType * > > DITypeMap
static cl::opt< unsigned > Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"), cl::init(100), cl::Hidden)
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.
std::unique_ptr< LLVMRemarkStreamer > LLVMRS
The specialized remark streamer used by LLVM's OptimizationRemarkEmitter.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.