1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

[PGO] Add a commandline option to control number of the VP annotation metadata.

llvm-svn: 262750
This commit is contained in:
Rong Xu 2016-03-04 22:08:44 +00:00
parent f8caea219d
commit 1103a979e7

View File

@ -97,12 +97,20 @@ static cl::opt<std::string>
cl::desc("Specify the path of profile data file. This is"
"mainly for test purpose."));
// Command line options to disable value profiling. The default is false:
// Command line option to disable value profiling. The default is false:
// i.e. value profiling is enabled by default. This is for debug purpose.
static cl::opt<bool> DisableValueProfiling("disable-vp", cl::init(false),
cl::Hidden,
cl::desc("Disable Value Profiling"));
// Command line option to set the maximum number of VP annotations to write to
// the metada for a single indirect call callsite.
static cl::opt<unsigned>
MaxNumAnnotations("icp-max-annotations", cl::init(3), cl::Hidden,
cl::ZeroOrMore,
cl::desc("Max number of annotations for a single indirect "
"call callsite"));
namespace {
class PGOInstrumentationGen : public ModulePass {
public:
@ -748,7 +756,7 @@ void PGOUseFunc::annotateIndirectCallSites() {
<< IndirectCallSiteIndex << " out of " << NumValueSites
<< "\n");
annotateValueSite(*M, *I, ProfileRecord, IPVK_IndirectCallTarget,
IndirectCallSiteIndex);
IndirectCallSiteIndex, MaxNumAnnotations);
IndirectCallSiteIndex++;
}
}