Go to the documentation of this file.
14 #ifndef LLVM_PROFILEDATA_SAMPLEPROF_H
15 #define LLVM_PROFILEDATA_SAMPLEPROF_H
34 #include <system_error>
35 #include <unordered_map>
87 namespace sampleprof {
108 std::string &GUIDBuf) {
109 if (
Name.empty() || !UseMD5)
136 return "InvalidSection";
138 return "ProfileSummarySection";
140 return "NameTableSection";
142 return "ProfileSymbolListSection";
144 return "FuncOffsetTableSection";
146 return "FunctionMetadata";
148 return "CSNameTableSection";
150 return "LBRProfileSection";
152 return "UnknownSection";
222 template <
class SecFlagType>
225 if (std::is_same<SecCommonFlags, SecFlagType>())
229 bool IsFlagLegal =
false;
232 IsFlagLegal = std::is_same<SecNameTableFlags, SecFlagType>();
235 IsFlagLegal = std::is_same<SecProfSummaryFlags, SecFlagType>();
238 IsFlagLegal = std::is_same<SecFuncMetadataFlags, SecFlagType>();
242 IsFlagLegal = std::is_same<SecFuncOffsetFlags, SecFlagType>();
249 template <
class SecFlagType>
253 bool IsCommon = std::is_same<SecCommonFlags, SecFlagType>();
254 Entry.Flags |= IsCommon ? FVal : (FVal << 32);
257 template <
class SecFlagType>
261 bool IsCommon = std::is_same<SecCommonFlags, SecFlagType>();
262 Entry.Flags &= ~(IsCommon ? FVal : (FVal << 32));
265 template <
class SecFlagType>
269 bool IsCommon = std::is_same<SecCommonFlags, SecFlagType>();
270 return Entry.Flags & (IsCommon ? FVal : (FVal << 32));
322 if (
LHS.second !=
RHS.second)
323 return LHS.second >
RHS.second;
325 return LHS.first <
RHS.first;
361 uint64_t &TargetSamples = CallTargets[
F];
373 auto I = CallTargets.
find(
F);
374 if (
I != CallTargets.
end()) {
392 for (
const auto &
I : CallTargets)
400 for (
const auto &
I : Targets) {
401 SortedTargets.emplace(
I.first(),
I.second);
403 return SortedTargets;
408 float DistributionFactor) {
410 for (
const auto &
I : Targets) {
411 AdjustedTargets[
I.first()] =
I.second * DistributionFactor;
413 return AdjustedTargets;
462 return !(*
this == That);
465 std::string
toString(
bool OutputLineLocation)
const {
466 std::ostringstream OContextStr;
468 if (OutputLineLocation) {
473 return OContextStr.str();
519 std::list<SampleContextFrameVector> &CSNameTable,
530 CSNameTable.emplace_back();
542 ContextStr = ContextStr.
substr(1, ContextStr.
size() - 2);
546 while (!ContextRemain.
empty()) {
547 auto ContextSplit = ContextRemain.
split(
" @ ");
548 ChildContext = ContextSplit.first;
549 ContextRemain = ContextSplit.second;
552 Context.emplace_back(CalleeName, CallSiteLoc);
561 auto EntrySplit = ContextStr.
split(
':');
562 FName = EntrySplit.first;
565 if (!EntrySplit.second.empty()) {
569 auto LocSplit = EntrySplit.second.split(
'.');
570 LocSplit.first.getAsInteger(10, LineOffset);
574 if (!LocSplit.second.empty())
593 bool IncludeLeafLineLocation =
false) {
594 std::ostringstream OContextStr;
596 if (OContextStr.str().size()) {
597 OContextStr <<
" @ ";
600 IncludeLeafLineLocation);
602 return OContextStr.str();
627 Name =
Context.back().FuncName;
632 return State == That.State && Name == That.Name &&
633 FullContext == That.FullContext;
639 if (State != That.State)
640 return State < That.State;
643 return (Name.
compare(That.Name)) == -1;
648 auto &Context1 = FullContext[
I];
649 auto &Context2 = That.FullContext[
I];
650 auto V = Context1.FuncName.compare(Context2.FuncName);
653 if (Context1.Location != Context2.Location)
654 return Context1.Location < Context2.Location;
658 return FullContext.
size() < That.FullContext.
size();
668 auto ThisContext = FullContext;
669 auto ThatContext = That.FullContext;
670 if (ThatContext.size() < ThisContext.size())
672 ThatContext = ThatContext.
take_front(ThisContext.size());
674 if (ThisContext.back().FuncName != ThatContext.back().FuncName)
726 if (TotalSamples < Num)
744 return BodySamples[
LineLocation(LineOffset, Discriminator)].addSamples(
752 return BodySamples[
LineLocation(LineOffset, Discriminator)].addCalledTarget(
762 auto I = BodySamples.find(
LineLocation(LineOffset, Discriminator));
763 if (
I != BodySamples.end()) {
764 Count =
I->second.removeCalledTarget(FName);
765 Count =
I->second.removeSamples(Count);
766 if (!
I->second.getSamples())
767 BodySamples.erase(
I);
775 S.addSamples(Num, Weight);
781 for (
auto &
I : BodySamples) {
782 uint64_t TargetSamples =
I.second.getCallTargetSum();
787 if (TargetSamples >
I.second.getSamples())
788 I.second.addSamples(TargetSamples -
I.second.getSamples());
795 for (
const auto &
I : BodySamples)
798 for (
auto &
I : CallsiteSamples) {
799 for (
auto &CS :
I.second) {
800 CS.second.updateTotalSamples();
809 for (
auto &
I : CallsiteSamples) {
810 for (
auto &CS :
I.second) {
811 CS.second.SetContextSynthetic();
821 const auto &
ret = BodySamples.find(
LineLocation(LineOffset, Discriminator));
822 if (
ret == BodySamples.end())
823 return std::error_code();
824 return ret->second.getSamples();
832 const auto &
ret = BodySamples.find(
LineLocation(LineOffset, Discriminator));
833 if (
ret == BodySamples.end())
834 return std::error_code();
835 return ret->second.getCallTargets();
842 const auto &
Ret = BodySamples.find(CallSite);
843 if (
Ret == BodySamples.end())
844 return std::error_code();
845 return Ret->second.getCallTargets();
850 return CallsiteSamples[Loc];
856 auto iter = CallsiteSamples.find(Loc);
857 if (iter == CallsiteSamples.end())
859 return &iter->second;
872 bool empty()
const {
return TotalSamples == 0; }
895 if (!BodySamples.empty() &&
896 (CallsiteSamples.empty() ||
897 BodySamples.begin()->first < CallsiteSamples.begin()->first))
898 Count = BodySamples.begin()->second.getSamples();
899 else if (!CallsiteSamples.empty()) {
902 for (
const auto &N_FS : CallsiteSamples.begin()->second)
903 Count += N_FS.second.getEntrySamples();
906 return Count ? Count : TotalSamples > 0;
914 return CallsiteSamples;
922 MaxCount =
std::max(MaxCount, L.second.getSamples());
924 for (
const FunctionSamplesMap::value_type &
F :
C.second)
925 MaxCount =
std::max(MaxCount,
F.second.getMaxCountInside());
936 Context =
Other.getContext();
937 if (FunctionHash == 0) {
939 FunctionHash =
Other.getFunctionHash();
940 }
else if (FunctionHash !=
Other.getFunctionHash()) {
953 for (
const auto &
I :
Other.getBodySamples()) {
958 for (
const auto &
I :
Other.getCallsiteSamples()) {
961 for (
const auto &Rec :
I.second)
962 MergeResult(Result, FSMap[Rec.first].merge(Rec.second, Weight));
974 if (TotalSamples <= Threshold)
976 auto isDeclaration = [](
const Function *
F) {
977 return !
F ||
F->isDeclaration();
985 for (
const auto &BS : BodySamples)
986 for (
const auto &TS : BS.second.getCallTargets())
987 if (TS.getValue() > Threshold) {
989 if (isDeclaration(
Callee))
992 for (
const auto &CS : CallsiteSamples)
993 for (
const auto &NameFS : CS.second)
994 NameFS.second.findInlinedFunctions(
S,
SymbolMap, Threshold);
1013 auto AttrName =
"sample-profile-suffix-elision-policy";
1014 auto Attr =
F.getFnAttribute(AttrName).getValueAsString();
1030 if (Attr ==
"" || Attr ==
"all") {
1031 return FnName.
split(
'.').first;
1032 }
else if (Attr ==
"selected") {
1034 for (
const auto &Suf : knownSuffixes) {
1040 auto It = Cand.
rfind(Suffix);
1043 auto Dit = Cand.
rfind(
'.');
1044 if (Dit == It + Suffix.
size() - 1)
1045 Cand = Cand.
substr(0, It);
1048 }
else if (Attr ==
"none") {
1051 assert(
false &&
"internal error: unknown suffix elision policy");
1183 std::unordered_map<SampleContext, FunctionSamples, SampleContext::Hash>;
1188 std::vector<NameFunctionSamples> &SortedProfiles);
1200 for (
const auto &
I : Samples)
1203 return A->first <
B->first;
1227 bool TrimColdContext,
1228 bool MergeColdContext,
1230 bool TrimBaseProfileOnly);
1285 Syms.insert(
Name.copy(Allocator));
1291 for (
auto Sym :
List.Syms)
1295 unsigned size() {
return Syms.size(); }
1300 std::error_code
read(
const uint8_t *Data,
uint64_t ListSize);
1308 bool ToCompress =
false;
1315 using namespace sampleprof;
1332 #endif // LLVM_PROFILEDATA_SAMPLEPROF_H
uint64_t getSamples() const
const BodySampleMap & getBodySamples() const
Return all the samples collected in the body of the function.
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
ArrayRef< T > drop_back(size_t N=1) const
Drop the last N elements of the array.
FunctionSamples * FuncSamples
This is an optimization pass for GlobalISel generic memory operations.
std::map< LineLocation, SampleRecord > BodySampleMap
@ SecFlagFSDiscriminator
SecFlagFSDiscriminator means this profile uses flow-sensitive discriminators.
const SamplesWithLocList & get() const
static void decodeContextString(StringRef ContextStr, StringRef &FName, LineLocation &LineLoc)
@ ContextDuplicatedIntoBase
bool operator!=(const SampleContext &That) const
static bool ProfileIsProbeBased
static hash_code hash_value(const SampleContextFrame &arg)
bool operator()(const CallTarget &LHS, const CallTarget &RHS) const
bool hasAttribute(ContextAttributeMask A)
LLVM_NODISCARD size_t rfind(char C, size_t From=npos) const
Search for the last character C in the string.
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
void removeTotalSamples(uint64_t Num)
std::map< LineLocation, FunctionSamplesMap > CallsiteSampleMap
LineLocation(uint32_t L, uint32_t D)
SmallVector< const SamplesWithLoc *, 20 > SamplesWithLocList
bool hasCalls() const
Return true if this sample record contains function calls.
static constexpr size_t npos
StringRef getFuncName(StringRef Name) const
Translate Name into its original name.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
std::pair< SampleContext, const FunctionSamples * > NameFunctionSamples
void setContext(SampleContextFrames Context, ContextStateMask CState=RawContext)
SampleContext(SampleContextFrames Context, ContextStateMask CState=RawContext)
std::string toString(bool OutputLineLocation) const
@ SecFlagFullContext
SecFlagContext means this is context-sensitive flat profile for CSSPGO.
std::string toString() const
std::unordered_map< SampleContext, FunctionSamples, SampleContext::Hash > SampleProfileMap
bool operator==(const SampleContext &That) const
static bool hasSecFlag(const SecHdrTableEntry &Entry, SecFlagType Flag)
bool operator<(const LineLocation &O) const
The instances of the Type class are immutable: once they are created, they are never changed.
static void addSecFlag(SecHdrTableEntry &Entry, SecFlagType Flag)
OutputIt copy(R &&Range, OutputIt Out)
to esp esp setne al movzbw ax esp setg cl movzbw cx cmove cx cl jne LBB1_2 esp ret(also really horrible code on ppc). This is due to the expand code for 64-bit compares. GCC produces multiple branches
uint32_t getAllAttributes()
Expected< ExpressionValue > max(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
void findInlinedFunctions(DenseSet< GlobalValue::GUID > &S, const StringMap< Function * > &SymbolMap, uint64_t Threshold) const
Recursively traverses all children, if the total sample count of the corresponding function is no les...
void findAllNames(DenseSet< StringRef > &NameSet) const
StringRef getName() const
Return the function name.
std::map< std::string, FunctionSamples, std::less<> > FunctionSamplesMap
iterator find(StringRef Key)
FrameNode * getOrCreateChildFrame(const LineLocation &CallSite, StringRef CalleeName)
static StringRef getCanonicalFnName(StringRef FnName, StringRef Attr="selected")
void SetContextSynthetic()
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
static bool isEqual(const SampleContext &LHS, const SampleContext &RHS)
LLVM_NODISCARD StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
static bool HasUniqSuffix
Whether the profile contains any ".__uniq." suffix in a name.
static void removeSecFlag(SecHdrTableEntry &Entry, SecFlagType Flag)
void setToCompress(bool TC)
An information struct used to provide DenseMap with the various necessary components for a given valu...
StringRef getFuncName() const
Return the original function name.
@ unsupported_writing_format
static StringRef getRepInFormat(StringRef Name, bool UseMD5, std::string &GUIDBuf)
Get the proper representation of a string according to whether the current Format uses MD5 to represe...
static constexpr const char * PartSuffix
uint64_t removeCalledTargetAndBodySample(uint32_t LineOffset, uint32_t Discriminator, StringRef FName)
void setTotalSamples(uint64_t Num)
uint64_t getTotalSamples() const
Return the total number of samples collected inside the function.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void updateTotalSamples()
bool hasState(ContextStateMask S)
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
std::pair< StringRef, uint64_t > CallTarget
(vector float) vec_cmpeq(*A, *B) C
uint64_t getHashCode() const
FunctionSamples()=default
uint64_t removeSamples(uint64_t S)
Decrease the number of samples for this record by S.
@ SecFlagPartial
SecFlagPartial means the profile is for common/shared code.
ErrorOr< SampleRecord::CallTargetMap > findCallTargetMapAt(uint32_t LineOffset, uint32_t Discriminator) const
Returns the call target map collected at a given location.
static void createCtxVectorFromStr(StringRef ContextStr, SampleContextFrameVector &Context)
Create a context vector from a given context string and save it in Context.
DenseMap< SymbolStringPtr, JITEvaluatedSymbol > SymbolMap
A map from symbol names (as SymbolStringPtrs) to JITSymbols (address/flags pairs).
static uint64_t getGUID(StringRef Name)
bool operator<(const SampleContext &That) const
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
const std::error_category & sampleprof_category()
static unsigned getHashValue(const SampleContext &Val)
Flag
These should be considered private to the implementation of the MCInstrDesc class.
static cl::opt< unsigned > ColdCountThreshold("mfs-count-threshold", cl::desc("Minimum number of times a block must be executed to be retained."), cl::init(1), cl::Hidden)
SampleSorter(const std::map< LocationT, SampleT > &Samples)
static uint64_t SPMagic(SampleProfileFormat Format=SPF_Binary)
This class implements an extremely fast bulk output stream that can only output to a stream.
std::error_code read(const uint8_t *Data, uint64_t ListSize)
ArrayRef< SampleContextFrame > SampleContextFrames
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
std::map< uint64_t, FrameNode > AllChildFrames
uint64_t getHeadSamples() const
Return the total number of branch samples that have the function as the branch target.
bool isBaseContext() const
void sortFuncProfiles(const SampleProfileMap &ProfileMap, std::vector< NameFunctionSamples > &SortedProfiles)
static bool ProfileIsFS
If this profile uses flow sensitive discriminators.
bool operator!=(const LineLocation &O) const
const CallTargetMap & getCallTargets() const
std::set< CallTarget, CallTargetComparator > SortedCallTargetSet
Implements a dense probed hash-table based set.
SampleContext(StringRef ContextStr, std::list< SampleContextFrameVector > &CSNameTable, ContextStateMask CState=RawContext)
bool contains(StringRef Name)
SampleContextFrames getContextFrames() const
const CallsiteSampleMap & getCallsiteSamples() const
Return all the callsite samples collected in the body of the function.
void setName(StringRef FunctionName)
Set the name of the function and clear the current context.
ProfileSymbolList records the list of function symbols shown up in the binary used to generate the pr...
constexpr LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
void setAttribute(ContextAttributeMask A)
sampleprof_error addHeadSamples(uint64_t Num, uint64_t Weight=1)
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
uint64_t getEntrySamples() const
Return the sample count of the first instruction of the function.
DenseMap< uint64_t, StringRef > * GUIDToFuncNameMap
GUIDToFuncNameMap saves the mapping from GUID to the symbol name, for all the function symbols define...
bool operator==(const LineLocation &O) const
Representation of the samples collected for a function.
Allocate memory in an ever growing pool, as if by bump-pointer.
FunctionSamplesMap & functionSamplesAt(const LineLocation &Loc)
Return the function samples at the given callsite location.
static SampleContext getTombstoneKey()
void clearState(ContextStateMask S)
static uint64_t getCallSiteHash(StringRef CalleeName, const LineLocation &Callsite)
Returns a unique hash code for a combination of a callsite location and the callee function name.
std::enable_if_t< std::is_unsigned< T >::value, T > 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.
void setContext(const SampleContext &FContext)
uint64_t getCallTargetSum() const
uint64_t getFunctionHash() const
sampleprof_error addCalledTargetSamples(uint32_t LineOffset, uint32_t Discriminator, StringRef FName, uint64_t Num, uint64_t Weight=1)
static const CallTargetMap adjustCallTargets(const CallTargetMap &Targets, float DistributionFactor)
Prorate call targets by a distribution factor.
const SortedCallTargetSet getSortedCallTargets() const
void setAllAttributes(uint32_t A)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef getName() const
void setState(ContextStateMask S)
raw_ostream & operator<<(raw_ostream &OS, const LineLocation &Loc)
static bool UseMD5
Whether the profile uses MD5 to represent string.
void merge(const ProfileSymbolList &List)
static unsigned getOffset(const DILocation *DIL)
Returns the line offset to the start line of the subprogram.
Represents the relative location of an instruction.
sampleprof_error MergeResult(sampleprof_error &Accumulator, sampleprof_error Result)
bool IsPrefixOf(const SampleContext &That) const
SampleContext(StringRef Name)
Expected< ExpressionValue > min(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
StringRef - Represent a constant reference to a string, i.e.
Sort a LocationT->SampleT map by LocationT.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
sampleprof_error addBodySamples(uint32_t LineOffset, uint32_t Discriminator, uint64_t Num, uint64_t Weight=1)
bool operator==(const SampleContextFrame &That) const
void add(StringRef Name, bool copy=false)
copy indicates whether we need to copy the underlying memory for the input Name.
void print(raw_ostream &OS=dbgs(), unsigned Indent=0) const
Print the samples collected for a function on stream OS.
const FunctionSamplesMap * findFunctionSamplesMapAt(const LineLocation &Loc) const
Returns the FunctionSamplesMap at the given Loc.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
ErrorOr< uint64_t > findSamplesAt(uint32_t LineOffset, uint32_t Discriminator) const
Return the number of samples collected at the given location.
StringMap< uint64_t > CallTargetMap
static std::string getSecName(SecType Type)
const FunctionSamples * findFunctionSamplesAt(const LineLocation &Loc, StringRef CalleeName, SampleProfileReaderItaniumRemapper *Remapper) const
Returns a pointer to FunctionSamples at the given callsite location Loc with callee CalleeName.
std::error_code make_error_code(BitcodeError E)
amdgpu Simplify well known AMD library false FunctionCallee Callee
@ ostream_seek_unsupported
constexpr LLVM_NODISCARD size_t size() const
size - Get the string size.
void stable_sort(R &&Range)
std::error_code write(raw_ostream &OS)
void print(raw_ostream &OS) const
void print(raw_ostream &OS, unsigned Indent) const
Print the sample record to the stream OS indented by Indent.
static uint64_t SPVersion()
ArrayRef< T > take_front(size_t N=1) const
Return a copy of *this with only the first N elements.
static void verifySecFlag(SecType Type, SecFlagType Flag)
GUID getGUID() const
Return a 64-bit global unique ID constructed from global value name (i.e.
ErrorOr< SampleRecord::CallTargetMap > findCallTargetMapAt(const LineLocation &CallSite) const
Returns the call target map collected at a given location specified by CallSite.
sampleprof_error addTotalSamples(uint64_t Num, uint64_t Weight=1)
Representation of a single sample record.
FrameNode(StringRef FName=StringRef(), FunctionSamples *FSamples=nullptr, LineLocation CallLoc={0, 0})
sampleprof_error merge(const FunctionSamples &Other, uint64_t Weight=1)
Merge the samples in Other into this one.
static constexpr const char * LLVMSuffix
Name suffixes which canonicalization should handle to avoid profile mismatch.
void trimAndMergeColdContextProfiles(uint64_t ColdCountThreshold, bool TrimColdContext, bool MergeColdContext, uint32_t ColdContextFrameLength, bool TrimBaseProfileOnly)
sampleprof_error addCalledTarget(StringRef F, uint64_t S, uint64_t Weight=1)
Add called function F with samples S.
SampleContext & getContext() const
uint64_t getMaxCountInside() const
Return the maximum of sample counts in a function body including functions inlined in it.
SampleContextFrame(StringRef FuncName, LineLocation Location)
SampleContextTrimmer(SampleProfileMap &Profiles)
uint64_t removeCalledTarget(StringRef F)
Remove called function from the call target map.
static StringRef getCanonicalFnName(const Function &F)
Return the canonical name for a function, taking into account suffix elision policy attributes.
void canonicalizeContextProfiles()
static SampleContext getEmptyKey()
static const SortedCallTargetSet SortCallTargets(const CallTargetMap &Targets)
Sort call targets in descending order of call frequency.
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
bool operator!=(const SampleContextFrame &That) const
static constexpr const char * UniqSuffix
sampleprof_error merge(const SampleRecord &Other, uint64_t Weight=1)
Merge the samples in Other into this record.
hash_code hash_combine_range(InputIteratorT first, InputIteratorT last)
Compute a hash_code for a sequence of values.
Represents either an error or a value T.
std::string to_string(const T &Value)
size_t size() const
size - Get the array size.
@ SecFlagIsPreInlined
SecFlagIsPreInlined means this profile contains ShouldBeInlined contexts thus this is CS preinliner c...
static std::string getContextString(SampleContextFrames Context, bool IncludeLeafLineLocation=false)
sampleprof_error addBodySamplesForProbe(uint32_t Index, uint64_t Num, uint64_t Weight=1)
SampleProfileReaderItaniumRemapper remaps the profile data from a sample profile data reader,...
std::pair< const LocationT, SampleT > SamplesWithLoc
SampleContextTrimmer impelements helper functions to trim, merge cold context profiles.
void dump(raw_ostream &OS=dbgs()) const
void updateCallsiteSamples()
static ManagedStatic< _object_error_category > error_category
LLVM_NODISCARD int compare(StringRef RHS) const
compare - Compare two strings; the result is -1, 0, or 1 if this string is lexicographically less tha...
sampleprof_error addSamples(uint64_t S, uint64_t Weight=1)
Increment the number of samples for this record by S.
uint64_t operator()(const SampleContextFrameVector &S) const
CSProfileConverter(SampleProfileMap &Profiles)
void setFunctionHash(uint64_t Hash)
Optional< std::vector< StOtherPiece > > Other
static LineLocation getCallSiteIdentifier(const DILocation *DIL, bool ProfileIsFS=false)
Returns a unique call site identifier for a given debug location of a call instruction.
const FunctionSamples * findFunctionSamples(const DILocation *DIL, SampleProfileReaderItaniumRemapper *Remapper=nullptr) const
Get the FunctionSamples of the inline instance where DIL originates from.
An opaque object representing a hash code.
static bool ProfileIsPreInlined
uint64_t operator()(const SampleContext &Context) const
void setName(StringRef FunctionName)
Set the name of the function.