summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-lto2
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-10-31 22:12:21 +0000
committerTeresa Johnson <tejohnson@google.com>2016-10-31 22:12:21 +0000
commit002af9bbcec16fea530d161b23cc2589fe0798b7 (patch)
treee2b56c65d57f8a26b2ab8625fb191a1b388a4618 /llvm/tools/llvm-lto2
parent67eda2ad1d2275bacbf4afb9f50b341aec6ca17d (diff)
downloadbcm5719-llvm-002af9bbcec16fea530d161b23cc2589fe0798b7.tar.gz
bcm5719-llvm-002af9bbcec16fea530d161b23cc2589fe0798b7.zip
[ThinLTO] Disable importing and other cross-module optis at -O0
Summary: There is no point to importing at -O0, since we won't inline. We should also disable other cross-module optimizations. (Plan to backport this fix to the 3.9 branch to fix PR30774) Reviewers: pcc Subscribers: johanengelen, mehdi_amini Differential Revision: https://reviews.llvm.org/D25918 llvm-svn: 285648
Diffstat (limited to 'llvm/tools/llvm-lto2')
-rw-r--r--llvm/tools/llvm-lto2/llvm-lto2.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp
index 042f874596f..b48f6c1993e 100644
--- a/llvm/tools/llvm-lto2/llvm-lto2.cpp
+++ b/llvm/tools/llvm-lto2/llvm-lto2.cpp
@@ -26,6 +26,11 @@ using namespace llvm;
using namespace lto;
using namespace object;
+static cl::opt<char>
+ OptLevel("O", cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
+ "(default = '-O2')"),
+ cl::Prefix, cl::ZeroOrMore, cl::init('2'));
+
static cl::list<std::string> InputFilenames(cl::Positional, cl::OneOrMore,
cl::desc("<input bitcode files>"));
@@ -145,6 +150,8 @@ int main(int argc, char **argv) {
Conf.OptPipeline = OptPipeline;
Conf.AAPipeline = AAPipeline;
+ Conf.OptLevel = OptLevel - '0';
+
ThinBackend Backend;
if (ThinLTODistributedIndexes)
Backend = createWriteIndexesThinBackend("", "", true, "");
OpenPOWER on IntegriCloud