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

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 4 14:08:44 PST 2016


Author: xur
Date: Fri Mar  4 16:08:44 2016
New Revision: 262750

URL: http://llvm.org/viewvc/llvm-project?rev=262750&view=rev
Log:
[PGO] Add a commandline option to control number of the VP annotation metadata.

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp?rev=262750&r1=262749&r2=262750&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp Fri Mar  4 16:08:44 2016
@@ -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::annotateIndirectCallSit
                  << IndirectCallSiteIndex << " out of " << NumValueSites
                  << "\n");
     annotateValueSite(*M, *I, ProfileRecord, IPVK_IndirectCallTarget,
-                      IndirectCallSiteIndex);
+                      IndirectCallSiteIndex, MaxNumAnnotations);
     IndirectCallSiteIndex++;
   }
 }




More information about the llvm-commits mailing list