diff options
author | Nikita Popov <npopov@redhat.com> | 2022-04-07 11:30:08 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-04-08 10:33:35 +0200 |
commit | 6ec8c6fc7b30bb770cf3e454a89ebd2be1bed88e (patch) | |
tree | e079e34111cf27b5268abd9aa3f96aa77032206b | |
parent | f922dbb7923f73bab058d09346a2ec0b40ae3cb2 (diff) | |
download | llvm-6ec8c6fc7b30bb770cf3e454a89ebd2be1bed88e.zip llvm-6ec8c6fc7b30bb770cf3e454a89ebd2be1bed88e.tar.gz llvm-6ec8c6fc7b30bb770cf3e454a89ebd2be1bed88e.tar.bz2 |
[gold] Remove support for legacy pass manager
This removes support for performing LTO using the legacy pass
manager in LLVMgold.so. Explicitly enabling the new pass manager
is retained as a no-op.
Differential Revision: https://reviews.llvm.org/D123294
-rw-r--r-- | llvm/test/tools/gold/X86/disable-verify.ll | 11 | ||||
-rw-r--r-- | llvm/test/tools/gold/X86/new-pm.ll | 6 | ||||
-rw-r--r-- | llvm/test/tools/gold/X86/opt-level.ll | 19 | ||||
-rw-r--r-- | llvm/test/tools/gold/X86/opt-remarks.ll | 12 | ||||
-rw-r--r-- | llvm/test/tools/gold/X86/slp-vectorize.ll | 3 | ||||
-rw-r--r-- | llvm/test/tools/gold/X86/vectorize.ll | 3 | ||||
-rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 8 |
7 files changed, 21 insertions, 41 deletions
diff --git a/llvm/test/tools/gold/X86/disable-verify.ll b/llvm/test/tools/gold/X86/disable-verify.ll index c1ab6b0..10501db 100644 --- a/llvm/test/tools/gold/X86/disable-verify.ll +++ b/llvm/test/tools/gold/X86/disable-verify.ll @@ -2,12 +2,11 @@ ; REQUIRES: asserts ; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \ -; RUN: --plugin-opt=disable-verify --plugin-opt=legacy-pass-manager \ -; RUN: --plugin-opt=-debug-pass=Arguments \ +; RUN: --plugin-opt=disable-verify --plugin-opt=debug-pass-manager \ ; RUN: -shared %t.o -o %t2.o 2>&1 | FileCheck %s ; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \ -; RUN: --plugin-opt=-debug-pass=Arguments --plugin-opt=legacy-pass-manager \ +; RUN: --plugin-opt=debug-pass-manager \ ; RUN: -shared %t.o -o %t2.o 2>&1 | FileCheck %s -check-prefix=VERIFY target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -15,10 +14,10 @@ target triple = "x86_64-unknown-linux-gnu" ; -disable-verify should disable output verification from the optimization ; pipeline. -; CHECK: Pass Arguments: {{.*}} -verify - -; CHECK-NOT: -verify +; CHECK-NOT: VerifierPass -; VERIFY: Pass Arguments: {{.*}} -verify {{.*}} -verify +; VERIFY: Running pass: VerifierPass on [module] +; VERIFY: Running pass: VerifierPass on [module] define void @f() { entry: diff --git a/llvm/test/tools/gold/X86/new-pm.ll b/llvm/test/tools/gold/X86/new-pm.ll index 1236793..0930b9835 100644 --- a/llvm/test/tools/gold/X86/new-pm.ll +++ b/llvm/test/tools/gold/X86/new-pm.ll @@ -10,12 +10,6 @@ ; CHECK: Running pass: -;; --plugin-opt=debug-pass-manager is a no-op for the legacy pass manager. -; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \ -; RUN: --plugin-opt=thinlto \ -; RUN: --plugin-opt=legacy-pass-manager --plugin-opt=debug-pass-manager \ -; RUN: -o /dev/null %t.o 2>&1 | count 0 - target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" diff --git a/llvm/test/tools/gold/X86/opt-level.ll b/llvm/test/tools/gold/X86/opt-level.ll index 57eddc8..d6620cd 100644 --- a/llvm/test/tools/gold/X86/opt-level.ll +++ b/llvm/test/tools/gold/X86/opt-level.ll @@ -1,25 +1,12 @@ ; RUN: llvm-as -o %t.bc %s ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \ -; RUN: -m elf_x86_64 \ -; RUN: -plugin-opt=O0 -r -o %t.o %t.bc -; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O0 %s -; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \ -; RUN: -m elf_x86_64 --plugin-opt=legacy-pass-manager \ -; RUN: -plugin-opt=O1 -r -o %t.o %t.bc -; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O1 --check-prefix=CHECK-O1-OLDPM %s -; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \ -; RUN: -m elf_x86_64 \ -; RUN: -plugin-opt=O2 -r -o %t.o %t.bc -; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O2 %s - -; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \ ; RUN: -m elf_x86_64 --plugin-opt=new-pass-manager \ ; RUN: -plugin-opt=O0 -r -o %t.o %t.bc ; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O0 %s ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \ ; RUN: -m elf_x86_64 --plugin-opt=new-pass-manager \ ; RUN: -plugin-opt=O1 -r -o %t.o %t.bc -; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O1 --check-prefix=CHECK-O1-NEWPM %s +; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O1 %s ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \ ; RUN: -m elf_x86_64 --plugin-opt=new-pass-manager \ ; RUN: -plugin-opt=O2 -r -o %t.o %t.bc @@ -49,9 +36,7 @@ f: end: ; CHECK-O0: phi - ; CHECK-O1-OLDPM: select - ; The new PM does not do as many optimizations at O1 - ; CHECK-O1-NEWPM: phi + ; CHECK-O1: phi %r = phi i32 [ 1, %t ], [ 2, %f ] ret i32 %r } diff --git a/llvm/test/tools/gold/X86/opt-remarks.ll b/llvm/test/tools/gold/X86/opt-remarks.ll index fceca23..254dd39 100644 --- a/llvm/test/tools/gold/X86/opt-remarks.ll +++ b/llvm/test/tools/gold/X86/opt-remarks.ll @@ -1,7 +1,7 @@ ; Test plugin options for opt-remarks. ; RUN: llvm-as %s -o %t.o ; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext -shared \ -; RUN: -plugin-opt=save-temps -plugin-opt=legacy-pass-manager \ +; RUN: -plugin-opt=save-temps \ ; RUN: -plugin-opt=opt-remarks-passes=inline \ ; RUN: -plugin-opt=opt-remarks-format=yaml \ ; RUN: -plugin-opt=opt-remarks-filename=%t.yaml %t.o -o %t2.o 2>&1 @@ -44,6 +44,16 @@ ; YAML-NEXT: - Caller: f ; YAML-NEXT: - String: ' because its definition is unavailable' ; YAML-NEXT: ... +; YAML-NEXT: --- !Missed +; YAML-NEXT: Pass: inline +; YAML-NEXT: Name: NoDefinition +; YAML-NEXT: Function: f +; YAML-NEXT: Args: +; YAML-NEXT: - Callee: bar +; YAML-NEXT: - String: ' will not be inlined into ' +; YAML-NEXT: - Caller: f +; YAML-NEXT: - String: ' because its definition is unavailable' +; YAML-NEXT: ... ; YAML-NEXT: --- !Passed ; YAML-NEXT: Pass: inline ; YAML-NEXT: Name: Inlined diff --git a/llvm/test/tools/gold/X86/slp-vectorize.ll b/llvm/test/tools/gold/X86/slp-vectorize.ll index 4204d76..d33ce06 100644 --- a/llvm/test/tools/gold/X86/slp-vectorize.ll +++ b/llvm/test/tools/gold/X86/slp-vectorize.ll @@ -1,8 +1,7 @@ ; RUN: llvm-as %s -o %t.o ; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \ -; RUN: --plugin-opt=save-temps --plugin-opt=legacy-pass-manager \ -; RUN: -shared %t.o -o %t2.o +; RUN: --plugin-opt=save-temps -shared %t.o -o %t2.o ; RUN: llvm-dis %t2.o.0.4.opt.bc -o - | FileCheck %s ; test that the vectorizer is run. diff --git a/llvm/test/tools/gold/X86/vectorize.ll b/llvm/test/tools/gold/X86/vectorize.ll index 71c9c46..2e25d10 100644 --- a/llvm/test/tools/gold/X86/vectorize.ll +++ b/llvm/test/tools/gold/X86/vectorize.ll @@ -1,8 +1,7 @@ ; RUN: llvm-as %s -o %t.o ; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \ -; RUN: --plugin-opt=save-temps --plugin-opt=legacy-pass-manager \ -; RUN: -shared %t.o -o %t2.o +; RUN: --plugin-opt=save-temps -shared %t.o -o %t2.o ; RUN: llvm-dis %t2.o.0.4.opt.bc -o - | FileCheck %s ; test that the vectorizer is run. diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index 0477a15..019bfe0 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -200,8 +200,6 @@ namespace options { static std::vector<const char *> extra; // Sample profile file path static std::string sample_profile; - // New pass manager - static bool new_pass_manager = true; // Debug new pass manager static bool debug_pass_manager = false; // Directory to store the .dwo files. @@ -287,9 +285,7 @@ namespace options { } else if (opt.consume_front("cs-profile-path=")) { cs_profile_path = std::string(opt); } else if (opt == "new-pass-manager") { - new_pass_manager = true; - } else if (opt == "legacy-pass-manager") { - new_pass_manager = false; + // We always use the new pass manager. } else if (opt == "debug-pass-manager") { debug_pass_manager = true; } else if (opt == "whole-program-visibility") { @@ -956,8 +952,6 @@ static std::unique_ptr<LTO> createLTO(IndexWriteCallback OnIndexWrite, Conf.RemarksHotnessThreshold = options::RemarksHotnessThreshold; Conf.RemarksFormat = options::RemarksFormat; - // Use new pass manager if set in driver - Conf.UseNewPM = options::new_pass_manager; // Debug new pass manager if requested Conf.DebugPassManager = options::debug_pass_manager; |