diff options
author | Teresa Johnson <tejohnson@google.com> | 2019-04-23 18:56:19 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2019-04-23 18:56:19 +0000 |
commit | 867bc3951bff977f930ca2451e9d1d3548587522 (patch) | |
tree | b1bba0daf98be6c9cb2b85dd9e9fa1070fe903a1 /clang/test/CodeGen/thinlto-debug-pm.c | |
parent | 6967da8ffafe094507b153a93c607b95f2ab22a6 (diff) | |
download | bcm5719-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/test/CodeGen/thinlto-debug-pm.c')
-rw-r--r-- | clang/test/CodeGen/thinlto-debug-pm.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/test/CodeGen/thinlto-debug-pm.c b/clang/test/CodeGen/thinlto-debug-pm.c index 2accde1f362..dc3bd33883f 100644 --- a/clang/test/CodeGen/thinlto-debug-pm.c +++ b/clang/test/CodeGen/thinlto-debug-pm.c @@ -1,10 +1,17 @@ -// Test to ensure -fdebug-pass-manager works when invoking the -// ThinLTO backend path with the new PM. +// Test to ensure the opt level is passed down to the ThinLTO backend. // REQUIRES: x86-registered-target // RUN: %clang_cc1 -o %t.o -flto=thin -fexperimental-new-pass-manager -triple x86_64-unknown-linux-gnu -emit-llvm-bc %s // RUN: llvm-lto -thinlto -o %t %t.o -// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O2 -o %t2.o -x ir %t.o -fthinlto-index=%t.thinlto.bc -fdebug-pass-manager -fexperimental-new-pass-manager 2>&1 | FileCheck %s -// CHECK: Running pass: + +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O2 -o %t2.o -x ir %t.o -fthinlto-index=%t.thinlto.bc -fdebug-pass-manager -fexperimental-new-pass-manager 2>&1 | FileCheck %s --check-prefix=O2-NEWPM +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O0 -o %t2.o -x ir %t.o -fthinlto-index=%t.thinlto.bc -fdebug-pass-manager -fexperimental-new-pass-manager 2>&1 | FileCheck %s --check-prefix=O0-NEWPM +// O2-NEWPM: Running pass: LoopVectorizePass +// O0-NEWPM-NOT: Running pass: LoopVectorizePass + +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O2 -o %t2.o -x ir %t.o -fthinlto-index=%t.thinlto.bc -mllvm -debug-pass=Structure 2>&1 | FileCheck %s --check-prefix=O2-OLDPM +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O0 -o %t2.o -x ir %t.o -fthinlto-index=%t.thinlto.bc -mllvm -debug-pass=Structure 2>&1 | FileCheck %s --check-prefix=O0-OLDPM +// O2-OLDPM: Loop Vectorization +// O0-OLDPM-NOT: Loop Vectorization void foo() { } |