Go to the documentation of this file.
22 "sample-profile-max-propagate-iterations",
cl::init(100),
23 cl::desc(
"Maximum number of iterations to go through when propagating "
24 "sample block/edge weights through the CFG."));
27 "sample-profile-check-record-coverage",
cl::init(0), cl::value_desc(
"N"),
28 cl::desc(
"Emit a warning if less than N% of records in the input profile "
29 "are matched to the IR."));
32 "sample-profile-check-sample-coverage",
cl::init(0), cl::value_desc(
"N"),
33 cl::desc(
"Emit a warning if less than N% of samples in the input profile "
34 "are matched to the IR."));
38 cl::desc(
"Use this option to turn off/on warnings about function with "
39 "samples but without debug information to use those samples. "));
43 cl::desc(
"Use profi to infer block and edge counts."));
47 cl::ZeroOrMore, cl::desc(
"Use profi to infer function entry count."));
49 namespace sampleprofutil {
69 bool ProfAccForSymsInList) {
73 assert(PSI &&
"PSI is expected to be non null");
75 if (ProfAccForSymsInList)
90 unsigned &Count = SampleCoverage[
FS][Loc];
91 bool FirstTime = (++Count == 1);
93 TotalUsedSamples += Samples;
103 auto I = SampleCoverage.
find(
FS);
107 unsigned Count = (
I != SampleCoverage.
end()) ?
I->second.size() : 0;
112 for (
const auto &
I :
FS->getCallsiteSamples())
113 for (
const auto &J :
I.second) {
128 unsigned Count =
FS->getBodySamples().size();
131 for (
const auto &
I :
FS->getCallsiteSamples())
132 for (
const auto &J :
I.second) {
148 for (
const auto &
I :
FS->getBodySamples())
149 Total +=
I.second.getSamples();
152 for (
const auto &
I :
FS->getCallsiteSamples())
153 for (
const auto &J :
I.second) {
168 unsigned Total)
const {
170 "number of used records cannot exceed the total number of records");
171 return Total > 0 ? Used * 100 / Total : 100;
176 const char *FSDiscriminatorVar =
"__llvm_fs_discriminator__";
177 if (
M->getGlobalVariable(FSDiscriminatorVar))
185 FSDiscriminatorVar)});
This is an optimization pass for GlobalISel generic memory operations.
static IntegerType * getInt1Ty(LLVMContext &C)
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
cl::opt< bool > SampleProfileUseProfi
bool isColdCount(uint64_t C) const
Returns true if count C is considered cold.
uint64_t getTotalSamples() const
Return the total number of samples collected inside the function.
void createFSDiscriminatorVariable(Module *M)
Create a global variable to flag FSDiscriminators are used.
Analysis providing profile information.
bool isHotCount(uint64_t C) const
Returns true if count C is considered hot.
Representation of the samples collected for a function.
initializer< Ty > init(const Ty &Val)
void appendToUsed(Module &M, ArrayRef< GlobalValue * > Values)
Adds global values to the llvm.used list.
uint64_t countBodySamples(const FunctionSamples *FS, ProfileSummaryInfo *PSI) const
Return the number of samples collected in the body of this profile.
iterator find(const_arg_type_t< KeyT > Val)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
cl::opt< bool > SampleProfileInferEntryCount
A Module instance is used to store all the information related to an LLVM module.
Represents the relative location of an instruction.
unsigned computeCoverage(unsigned Used, unsigned Total) const
Return the fraction of sample records used in this profile.
cl::opt< unsigned > SampleProfileSampleCoverage
@ WeakODRLinkage
Same, but only replaced by something equivalent.
unsigned countBodyRecords(const FunctionSamples *FS, ProfileSummaryInfo *PSI) const
Return the number of sample records in the body of this profile.
unsigned countUsedRecords(const FunctionSamples *FS, ProfileSummaryInfo *PSI) const
Return the number of sample records that were applied from this profile.
static ConstantInt * getTrue(LLVMContext &Context)
bool callsiteIsHot(const FunctionSamples *CallsiteFS, ProfileSummaryInfo *PSI, bool ProfAccForSymsInList)
Return true if the given callsite is hot wrt to hot cutoff threshold.
bool markSamplesUsed(const FunctionSamples *FS, uint32_t LineOffset, uint32_t Discriminator, uint64_t Samples)
Mark as used the sample record for the given function samples at (LineOffset, Discriminator).
cl::opt< unsigned > SampleProfileRecordCoverage
cl::opt< unsigned > SampleProfileMaxPropagateIterations
cl::opt< bool > NoWarnSampleUnused