summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2019-04-23 18:56:19 +0000
committerTeresa Johnson <tejohnson@google.com>2019-04-23 18:56:19 +0000
commit867bc3951bff977f930ca2451e9d1d3548587522 (patch)
treeb1bba0daf98be6c9cb2b85dd9e9fa1070fe903a1 /clang/lib/CodeGen/BackendUtil.cpp
parent6967da8ffafe094507b153a93c607b95f2ab22a6 (diff)
downloadbcm5719-llvm-867bc3951bff977f930ca2451e9d1d3548587522.tar.gz
bcm5719-llvm-867bc3951bff977f930ca2451e9d1d3548587522.zip
[ThinLTO] Pass down opt level to LTO backend and handle -O0 LTO in new PM
Summary: The opt level was not being passed down to the ThinLTO backend when invoked via clang (for distributed ThinLTO). This exposed an issue where the new PM was asserting if the Thin or regular LTO backend pipelines were invoked with -O0 (not a new issue, could be provoked by invoking in-process *LTO backends via linker using new PM and -O0). Fix this similar to the old PM where -O0 only does the necessary lowering of type metadata (WPD and LowerTypeTest passes) and then quits, rather than asserting. Reviewers: xur Subscribers: mehdi_amini, inglorion, eraman, hiraditya, steven_wu, dexonsmith, cfe-commits, llvm-commits, pcc Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D61022 llvm-svn: 359025
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 995df8c09da..51ee592c36d 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -1325,6 +1325,7 @@ static void runThinLTOBackend(ModuleSummaryIndex *CombinedIndex, Module *M,
Conf.MAttrs = TOpts.Features;
Conf.RelocModel = CGOpts.RelocationModel;
Conf.CGOptLevel = getCGOptLevel(CGOpts);
+ Conf.OptLevel = CGOpts.OptimizationLevel;
initTargetOptions(Conf.Options, CGOpts, TOpts, LOpts, HeaderOpts);
Conf.SampleProfile = std::move(SampleProfile);
OpenPOWER on IntegriCloud