16 #ifndef LLVM_IR_MODULESUMMARYINDEX_H 17 #define LLVM_IR_MODULESUMMARYINDEX_H 69 static constexpr int32_t ScaleShift = 8;
70 static constexpr uint64_t MaxRelBlockFreq = (1 << 29) - 1;
75 : Hotness(static_cast<
uint32_t>(Hotness)), RelBlockFreq(RelBF) {}
78 Hotness =
std::max(Hotness, static_cast<uint32_t>(OtherHotness));
92 Scaled64 Temp(BlockFreq, ScaleShift);
93 Temp /= Scaled64::get(EntryFreq);
96 SaturatingAdd<uint64_t>(Temp.toInt<uint64_t>(), RelBlockFreq);
97 Sum = std::min(Sum, uint64_t(MaxRelBlockFreq));
98 RelBlockFreq =
static_cast<uint32_t>(Sum);
144 std::map<GlobalValue::GUID, GlobalValueSummaryInfo>;
153 ValueInfo(
bool HaveGVs,
const GlobalValueSummaryMapTy::value_type *R) {
154 RefAndFlag.setPointer(R);
155 RefAndFlag.setInt(HaveGVs);
158 operator bool()
const {
return getRef(); }
163 return getRef()->second.U.GV;
167 return getRef()->second.SummaryList;
171 return haveGVs() ? getRef()->second.U.GV->getName()
172 : getRef()->second.U.Name;
175 bool haveGVs()
const {
return RefAndFlag.getInt(); }
177 const GlobalValueSummaryMapTy::value_type *
getRef()
const {
178 return RefAndFlag.getPointer();
181 bool isDSOLocal()
const;
187 OS <<
" (" << VI.
name() <<
")";
193 "Need ValueInfo with non-null Ref for comparison");
199 "Need ValueInfo with non-null Ref for comparison");
205 "Need ValueInfo with non-null Ref to compare GUIDs");
211 return ValueInfo(
false, (GlobalValueSummaryMapTy::value_type *)-8);
215 return ValueInfo(
false, (GlobalValueSummaryMapTy::value_type *)-16);
219 return V == getTombstoneKey() || V == getEmptyKey();
236 enum SummaryKind :
unsigned { AliasKind, FunctionKind, GlobalVarKind };
266 bool NotEligibleToImport,
bool Live,
bool IsLocal)
267 : Linkage(Linkage), NotEligibleToImport(NotEligibleToImport),
268 Live(Live), DSOLocal(IsLocal) {}
295 std::vector<ValueInfo> RefEdgeList;
299 : Kind(K), Flags(Flags), RefEdgeList(
std::move(Refs)) {
300 assert((K != AliasKind || Refs.empty()) &&
301 "Expect no references for AliasSummary");
373 AliaseeSummary(
nullptr), AliaseeGUID(0) {}
386 assert(AliaseeSummary &&
"Unexpected missing aliasee summary");
387 return *AliaseeSummary;
395 assert(AliaseeGUID &&
"Unexpected missing aliasee GUID");
401 if (
auto *
AS = dyn_cast<AliasSummary>(
this))
402 return &
AS->getAliasee();
407 if (
auto *
AS = dyn_cast<AliasSummary>(
this))
408 return &
AS->getAliasee();
417 using EdgeTy = std::pair<ValueInfo, CalleeInfo>;
460 TypeCheckedLoadConstVCalls;
478 GlobalValue::LinkageTypes::AvailableExternallyLinkage,
481 std::move(Edges), std::vector<GlobalValue::GUID>(),
482 std::vector<FunctionSummary::VFuncId>(),
483 std::vector<FunctionSummary::VFuncId>(),
484 std::vector<FunctionSummary::ConstVCall>(),
485 std::vector<FunctionSummary::ConstVCall>());
501 std::vector<EdgeTy> CallGraphEdgeList;
503 std::unique_ptr<TypeIdInfo> TIdInfo;
507 std::vector<ValueInfo> Refs, std::vector<EdgeTy> CGEdges,
508 std::vector<GlobalValue::GUID> TypeTests,
509 std::vector<VFuncId> TypeTestAssumeVCalls,
510 std::vector<VFuncId> TypeCheckedLoadVCalls,
511 std::vector<ConstVCall> TypeTestAssumeConstVCalls,
512 std::vector<ConstVCall> TypeCheckedLoadConstVCalls)
514 InstCount(NumInsts), FunFlags(FunFlags),
515 CallGraphEdgeList(
std::move(CGEdges)) {
516 if (!TypeTests.empty() || !TypeTestAssumeVCalls.empty() ||
517 !TypeCheckedLoadVCalls.empty() || !TypeTestAssumeConstVCalls.empty() ||
518 !TypeCheckedLoadConstVCalls.empty())
519 TIdInfo = llvm::make_unique<TypeIdInfo>(
TypeIdInfo{
520 std::move(TypeTests), std::move(TypeTestAssumeVCalls),
521 std::move(TypeCheckedLoadVCalls),
522 std::move(TypeTestAssumeConstVCalls),
523 std::move(TypeCheckedLoadConstVCalls)});
545 return TIdInfo->TypeTests;
554 return TIdInfo->TypeTestAssumeVCalls;
563 return TIdInfo->TypeCheckedLoadVCalls;
572 return TIdInfo->TypeTestAssumeConstVCalls;
580 return TIdInfo->TypeCheckedLoadConstVCalls;
588 TIdInfo = llvm::make_unique<TypeIdInfo>();
589 TIdInfo->TypeTests.push_back(Guid);
592 const TypeIdInfo *getTypeIdInfo()
const {
return TIdInfo.get(); };
601 return {0, uint64_t(-2)};
613 return {{0, uint64_t(-1)}, {}};
617 return {{0, uint64_t(-2)}, {}};
666 unsigned SizeM1BitWidth = 0;
673 uint64_t AlignLog2 = 0;
676 uint64_t InlineBits = 0;
721 std::map<uint64_t, WholeProgramDevirtResolution>
WPDRes;
753 std::map<std::string, TypeIdSummary> TypeIdMap;
757 std::map<GlobalValue::GUID, GlobalValue::GUID> OidGuidMap;
762 bool WithGlobalValueDeadStripping =
false;
769 bool SkipModuleByDistributedBackend =
false;
777 std::set<std::string> CfiFunctionDefs;
778 std::set<std::string> CfiFunctionDecls;
788 GlobalValueSummaryMapTy::value_type *
804 size_t size()
const {
return GlobalValueMap.size(); }
809 std::map<ValueInfo, bool> &FunctionHasParent) {
814 auto S = FunctionHasParent.emplace(V,
false);
822 assert(F !=
nullptr &&
"Expected FunctionSummary node");
824 for (
auto &
C : F->
calls()) {
826 auto S = FunctionHasParent.emplace(
C.first,
true);
829 if (!S.second && S.first->second)
833 discoverNodes(
C.first, FunctionHasParent);
835 S.first->second =
true;
844 std::map<ValueInfo, bool> FunctionHasParent;
846 for (
auto &S : *
this) {
848 if (!S.second.SummaryList.size() ||
849 !isa<FunctionSummary>(S.second.SummaryList.front().get()))
851 discoverNodes(ValueInfo(HaveGVs, &S), FunctionHasParent);
854 std::vector<FunctionSummary::EdgeTy> Edges;
856 for (
auto &
P : FunctionHasParent) {
859 Edges.push_back(std::make_pair(
P.first,
CalleeInfo{}));
866 return CallGraphRoot;
870 return WithGlobalValueDeadStripping;
873 WithGlobalValueDeadStripping =
true;
877 return SkipModuleByDistributedBackend;
880 SkipModuleByDistributedBackend =
true;
884 return !WithGlobalValueDeadStripping || GVS->
isLive();
890 ValueInfo
getValueInfo(
const GlobalValueSummaryMapTy::value_type &R)
const {
891 return ValueInfo(HaveGVs, &R);
896 auto I = GlobalValueMap.find(GUID);
897 return ValueInfo(HaveGVs,
I == GlobalValueMap.end() ? nullptr : &*
I);
902 return ValueInfo(HaveGVs, getOrInsertValuePtr(GUID));
913 auto VP = getOrInsertValuePtr(GUID);
914 VP->second.U.Name =
Name;
915 return ValueInfo(HaveGVs, VP);
921 auto VP = getOrInsertValuePtr(GV->
getGUID());
922 VP->second.U.GV = GV;
923 return ValueInfo(HaveGVs, VP);
928 const auto I = OidGuidMap.find(OriginalID);
929 return I == OidGuidMap.end() ? 0 :
I->second;
940 std::unique_ptr<GlobalValueSummary> Summary) {
941 addGlobalValueSummary(getOrInsertValueInfo(&GV), std::move(Summary));
946 std::unique_ptr<GlobalValueSummary> Summary) {
953 std::unique_ptr<GlobalValueSummary> Summary) {
954 addOriginalName(VI.
getGUID(), Summary->getOriginalName());
957 const_cast<GlobalValueSummaryMapTy::value_type *
>(VI.
getRef())
958 ->
second.SummaryList.push_back(std::move(Summary));
964 if (OrigGUID == 0 || ValueGUID == OrigGUID)
966 if (OidGuidMap.count(OrigGUID) && OidGuidMap[OrigGUID] != ValueGUID)
967 OidGuidMap[OrigGUID] = 0;
969 OidGuidMap[OrigGUID] = ValueGUID;
982 [&](
const std::unique_ptr<GlobalValueSummary> &Summary) {
983 return Summary->modulePath() == ModuleId;
985 if (Summary ==
CalleeInfo.getSummaryList().end())
987 return Summary->get();
993 bool PerModuleIndex =
true)
const {
994 assert(GV.
hasName() &&
"Can't get GlobalValueSummary for GV with no name");
995 return getGlobalValueSummary(GV.
getGUID(), PerModuleIndex);
1002 bool PerModuleIndex =
true)
const;
1006 return ModulePathStringTable;
1011 return ModulePathStringTable;
1016 return ModulePathStringTable.
lookup(ModPath).first;
1021 auto It = ModulePathStringTable.
find(ModPath);
1022 assert(It != ModulePathStringTable.
end() &&
"Module not registered");
1023 return It->second.second;
1030 NewName +=
".llvm.";
1031 NewName +=
utostr((uint64_t(ModHash[0]) << 32) |
1033 return NewName.
str();
1039 std::pair<StringRef, StringRef> Pair = Name.
split(
".llvm.");
1049 return &*ModulePathStringTable.
insert({ModPath, {ModId, Hash}}).
first;
1054 auto It = ModulePathStringTable.
find(ModPath);
1055 assert(It != ModulePathStringTable.
end() &&
"Module not registered");
1066 const std::map<std::string, TypeIdSummary> &
typeIds()
const {
1073 return TypeIdMap[TypeId];
1079 auto I = TypeIdMap.find(TypeId);
1080 if (
I == TypeIdMap.end())
1087 void collectDefinedFunctionsForModule(
StringRef ModulePath,
1092 void collectDefinedGVSummariesPerModule(
1117 decltype(&valueInfoFromEdge)>;
1125 &valueInfoFromEdge);
1127 cast<FunctionSummary>(N.
getSummaryList().front()->getBaseObject());
1135 &valueInfoFromEdge);
1137 cast<FunctionSummary>(N.
getSummaryList().front()->getBaseObject());
1145 std::unique_ptr<GlobalValueSummary> Root =
1148 G.SummaryList.push_back(std::move(Root));
1151 return ValueInfo(I->
haveGVs(), &
P);
1157 #endif // LLVM_IR_MODULESUMMARYINDEX_H static FunctionSummary::ConstVCall getEmptyKey()
unsigned Live
In per-module summary, indicate that the global value must be considered a live root for index-based ...
void setNotEligibleToImport()
Flag that this global value cannot be imported.
static bool classof(const GlobalValueSummary *GVS)
Check if this is an alias summary.
bool operator==(const BinaryRef &LHS, const BinaryRef &RHS)
static FunctionSummary::ConstVCall getTombstoneKey()
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
std::vector< std::unique_ptr< GlobalValueSummary > > GlobalValueSummaryList
uint64_t GUID
Declare a type to represent a global unique identifier for a global value.
Compute iterated dominance frontiers using a linear time algorithm.
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
ValueInfo getValueInfo(GlobalValue::GUID GUID) const
Return a ValueInfo for GUID if it exists, otherwise return ValueInfo().
unsigned Linkage
The linkage type of the associated global value.
const GlobalValueSummary & getAliasee() const
StringRef Name
Summary string representation.
A Module instance is used to store all the information related to an LLVM module. ...
GlobalValueSummary * findSummaryInModule(GlobalValue::GUID ValueGUID, StringRef ModuleId) const
Find the summary for global GUID in module ModuleId, or nullptr if not found.
GlobalValueSummary * getGlobalValueSummary(const GlobalValue &GV, bool PerModuleIndex=true) const
Returns the first GlobalValueSummary for GV, asserting that there is only one if PerModuleIndex.
const GlobalValue * getValue() const
ArrayRef< VFuncId > type_test_assume_vcalls() const
Returns the list of virtual calls made by this function using llvm.assume(llvm.type.test) intrinsics that do not have all constant integer arguments.
Global variable summary information to aid decisions and implementation of importing.
Unsatisfiable type (i.e. no global has this type metadata)
void addTypeTest(GlobalValue::GUID Guid)
Add a type test to the summary.
ArrayRef< ValueInfo > refs() const
Return the list of values referenced by this global value definition.
static void discoverNodes(ValueInfo V, std::map< ValueInfo, bool > &FunctionHasParent)
Convenience function for doing a DFS on a ValueInfo.
GlobalValueSummaryMapTy::iterator gvsummary_iterator
iterator find(StringRef Key)
const StringMap< std::pair< uint64_t, ModuleHash > > & modulePaths() const
Table of modules, containing module hash and id.
GlobalValue::LinkageTypes linkage() const
Return linkage type recorded for this global value.
std::vector< VFuncId > TypeTestAssumeVCalls
List of virtual calls made by this function using (respectively) llvm.assume(llvm.type.test) or llvm.type.checked.load intrinsics that do not have all constant integer arguments.
static StringRef getOriginalNameBeforePromote(StringRef Name)
Helper to obtain the unpromoted name for a global value (or the original name if not promoted)...
const std::set< std::string > & cfiFunctionDecls() const
bool isGlobalValueLive(const GlobalValueSummary *GVS) const
FunctionSummary(GVFlags Flags, unsigned NumInsts, FFlags FunFlags, std::vector< ValueInfo > Refs, std::vector< EdgeTy > CGEdges, std::vector< GlobalValue::GUID > TypeTests, std::vector< VFuncId > TypeTestAssumeVCalls, std::vector< VFuncId > TypeCheckedLoadVCalls, std::vector< ConstVCall > TypeTestAssumeConstVCalls, std::vector< ConstVCall > TypeCheckedLoadConstVCalls)
Kind
Specifies which kind of type check we should emit for this byte array.
static unsigned getHashValue(ValueInfo I)
Virtual constant propagation.
const TypeIdSummary * getTypeIdSummary(StringRef TypeId) const
This returns either a pointer to the type id summary (if present in the summary map) or null (if not ...
std::map< uint64_t, WholeProgramDevirtResolution > WPDRes
Mapping from byte offset to whole-program devirt resolution for that (typeid, byte offset) pair...
StringMap< std::pair< uint64_t, ModuleHash > > & modulePaths()
Table of modules, containing hash and id.
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
bool hasExportedFunctions(const Module &M) const
Check if the given Module has any functions available for exporting in the index. ...
static bool isSpecialKey(ValueInfo V)
void addOriginalName(GlobalValue::GUID ValueGUID, GlobalValue::GUID OrigGUID)
Add an original name for the value of the given GUID.
static bool isEqual(ValueInfo L, ValueInfo R)
const GlobalValue * GV
The GlobalValue corresponding to this summary.
uint32_t RelBlockFreq
The value stored in RelBlockFreq has to be interpreted as the digits of a scaled number with a scale ...
unsigned NotEligibleToImport
Indicate if the global value cannot be imported (e.g.
GlobalValue::GUID getGUID() const
bool skipModuleByDistributedBackend() const
ModuleInfo * getModule(StringRef ModPath)
Return module entry for module with the given ModPath.
static unsigned getHashValue(FunctionSummary::VFuncId I)
const_gvsummary_iterator begin() const
static std::string getGlobalNameForLocal(StringRef Name, ModuleHash ModHash)
Convenience method for creating a promoted global name for the given value name of a local...
std::array< uint32_t, 5 > ModuleHash
160 bits SHA1
void setSkipModuleByDistributedBackend()
Just do a regular virtual call.
std::map< GlobalValue::GUID, GlobalValueSummaryInfo > GlobalValueSummaryMapTy
Map from global value GUID to corresponding summary structures.
ArrayRef< GlobalValue::GUID > type_tests() const
Returns the list of type identifiers used by this function in llvm.type.test intrinsics other than by...
void setWithGlobalValueDeadStripping()
StringRef str() const
Explicit conversion to StringRef.
Uniform return value optimization.
ArrayRef< ConstVCall > type_checked_load_const_vcalls() const
Returns the list of virtual calls made by this function using llvm.type.checked.load intrinsics with ...
const std::map< std::string, TypeIdSummary > & typeIds() const
static NodeRef getEntryNode(ValueInfo V)
static bool isEqual(const Function &Caller, const Function &Callee)
ArrayRef< VFuncId > type_checked_load_vcalls() const
Returns the list of virtual calls made by this function using llvm.type.checked.load intrinsics that ...
std::pair< ValueInfo, CalleeInfo > EdgeTy
<CalleeValueInfo, CalleeInfo> call edge pair.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
TypeIdSummary & getOrInsertTypeIdSummary(StringRef TypeId)
This accessor should only be used when exporting because it can mutate the map.
ModulePathStringTableTy::value_type ModuleInfo
Class to hold module path string table and global value map, and encapsulate methods for operating on...
ArrayRef< std::unique_ptr< GlobalValueSummary > > getSummaryList() const
static bool isEqual(FunctionSummary::VFuncId L, FunctionSummary::VFuncId R)
ForceSummaryHotnessType
Types for -force-summary-edges-cold debugging option.
static unsigned getHashValue(FunctionSummary::ConstVCall I)
GlobalValueSummaryMapTy::const_iterator const_gvsummary_iterator
Type used for iterating through the global value summary map.
static FunctionSummary::VFuncId getEmptyKey()
GlobalValue::GUID getGUIDFromOriginalID(GlobalValue::GUID OriginalID) const
Return the GUID for OriginalId in the OidGuidMap.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
Allocate memory in an ever growing pool, as if by bump-pointer.
static bool classof(const GlobalValueSummary *GVS)
Check if this is a global variable summary.
ValueInfo(bool HaveGVs, const GlobalValueSummaryMapTy::value_type *R)
SummaryKind getSummaryKind() const
Which kind of summary subclass this is.
const std::set< std::string > & cfiFunctionDefs() const
unsigned instCount() const
Get the instruction count recorded for this function.
std::vector< uint64_t > Args
static ValueInfo getEmptyKey()
CalleeInfo(HotnessType Hotness, uint64_t RelBF)
Class to accumulate and hold information about a callee.
Single element (last example in "Short Inline Bit Vectors")
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
const ModuleHash & getModuleHash(const StringRef ModPath) const
Get the module SHA1 hash recorded for the given module path.
GlobalValue::GUID getOriginalName() const
Returns the hash of the original name, it is identical to the GUID for externally visible symbols...
ValueTy lookup(StringRef Key) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
ValueInfo getOrInsertValueInfo(const GlobalValue *GV)
Return a ValueInfo for GV and mark it as belonging to GV.
auto find_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
All type identifier related information.
Function and variable summary information to aid decisions and implementation of importing.
static GUID getGUID(StringRef GlobalName)
Return a 64-bit global unique ID constructed from global value name (i.e.
const_gvsummary_iterator end() const
static ValueInfo getTombstoneKey()
const std::string & getModuleIdentifier() const
Get the module identifier which is, essentially, the name of the module.
GVFlags flags() const
Get the flags for this GlobalValue (see struct GVFlags).
void addGlobalValueSummary(StringRef ValueName, std::unique_ptr< GlobalValueSummary > Summary)
Add a global value summary for a value of the given name.
ModuleSummaryIndex(bool HaveGVs)
An "identifier" for a virtual function.
ArrayRef< ConstVCall > type_test_assume_const_vcalls() const
Returns the list of virtual calls made by this function using llvm.assume(llvm.type.test) intrinsics with all constant integer arguments.
void addGlobalValueSummary(ValueInfo VI, std::unique_ptr< GlobalValueSummary > Summary)
Add a global value summary for the given ValueInfo.
Struct that holds a reference to a particular GUID in a global value summary.
StringRef saveString(std::string String)
HotnessType getHotness() const
void updateHotness(const HotnessType OtherHotness)
ModuleInfo * addModule(StringRef ModPath, uint64_t ModId, ModuleHash Hash=ModuleHash{{0}})
Add a new module with the given Hash, mapped to the given ModID, and return a reference to the module...
static bool classof(const GlobalValueSummary *GVS)
Check if this is a function summary.
GlobalValueSummary * getBaseObject()
If this is an alias summary, returns the summary of the aliased object (a global variable or function...
void setDSOLocal(bool Local)
static ChildIteratorType child_end(NodeRef N)
Module.h This file contains the declarations for the Module class.
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
Single implementation devirtualization.
ValueInfo getOrInsertValueInfo(GlobalValue::GUID GUID, StringRef Name)
Return a ValueInfo for GUID setting value Name.
uint64_t getModuleId(const StringRef ModPath) const
Get the module ID recorded for the given module path.
Alias summary information.
static NodeRef getEntryNode(ModuleSummaryIndex *I)
std::string utostr(uint64_t X, bool isNeg=false)
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
std::string SingleImplName
static FunctionSummary makeDummyFunctionSummary(std::vector< FunctionSummary::EdgeTy > Edges)
Create an empty FunctionSummary (with specified call edges).
StringRef save(const char *S)
A specification for a virtual function call with all constant integer arguments.
LinkageTypes
An enumeration for the kinds of linkage for global values.
GUID getGUID() const
Return a 64-bit global unique ID constructed from global value name (i.e.
SummaryKind
Sububclass discriminator (for dyn_cast<> et al.)
PointerIntPair< const GlobalValueSummaryMapTy::value_type *, 1, bool > RefAndFlag
ValueInfo getValueInfo(const GlobalValueSummaryMapTy::value_type &R) const
Return a ValueInfo for the index value_type (convenient when iterating index).
ValueInfo getOrInsertValueInfo(GlobalValue::GUID GUID)
Return a ValueInfo for GUID.
bool withGlobalValueDeadStripping() const
FFlags fflags() const
Get function attribute flags.
GlobalValueSummary(SummaryKind K, GVFlags Flags, std::vector< ValueInfo > Refs)
std::set< std::string > & cfiFunctionDefs()
bool operator!=(uint64_t V1, const APInt &V2)
Test a byte array (first example)
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer...
GlobalVarSummary(GVFlags Flags, std::vector< ValueInfo > Refs)
FunctionSummary calculateCallGraphRoot()
std::map< std::vector< uint64_t >, ByArg > ResByArg
Resolutions for calls with all constant integer arguments (excluding the first argument, "this"), where the key is the argument vector.
StringRef modulePath() const
Get the path to the module containing this function.
void setLinkage(GlobalValue::LinkageTypes Linkage)
Sets the linkage to the value determined by global summary-based optimization.
unsigned DSOLocal
Indicates that the linker resolved the symbol to a definition from within the same linkage unit...
void addGlobalValueSummary(const GlobalValue &GV, std::unique_ptr< GlobalValueSummary > Summary)
Add a global value summary for a value.
GVFlags(GlobalValue::LinkageTypes Linkage, bool NotEligibleToImport, bool Live, bool IsLocal)
Convenience Constructors.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
ArrayRef< EdgeTy > calls() const
Return the list of <CalleeValueInfo, CalleeInfo> pairs.
void setOriginalName(GlobalValue::GUID Name)
Initialize the original name hash in this summary.
static NodeRef valueInfoFromEdge(FunctionSummary::EdgeTy &P)
Function attribute flags.
Inlined bit vector ("Short Inline Bit Vectors")
Function summary information to aid decisions and implementation of importing.
GlobalValueSummary & getAliasee()
void setModulePath(StringRef ModPath)
Set the path to the module containing this function, for use in the combined index.
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
bool notEligibleToImport() const
Return true if this global value can't be imported.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::set< std::string > & cfiFunctionDecls()
void setAliaseeGUID(GlobalValue::GUID GUID)
bool operator<(int64_t V1, const APSInt &V2)
ScaledNumber< uint64_t > Scaled64
static FunctionSummary::VFuncId getTombstoneKey()
static ChildIteratorType child_begin(NodeRef N)
Just do a regular virtual call.
void setAliasee(GlobalValueSummary *Aliasee)
Group flags (Linkage, NotEligibleToImport, etc.) as a bitfield.
This class implements an extremely fast bulk output stream that can only output to a stream...
gvsummary_iterator begin()
const GlobalValue::GUID & getAliaseeGUID() const
StringRef - Represent a constant reference to a string, i.e.
const GlobalValueSummaryMapTy::value_type * getRef() const
AliasSummary(GVFlags Flags)
static bool isEqual(FunctionSummary::ConstVCall L, FunctionSummary::ConstVCall R)
GlobalValueSummaryInfo(bool HaveGVs)
GraphTraits definition to build SCC for the index.
unsigned ReturnDoesNotAlias
void updateRelBlockFreq(uint64_t BlockFreq, uint64_t EntryFreq)
Update RelBlockFreq from BlockFreq and EntryFreq.
GlobalValueSummaryList SummaryList
List of global value summary structures for a particular value held in the GlobalValueMap.
Unique return value optimization.
std::vector< GlobalValue::GUID > TypeTests
List of type identifiers used by this function in llvm.type.test intrinsics referenced by something o...
static FunctionSummary ExternalNode
A dummy node to reference external functions that aren't in the index.
std::vector< ConstVCall > TypeTestAssumeConstVCalls
List of virtual calls made by this function using (respectively) llvm.assume(llvm.type.test) or llvm.type.checked.load intrinsics with all constant integer arguments.