summaryrefslogtreecommitdiff
path: root/lib/LTO
diff options
context:
space:
mode:
authorTim Shen <timshen91@gmail.com>2017-06-01 23:13:44 +0000
committerTim Shen <timshen91@gmail.com>2017-06-01 23:13:44 +0000
commita950eb976c78dacfe647f115b637a041044639d1 (patch)
tree577093d5693585da6a7f3b78d55196d87454ae14 /lib/LTO
parent9cd1e1f867dc0241c5bc241e1e09bf6bb7a6c2e6 (diff)
[ThinLTO] Move -lto-use-new-pm to llvm-lto2, and change it to -use-new-pm.
Summary: As we teach Clang to use ThinkLTO + new PM, it's good for the users to inject through Config, instead of setting a flag in the LTOBackend library. Move the flag to llvm-lto2. As it moves to llvm-lto2, a new name -use-new-pm seems simpler and as clear. Reviewers: davide, tejohnson Subscribers: mehdi_amini, Prazek, inglorion, eraman, chandlerc, llvm-commits Differential Revision: https://reviews.llvm.org/D33799 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304492 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/LTO')
-rw-r--r--lib/LTO/LTO.cpp1
-rw-r--r--lib/LTO/LTOBackend.cpp7
2 files changed, 2 insertions, 6 deletions
diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp
index b8698c8a4f0..2bd3af6e92d 100644
--- a/lib/LTO/LTO.cpp
+++ b/lib/LTO/LTO.cpp
@@ -122,6 +122,7 @@ static void computeCacheKey(
AddUnsigned(Conf.CGOptLevel);
AddUnsigned(Conf.CGFileType);
AddUnsigned(Conf.OptLevel);
+ AddUnsigned(Conf.UseNewPM);
AddString(Conf.OptPipeline);
AddString(Conf.AAPipeline);
AddString(Conf.OverrideTriple);
diff --git a/lib/LTO/LTOBackend.cpp b/lib/LTO/LTOBackend.cpp
index f9c41f5c974..3f72e446cdf 100644
--- a/lib/LTO/LTOBackend.cpp
+++ b/lib/LTO/LTOBackend.cpp
@@ -42,11 +42,6 @@
using namespace llvm;
using namespace lto;
-static cl::opt<bool>
- LTOUseNewPM("lto-use-new-pm",
- cl::desc("Run LTO passes using the new pass manager"),
- cl::init(false), cl::Hidden);
-
LLVM_ATTRIBUTE_NORETURN static void reportOpenError(StringRef Path, Twine Msg) {
errs() << "failed to open " << Path << ": " << Msg << '\n';
errs().flush();
@@ -266,7 +261,7 @@ bool opt(Config &Conf, TargetMachine *TM, unsigned Task, Module &Mod,
if (!Conf.OptPipeline.empty())
runNewPMCustomPasses(Mod, TM, Conf.OptPipeline, Conf.AAPipeline,
Conf.DisableVerify);
- else if (LTOUseNewPM)
+ else if (Conf.UseNewPM)
runNewPMPasses(Mod, TM, Conf.OptLevel, IsThinLTO);
else
runOldPMPasses(Conf, Mod, TM, IsThinLTO, ExportSummary, ImportSummary);