summaryrefslogtreecommitdiff
path: root/tools/llvm-lto2
diff options
context:
space:
mode:
authorTobias Edler von Koch <tobias@codeaurora.org>2017-07-28 23:43:22 +0000
committerTobias Edler von Koch <tobias@codeaurora.org>2017-07-28 23:43:22 +0000
commitc99ec6347b9821b7dc7d1afe9fca92b463205204 (patch)
tree580e864a085fa26cdf87b898c9558493f7dd3ea1 /tools/llvm-lto2
parentb2a9fcdbed0ae55b0caba63a67f9ed04306ebd0d (diff)
[LTO] llvm-lto2: Add option to load sample profile
Summary: This exposes LTO's Conf.SampleProfile as a command line option (-lto-sample-profile-file) for testing via the llvm-lto2 utility. Reviewers: pcc, danielcdh Subscribers: mehdi_amini, inglorion, llvm-commits Differential Revision: https://reviews.llvm.org/D36030 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309456 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-lto2')
-rw-r--r--tools/llvm-lto2/llvm-lto2.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/llvm-lto2/llvm-lto2.cpp b/tools/llvm-lto2/llvm-lto2.cpp
index fac3fe49d67..da2703fd50a 100644
--- a/tools/llvm-lto2/llvm-lto2.cpp
+++ b/tools/llvm-lto2/llvm-lto2.cpp
@@ -100,6 +100,10 @@ static cl::opt<bool> OptRemarksWithHotness(
cl::desc("Whether to include hotness informations in the remarks.\n"
"Has effect only if -pass-remarks-output is specified."));
+static cl::opt<std::string>
+ SamplePGOFile("lto-sample-profile-file",
+ cl::desc("Specify a SamplePGO profile file"));
+
static cl::opt<bool>
UseNewPM("use-new-pm",
cl::desc("Run LTO passes using the new pass manager"),
@@ -199,6 +203,8 @@ static int run(int argc, char **argv) {
Conf.RemarksFilename = OptRemarksOutput;
Conf.RemarksWithHotness = OptRemarksWithHotness;
+ Conf.SampleProfile = SamplePGOFile;
+
// Run a custom pipeline, if asked for.
Conf.OptPipeline = OptPipeline;
Conf.AAPipeline = AAPipeline;