[llvm] 6ec8c6f - [gold] Remove support for legacy pass manager

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 8 01:33:43 PDT 2022


Author: Nikita Popov
Date: 2022-04-08T10:33:35+02:00
New Revision: 6ec8c6fc7b30bb770cf3e454a89ebd2be1bed88e

URL: https://github.com/llvm/llvm-project/commit/6ec8c6fc7b30bb770cf3e454a89ebd2be1bed88e
DIFF: https://github.com/llvm/llvm-project/commit/6ec8c6fc7b30bb770cf3e454a89ebd2be1bed88e.diff

LOG: [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

Added: 
    

Modified: 
    llvm/test/tools/gold/X86/disable-verify.ll
    llvm/test/tools/gold/X86/new-pm.ll
    llvm/test/tools/gold/X86/opt-level.ll
    llvm/test/tools/gold/X86/opt-remarks.ll
    llvm/test/tools/gold/X86/slp-vectorize.ll
    llvm/test/tools/gold/X86/vectorize.ll
    llvm/tools/gold/gold-plugin.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/gold/X86/disable-verify.ll b/llvm/test/tools/gold/X86/disable-verify.ll
index c1ab6b06acf4c..10501db1179c0 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 1236793433d26..0930b9835e132 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 57eddc8c91290..d6620cd09abdd 100644
--- a/llvm/test/tools/gold/X86/opt-level.ll
+++ b/llvm/test/tools/gold/X86/opt-level.ll
@@ -1,17 +1,4 @@
 ; 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
@@ -19,7 +6,7 @@
 ; 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 fceca23d532b3..254dd39f432f7 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 4204d761cf9ce..d33ce06efb040 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 71c9c46648525..2e25d107e98a1 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 0477a15fb5efc..019bfe07e026f 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;
 


        


More information about the llvm-commits mailing list