LLVM 22.0.0git
|
A class that holds the constants that represent static data and their profile information and provides methods to operate on them. More...
#include "llvm/Analysis/StaticDataProfileInfo.h"
Public Member Functions | |
LLVM_ABI std::optional< uint64_t > | getConstantProfileCount (const Constant *C) const |
If C has a count, return it. Otherwise, return std::nullopt. | |
StaticDataProfileInfo ()=default | |
LLVM_ABI void | addConstantProfileCount (const Constant *C, std::optional< uint64_t > Count) |
If Count is not nullopt, add it to the profile count of the constant C in a saturating way, and clamp the count to getInstrMaxCountValue if the result exceeds it. | |
LLVM_ABI StringRef | getConstantSectionPrefix (const Constant *C, const ProfileSummaryInfo *PSI) const |
Return a section prefix for the constant C based on its profile count. |
Public Attributes | |
DenseMap< const Constant *, uint64_t > | ConstantProfileCounts |
Accummulate the profile count of a constant that will be lowered to static data sections. | |
DenseSet< const Constant * > | ConstantWithoutCounts |
Keeps track of the constants that are seen at least once without profile counts. |
A class that holds the constants that represent static data and their profile information and provides methods to operate on them.
Definition at line 15 of file StaticDataProfileInfo.h.
|
default |
References llvm::CallingConv::C, llvm::Count, and LLVM_ABI.
void StaticDataProfileInfo::addConstantProfileCount | ( | const Constant * | C, |
std::optional< uint64_t > | Count ) |
If Count
is not nullopt, add it to the profile count of the constant C
in a saturating way, and clamp the count to getInstrMaxCountValue
if the result exceeds it.
Otherwise, mark the constant as having no profile count.
Definition at line 9 of file StaticDataProfileInfo.cpp.
References llvm::CallingConv::C, ConstantProfileCounts, ConstantWithoutCounts, llvm::Count, llvm::getInstrMaxCountValue(), and llvm::SaturatingAdd().
std::optional< uint64_t > StaticDataProfileInfo::getConstantProfileCount | ( | const Constant * | C | ) | const |
If C
has a count, return it. Otherwise, return std::nullopt.
Definition at line 24 of file StaticDataProfileInfo.cpp.
References llvm::CallingConv::C, ConstantProfileCounts, and I.
Referenced by getConstantSectionPrefix().
StringRef StaticDataProfileInfo::getConstantSectionPrefix | ( | const Constant * | C, |
const ProfileSummaryInfo * | PSI ) const |
Return a section prefix for the constant C
based on its profile count.
Definition at line 31 of file StaticDataProfileInfo.cpp.
References llvm::CallingConv::C, ConstantWithoutCounts, llvm::Count, getConstantProfileCount(), llvm::ProfileSummaryInfo::isColdCount(), and llvm::ProfileSummaryInfo::isHotCount().
Accummulate the profile count of a constant that will be lowered to static data sections.
Definition at line 19 of file StaticDataProfileInfo.h.
Referenced by addConstantProfileCount(), and getConstantProfileCount().
Keeps track of the constants that are seen at least once without profile counts.
Definition at line 23 of file StaticDataProfileInfo.h.
Referenced by addConstantProfileCount(), and getConstantSectionPrefix().