summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-lto2
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2019-02-27 17:24:33 +0000
committerRong Xu <xur@google.com>2019-02-27 17:24:33 +0000
commit6cdf3d8086fe5b74307e48cc80437b0301ffc5fe (patch)
treed46a6ec7e2aeb5e8ac9c5d02da8c669739aa5b7e /llvm/tools/llvm-lto2
parent416603e32a9ce7cd99f8456f057387069a260e20 (diff)
downloadbcm5719-llvm-6cdf3d8086fe5b74307e48cc80437b0301ffc5fe.tar.gz
bcm5719-llvm-6cdf3d8086fe5b74307e48cc80437b0301ffc5fe.zip
Recommit r354930 "[PGO] Context sensitive PGO (part 1)"
Fixed UBSan failures. llvm-svn: 355005
Diffstat (limited to 'llvm/tools/llvm-lto2')
-rw-r--r--llvm/tools/llvm-lto2/llvm-lto2.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp
index d9950815a61..6cceb8e4cf8 100644
--- a/llvm/tools/llvm-lto2/llvm-lto2.cpp
+++ b/llvm/tools/llvm-lto2/llvm-lto2.cpp
@@ -104,6 +104,15 @@ static cl::opt<std::string>
SamplePGOFile("lto-sample-profile-file",
cl::desc("Specify a SamplePGO profile file"));
+static cl::opt<std::string>
+ CSPGOFile("lto-cspgo-profile-file",
+ cl::desc("Specify a context sensitive PGO profile file"));
+
+static cl::opt<bool>
+ RunCSIRInstr("lto-cspgo-gen",
+ cl::desc("Run PGO context sensitive IR instrumentation"),
+ cl::init(false), cl::Hidden);
+
static cl::opt<bool>
UseNewPM("use-new-pm",
cl::desc("Run LTO passes using the new pass manager"),
@@ -214,6 +223,8 @@ static int run(int argc, char **argv) {
Conf.RemarksWithHotness = OptRemarksWithHotness;
Conf.SampleProfile = SamplePGOFile;
+ Conf.CSIRProfile = CSPGOFile;
+ Conf.RunCSIRInstr = RunCSIRInstr;
// Run a custom pipeline, if asked for.
Conf.OptPipeline = OptPipeline;
OpenPOWER on IntegriCloud