52 #include <system_error>
59 "static-func-full-module-prefix",
cl::init(
true),
60 cl::desc(
"Use full module build paths in the profile counter names for "
61 "static functions."));
72 "static-func-strip-dirname-prefix",
cl::init(0),
73 cl::desc(
"Strip specified level of directory name from source path in "
74 "the profile counter name for static functions."));
83 return "Unrecognized instrumentation profile encoding format";
85 return "Invalid instrumentation profile data (bad magic)";
87 return "Invalid instrumentation profile data (file header is corrupt)";
89 return "Unsupported instrumentation profile format version";
91 return "Unsupported instrumentation profile hash type";
93 return "Too much profile data";
95 return "Truncated profile data";
97 return "Malformed instrumentation profile data";
99 return "No profile data available for function";
101 return "Function control flow change detected (hash mismatch)";
103 return "Function basic block count change detected (counter mismatch)";
105 return "Counter overflow";
107 return "Function value site count change detected (counter mismatch)";
109 return "Failed to compress data (zlib)";
111 return "Failed to uncompress data (zlib)";
113 return "Empty raw profile file";
124 const char *
name()
const noexcept
override {
return "llvm.instrprof"; }
126 std::string message(
int IE)
const override {
141 const char *InstrProfSectNameCommon[] = {
142 #define INSTR_PROF_SECT_ENTRY(Kind, SectNameCommon, SectNameCoff, Prefix) \
147 const char *InstrProfSectNameCoff[] = {
148 #define INSTR_PROF_SECT_ENTRY(Kind, SectNameCommon, SectNameCoff, Prefix) \
153 const char *InstrProfSectNamePrefix[] = {
154 #define INSTR_PROF_SECT_ENTRY(Kind, SectNameCommon, SectNameCoff, Prefix) \
165 bool AddSegmentInfo) {
166 std::string SectName;
169 SectName = InstrProfSectNamePrefix[IPSK];
172 SectName += InstrProfSectNameCoff[IPSK];
174 SectName += InstrProfSectNameCommon[IPSK];
176 if (OF ==
Triple::MachO && IPSK == IPSK_data && AddSegmentInfo)
177 SectName +=
",regular,live_support";
194 ++NumCountMismatches;
197 ++NumCounterOverflows;
200 ++NumValueSiteCountMismatches;
226 for (
auto & CI : PathNameStr) {
235 return PathNameStr.substr(LastPos);
263 StringRef S = cast<MDString>(MD->getOperand(0))->getString();
274 if (FileName.
empty())
293 const char *InvalidChars =
"-:<>/\"'";
294 size_t found = VarName.find_first_of(InvalidChars);
295 while (found != std::string::npos) {
296 VarName[found] =
'_';
297 found = VarName.find_first_of(InvalidChars, found + 1);
347 auto pos = PGOFuncName.find(
'.');
348 if (pos != std::string::npos) {
349 const std::string &OtherFuncName = PGOFuncName.substr(0, pos);
362 bool doCompression, std::string &Result) {
363 assert(!NameStrs.
empty() &&
"No name data to emit");
365 uint8_t Header[16], *
P = Header;
366 std::string UncompressedNameStrings =
371 "PGO name is invalid (contains separator token)");
373 unsigned EncLen =
encodeULEB128(UncompressedNameStrings.length(),
P);
376 auto WriteStringToResult = [&](
size_t CompressedLen,
StringRef InputStr) {
379 char *HeaderStr =
reinterpret_cast<char *
>(&Header[0]);
380 unsigned HeaderLen = P - &Header[0];
381 Result.append(HeaderStr, HeaderLen);
386 if (!doCompression) {
387 return WriteStringToResult(0, UncompressedNameStrings);
398 return WriteStringToResult(CompressedNameStrings.
size(),
399 CompressedNameStrings);
405 Arr->isCString() ? Arr->getAsCString() : Arr->getAsString();
410 std::string &Result,
bool doCompression) {
411 std::vector<std::string> NameStrs;
412 for (
auto *NameVar : NameVars) {
420 const uint8_t *
P =
reinterpret_cast<const uint8_t *
>(NameStrings.
data());
421 const uint8_t *EndP =
reinterpret_cast<const uint8_t *
>(NameStrings.
data() +
429 bool isCompressed = (CompressedSize != 0);
433 StringRef CompressedNameStrings(reinterpret_cast<const char *>(P),
443 UncompressedNameStrings.
size());
446 StringRef(reinterpret_cast<const char *>(P), UncompressedSize);
447 P += UncompressedSize;
456 while (P < EndP && *P == 0)
472 while (
I !=
IE &&
I->Value < J->Value)
474 if (
I !=
IE &&
I->Value == J->Value) {
498 void InstrProfRecord::mergeValueProfData(
503 if (ThisNumValueSites != OtherNumValueSites) {
507 if (!ThisNumValueSites)
509 std::vector<InstrProfValueSiteRecord> &ThisSiteRecords =
510 getOrCreateValueSitesForKind(ValueKind);
512 Src.getValueSitesForKind(ValueKind);
514 ThisSiteRecords[
I].
merge(OtherSiteRecords[
I], Weight, Warn);
526 for (
size_t I = 0,
E = Other.
Counts.size();
I <
E; ++
I) {
535 mergeValueProfData(
Kind, Other, Weight, Warn);
538 void InstrProfRecord::scaleValueProfData(
539 uint32_t ValueKind, uint64_t Weight,
541 for (
auto &R : getValueSitesForKind(ValueKind))
542 R.scale(Weight, Warn);
547 for (
auto &Count : this->
Counts) {
554 scaleValueProfData(
Kind, Weight, Warn);
558 uint64_t InstrProfRecord::remapValue(uint64_t
Value,
uint32_t ValueKind,
563 case IPVK_IndirectCallTarget: {
565 std::lower_bound(ValueMap->begin(), ValueMap->end(), Value,
566 [](
const std::pair<uint64_t, uint64_t> &LHS,
567 uint64_t RHS) {
return LHS.first < RHS; });
572 if (Result != ValueMap->end() && Result->first == Value)
573 Value = (uint64_t)Result->second;
586 VData[
I].Value = remapValue(VData[
I].Value, ValueKind, ValueMap);
588 std::vector<InstrProfValueSiteRecord> &ValueSites =
589 getOrCreateValueSitesForKind(ValueKind);
591 ValueSites.emplace_back();
593 ValueSites.emplace_back(VData, VData + N);
596 #define INSTR_PROF_COMMON_API_IMPL
605 return reinterpret_cast<const InstrProfRecord *
>(Record)->getNumValueKinds();
610 ->getNumValueSites(VKind);
615 ->getNumValueData(VKind);
621 ->getNumValueDataForSite(VK, S);
626 reinterpret_cast<const InstrProfRecord *
>(R)->getValueForSite(Dst, K, S);
631 (ValueProfData *)(
new (::
operator new(TotalSizeInBytes)) ValueProfData());
632 memset(VD, 0, TotalSizeInBytes);
649 Closure.Record = &Record;
650 return getValueProfDataSize(&Closure);
654 std::unique_ptr<ValueProfData>
658 std::unique_ptr<ValueProfData> VPD(
667 InstrProfValueData *ValueData = getValueProfRecordValueData(
this);
668 for (uint64_t VSite = 0; VSite < NumValueSites; ++VSite) {
669 uint8_t ValueDataCount = this->SiteCountArray[VSite];
671 ValueData += ValueDataCount;
680 using namespace support;
686 sys::swapByteOrder<uint32_t>(NumValueSites);
687 sys::swapByteOrder<uint32_t>(
Kind);
689 uint32_t ND = getValueProfRecordNumValueData(
this);
690 InstrProfValueData *VD = getValueProfRecordValueData(
this);
694 sys::swapByteOrder<uint64_t>(VD[
I].Value);
695 sys::swapByteOrder<uint64_t>(VD[
I].Count);
698 sys::swapByteOrder<uint32_t>(NumValueSites);
699 sys::swapByteOrder<uint32_t>(
Kind);
705 if (NumValueKinds == 0)
708 ValueProfRecord *VR = getFirstValueProfRecord(
this);
709 for (
uint32_t K = 0; K < NumValueKinds; K++) {
710 VR->deserializeTo(Record, VMap);
711 VR = getValueProfRecordNext(VR);
717 using namespace support;
720 return endian::readNext<T, little, unaligned>(
D);
722 return endian::readNext<T, big, unaligned>(
D);
726 return std::unique_ptr<ValueProfData>(
new (::operator
new(TotalSize))
730 Error ValueProfData::checkIntegrity() {
731 if (NumValueKinds > IPVK_Last + 1)
734 if (TotalSize %
sizeof(uint64_t))
737 ValueProfRecord *VR = getFirstValueProfRecord(
this);
738 for (
uint32_t K = 0; K < this->NumValueKinds; K++) {
739 if (VR->Kind > IPVK_Last)
741 VR = getValueProfRecordNext(VR);
742 if ((
char *)VR - (
char *)
this > (
ptrdiff_t)TotalSize)
749 ValueProfData::getValueProfData(
const unsigned char *
D,
750 const unsigned char *
const BufferEnd,
752 using namespace support;
754 if (D +
sizeof(ValueProfData) > BufferEnd)
757 const unsigned char *Header =
D;
758 uint32_t TotalSize = swapToHostOrder<uint32_t>(Header, Endianness);
759 if (D + TotalSize > BufferEnd)
763 memcpy(VPD.get(),
D, TotalSize);
765 VPD->swapBytesToHost(Endianness);
767 Error E = VPD->checkIntegrity();
771 return std::move(VPD);
775 using namespace support;
780 sys::swapByteOrder<uint32_t>(TotalSize);
781 sys::swapByteOrder<uint32_t>(NumValueKinds);
783 ValueProfRecord *VR = getFirstValueProfRecord(
this);
784 for (
uint32_t K = 0; K < NumValueKinds; K++) {
786 VR = getValueProfRecordNext(VR);
791 using namespace support;
796 ValueProfRecord *VR = getFirstValueProfRecord(
this);
797 for (
uint32_t K = 0; K < NumValueKinds; K++) {
798 ValueProfRecord *NVR = getValueProfRecordNext(VR);
802 sys::swapByteOrder<uint32_t>(TotalSize);
803 sys::swapByteOrder<uint32_t>(NumValueKinds);
815 std::unique_ptr<InstrProfValueData[]> VD =
840 for (
auto &VD : VDs) {
854 InstrProfValueData ValueData[],
855 uint32_t &ActualNumValueData, uint64_t &TotalC) {
886 ActualNumValueData = 0;
888 for (
unsigned I = 3;
I < NOps;
I += 2) {
889 if (ActualNumValueData >= MaxNumValueData)
893 mdconst::dyn_extract<ConstantInt>(MD->
getOperand(
I + 1));
894 if (!Value || !Count)
897 ValueData[ActualNumValueData].Count = Count->getZExtValue();
898 ActualNumValueData++;
909 if (PGOFuncName == F.
getName())
924 if (!TT.isOSBinFormatELF() && !TT.isOSBinFormatWasm())
949 if (!IRInstrVar || IRInstrVar->isDeclaration() ||
950 IRInstrVar->hasLocalLinkage())
954 if (!IRInstrVar->hasInitializer())
957 const Constant *InitVal = IRInstrVar->getInitializer();
961 return (dyn_cast<ConstantInt>(InitVal)->getZExtValue() &
962 VARIANT_MASK_IR_PROF) != 0;
990 int64_t &RangeLast) {
991 static const int64_t DefaultMemOPSizeRangeStart = 0;
992 static const int64_t DefaultMemOPSizeRangeLast = 8;
993 RangeStart = DefaultMemOPSizeRangeStart;
994 RangeLast = DefaultMemOPSizeRangeLast;
996 if (!MemOPSizeRange.
empty()) {
997 auto Pos = MemOPSizeRange.
find(
':');
998 if (Pos != std::string::npos) {
1001 if (Pos < MemOPSizeRange.
size() - 1)
1006 assert(RangeLast >= RangeStart);
void setVisibility(VisibilityTypes V)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
void getValueForSiteInstrProf(const void *R, InstrProfValueData *Dst, uint32_t K, uint32_t S)
std::enable_if< std::numeric_limits< T >::is_signed, bool >::type getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
void push_back(const T &Elt)
bool is_separator(char value, Style style=Style::native)
Check whether the given char is a path separator on the host OS.
LinkageTypes getLinkage() const
A symbol table used for function PGO name look-up with keys (such as pointers, md5hash values) to the...
static Constant * getString(LLVMContext &Context, StringRef Initializer, bool AddNull=true)
This method constructs a CDS and initializes it with a text string.
void merge(InstrProfRecord &Other, uint64_t Weight, function_ref< void(instrprof_error)> Warn)
Merge the counts in Other into this one.
static StringRef stripDirPrefix(StringRef PathNameStr, uint32_t NumPrefix)
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
DiagnosticInfoOptimizationBase::Argument NV
StringRef getInstrProfNameVarPrefix()
Return the name prefix of variables containing instrumented function names.
uint32_t getNumValueDataInstrProf(const void *Record, uint32_t VKind)
static cl::opt< unsigned > StaticFuncStripDirNamePrefix("static-func-strip-dirname-prefix", cl::init(0), cl::desc("Strip specified level of directory name from source path in ""the profile counter name for static functions."))
ConstantAsMetadata * createConstant(Constant *C)
Return the given constant as metadata.
A Module instance is used to store all the information related to an LLVM module. ...
GUID getGUID() const
Return a 64-bit global unique ID constructed from global value name (i.e.
static MDString * get(LLVMContext &Context, StringRef Str)
Available for inspection, not emission.
unsigned getNumOperands() const
Return number of MDNode operands.
bool canRenameComdatFunc(const Function &F, bool CheckAddressTaken=false)
Check if we can safely rename this Comdat function.
MDNode * getPGOFuncNameMetadata(const Function &F)
Return the PGOFuncName meta data associated with a function.
An efficient, type-erasing, non-owning reference to a callable.
Like Internal, but omit from symbol table.
Externally visible function.
static std::unique_ptr< ValueProfData > allocValueProfData(uint32_t TotalSize)
static T swapToHostOrder(const unsigned char *&D, support::endianness Orig)
std::string getInstrProfSectionName(InstrProfSectKind IPSK, Triple::ObjectFormatType OF, bool AddSegmentInfo=true)
Return the name of the profile section corresponding to IPSK.
static IntegerType * getInt64Ty(LLVMContext &C)
const Constant * getInitializer() const
getInitializer - Return the initializer for this global variable.
const std::string & getTargetTriple() const
Get the target triple which is a string describing the target host.
std::enable_if< std::is_unsigned< T >::value, T >::type SaturatingMultiply(T X, T Y, bool *ResultOverflowed=nullptr)
Multiply two unsigned integers, X and Y, of type T.
void reserveSites(uint32_t ValueKind, uint32_t NumValueSites)
Reserve space for NumValueSites sites.
static bool isLocalLinkage(LinkageTypes Linkage)
uint32_t getNumValueKindsInstrProf(const void *Record)
ValueProfRecordClosure Interface implementation for InstrProfRecord class.
StringRef getName() const
Return a constant reference to the value's name.
void merge(InstrProfValueSiteRecord &Input, uint64_t Weight, function_ref< void(instrprof_error)> Warn)
Merge data from another InstrProfValueSiteRecord Optionally scale merged counts by Weight...
StringRef getName() const
Get a short "name" for the module.
const GlobalVariable * getNamedGlobal(StringRef Name) const
Return the global variable in the module with the specified name, of arbitrary type.
static cl::opt< bool > StaticFuncFullModulePrefix("static-func-full-module-prefix", cl::init(true), cl::desc("Use full module build paths in the profile counter names for ""static functions."))
void scale(uint64_t Weight, function_ref< void(instrprof_error)> Warn)
Scale up profile counts (including value profile data) by Weight.
const std::error_category & instrprof_category()
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
Error collectPGOFuncNameStrings(ArrayRef< std::string > NameStrs, bool doCompression, std::string &Result)
Given a vector of strings (function PGO names) NameStrs, the method generates a combined string Resul...
std::string join(IteratorT Begin, IteratorT End, StringRef Separator)
Joins the strings in the range [Begin, End), adding Separator between the elements.
Tagged union holding either a T or a Error.
std::unique_ptr< InstrProfValueData[]> getValueForSite(uint32_t ValueKind, uint32_t Site, uint64_t *TotalC=nullptr) const
Return the array of profiled values at Site.
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
StringRef getFuncNameWithoutPrefix(StringRef PGOFuncName, StringRef FileName="<unknown>")
Given a PGO function name, remove the filename prefix and return the original (static) function name...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
StringRef getInstrProfNameSeparator()
Return the marker used to separate PGO names during serialization.
void addError(instrprof_error IE)
Track a soft error (IE) and increment its associated counter.
auto count(R &&Range, const E &Element) -> typename std::iterator_traits< decltype(std::begin(Range))>::difference_type
Wrapper function around std::count to count the number of times an element Element occurs in the give...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
bool isDiscardableIfUnused() const
size_t size() const
size - Get the array size.
bool isIRPGOFlagSet(const Module *M)
Check if INSTR_PROF_RAW_VERSION_VAR is defined.
static ManagedStatic< InstrProfErrorCategoryType > ErrorCategory
std::string message() const override
Return the error message as a string.
ExternalWeak linkage description.
void getMemOPSizeRangeFromOption(StringRef Str, int64_t &RangeStart, int64_t &RangeLast)
bool needsComdatForCounter(const Function &F, const Module &M)
Check if we can use Comdat for profile variables.
Same, but only replaced by something equivalent.
initializer< Ty > init(const Ty &Val)
bool getValueProfDataFromInst(const Instruction &Inst, InstrProfValueKind ValueKind, uint32_t MaxNumValueData, InstrProfValueData ValueData[], uint32_t &ActualNumValueData, uint64_t &TotalC)
Extract the value profile data from Inst which is annotated with value profile meta data...
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
void scale(uint64_t Weight, function_ref< void(instrprof_error)> Warn)
Scale up value profile data counts.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t find(char C, size_t From=0) const
Search for the first character C in the string.
std::string getPGOFuncNameVarName(StringRef FuncName, GlobalValue::LinkageTypes Linkage)
Return the name of the global variable used to store a function name in PGO instrumentation.
This is an important class for using LLVM in a threaded context.
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static ValueProfRecordClosure InstrProfRecordClosure
std::vector< std::pair< uint64_t, uint64_t >> ValueMapType
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
ValueProfData * allocValueProfDataInstrProf(size_t TotalSizeInBytes)
static ManagedStatic< _object_error_category > error_category
uint64_t decodeULEB128(const uint8_t *p, unsigned *n=nullptr, const uint8_t *end=nullptr, const char **error=nullptr)
Utility function to decode a ULEB128 value.
#define LLVM_ATTRIBUTE_UNUSED
std::list< InstrProfValueData > ValueData
Value profiling data pairs at a given value site.
bool empty() const
empty - Check if the array is empty.
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
void annotateValueSite(Module &M, Instruction &Inst, const InstrProfRecord &InstrProfR, InstrProfValueKind ValueKind, uint32_t SiteIndx, uint32_t MaxMDCount=3)
Get the value profile data for value site SiteIdx from InstrProfR and annotate the instruction Inst w...
Value(Type *Ty, unsigned scid)
void consumeError(Error Err)
Consume a Error without doing anything.
uint32_t getNumValueDataForSite(uint32_t ValueKind, uint32_t Site) const
Return the number of value data collected for ValueKind at profiling site: Site.
void createPGOFuncNameMetadata(Function &F, StringRef PGOFuncName)
Create the PGOFuncName meta data if PGOFuncName is different from function's raw name.
Error readPGOFuncNameStrings(StringRef NameStrings, InstrProfSymtab &Symtab)
NameStrings is a string composed of one of more sub-strings encoded in the format described above...
void setMetadata(unsigned KindID, MDNode *Node)
Set the metadata of the specified kind to the specified node.
Triple - Helper class for working with autoconf configuration names.
void addValueData(uint32_t ValueKind, uint32_t Site, InstrProfValueData *VData, uint32_t N, ValueMapType *ValueMap)
Add ValueData for ValueKind at value Site.
std::enable_if< std::is_unsigned< T >::value, T >::type SaturatingMultiplyAdd(T X, T Y, T A, bool *ResultOverflowed=nullptr)
Multiply two unsigned integers, X and Y, and add the unsigned integer, A to the product.
StringRef getString() const
Error create(object::SectionRef &Section)
Create InstrProfSymtab from an object file section which contains function PGO names.
const MDOperand & getOperand(unsigned I) const
static ErrorSuccess success()
Create a success value.
Error compress(StringRef InputBuffer, SmallVectorImpl< char > &CompressedBuffer, CompressionLevel Level=DefaultCompression)
This is the shared class of boolean and integer constants.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Keep one copy of function when linking (inline)
Module.h This file contains the declarations for the Module class.
Type * getType() const
All values are typed, get the type of this value.
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
std::string getGlobalIdentifier() const
Return the modified name for this global value suitable to be used as the key for a global lookup (e...
static std::string getInstrProfErrString(instrprof_error Err)
StringRef getPGOFuncNameMetadataName()
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
LinkageTypes
An enumeration for the kinds of linkage for global values.
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
void sortByTargetValues()
Sort ValueData ascending by Value.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
MDNode * getMetadata(unsigned KindID) const
Get the current metadata attachments for the given kind, if any.
void setMetadata(unsigned KindID, MDNode *MD)
Set a particular kind of metadata attachment.
llvm_unreachable("Unknown RegBank!")
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
std::vector< uint64_t > Counts
bool hasAddressTaken(const User **=nullptr) const
hasAddressTaken - returns true if there are any uses of this function other than direct calls or invo...
pointer data()
Return a pointer to the vector's buffer, even if empty().
Profiling information for a single function.
StringRef filename(StringRef path, Style style=Style::native)
Get filename.
static IntegerType * getInt32Ty(LLVMContext &C)
std::string getPGOFuncName(const Function &F, bool InLTO=false, uint64_t Version=INSTR_PROF_INDEX_VERSION)
Return the modified name for function F suitable to be used the key for profile lookup.
MDString * createString(StringRef Str)
Return the given string as metadata.
Error addFuncName(StringRef FuncName)
Update the symtab by adding FuncName to the table.
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
GlobalVariable * createPGOFuncNameVar(Function &F, StringRef PGOFuncName)
Create and return the global variable for function name used in PGO instrumentation.
Rename collisions when linking (static functions).
uint32_t getNumValueSites(uint32_t ValueKind) const
Return the number of instrumented sites for ValueKind.
uint32_t getNumValueSitesInstrProf(const void *Record, uint32_t VKind)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
Lightweight error class with error context and mandatory checking.
support::endianness getHostEndianness()
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
void encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned Padding=0)
Utility function to encode a ULEB128 value to an output stream.
StringRef - Represent a constant reference to a string, i.e.
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
uint32_t getNumValueDataForSiteInstrProf(const void *R, uint32_t VK, uint32_t S)
Error uncompress(StringRef InputBuffer, char *UncompressedBuffer, size_t &UncompressedSize)
StringRef getPGOFuncNameVarInitializer(GlobalVariable *NameVar)
Return the initializer in string of the PGO name var NameVar.
LLVMContext & getContext() const
Get the global data context.
cl::opt< std::string > MemOPSizeRange("memop-size-range", cl::desc("Set the range of size in memory intrinsic calls to be profiled ""precisely, in a format of <start_val>:<end_val>"), cl::init(""))