summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2016-03-04 22:08:44 +0000
committerRong Xu <xur@google.com>2016-03-04 22:08:44 +0000
commitecdc98fdaea83d9d4750d93316ba1b2b277d1c51 (patch)
tree2b6dd21711c112b7797e405afadecc94ab0d686d /llvm/lib/Transforms/Instrumentation
parent381ec2afbfdcdc42e3400f5370f9ce5202837948 (diff)
downloadbcm5719-llvm-ecdc98fdaea83d9d4750d93316ba1b2b277d1c51.tar.gz
bcm5719-llvm-ecdc98fdaea83d9d4750d93316ba1b2b277d1c51.zip
[PGO] Add a commandline option to control number of the VP annotation metadata.
llvm-svn: 262750
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation')
-rw-r--r--llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
index fa46811e485..4884a499019 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -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++;
}
}
OpenPOWER on IntegriCloud