diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -992,7 +992,7 @@ config->ltoDebugPassManager = args.hasArg(OPT_lto_debug_pass_manager); config->ltoEmitAsm = args.hasArg(OPT_lto_emit_asm); config->ltoNewPassManager = - args.hasFlag(OPT_lto_new_pass_manager, OPT_no_lto_new_pass_manager, + args.hasFlag(OPT_no_lto_legacy_pass_manager, OPT_lto_legacy_pass_manager, LLVM_ENABLE_NEW_PASS_MANAGER); config->ltoNewPmPasses = args.getLastArgValue(OPT_lto_newpm_passes); config->ltoWholeProgramVisibility = diff --git a/lld/ELF/Options.td b/lld/ELF/Options.td --- a/lld/ELF/Options.td +++ b/lld/ELF/Options.td @@ -530,9 +530,9 @@ HelpText<"Debug new pass manager">; def lto_emit_asm: FF<"lto-emit-asm">, HelpText<"Emit assembly code">; -defm lto_new_pass_manager: BB<"lto-new-pass-manager", - "Use new pass manager", - "Use legacy pass manager">; +defm lto_legacy_pass_manager: BB<"lto-legacy-pass-manager", + "Use the legacy pass manager in LLVM", + "Use the new pass manager in LLVM">; def lto_newpm_passes: JJ<"lto-newpm-passes=">, HelpText<"Passes to run during LTO">; def lto_O: JJ<"lto-O">, MetaVarName<"">, @@ -597,9 +597,9 @@ def: J<"plugin-opt=lto-partitions=">, Alias, HelpText<"Alias for --lto-partitions">; def plugin_opt_mcpu_eq: J<"plugin-opt=mcpu=">; def: F<"plugin-opt=new-pass-manager">, - Alias, HelpText<"Alias for --lto-new-pass-manager">; + Alias, HelpText<"Alias for --no-lto-legacy-pass-manager">; def: F<"plugin-opt=legacy-pass-manager">, - Alias, HelpText<"Alias for --no-lto-new-pass-manager">; + Alias, HelpText<"Alias for --no-legacy-pass-manager">; def: F<"plugin-opt=cs-profile-generate">, Alias, HelpText<"Alias for --lto-cs-profile-generate">; def: J<"plugin-opt=cs-profile-path=">, diff --git a/lld/test/ELF/lto/new-pass-manager.ll b/lld/test/ELF/lto/new-pass-manager.ll --- a/lld/test/ELF/lto/new-pass-manager.ll +++ b/lld/test/ELF/lto/new-pass-manager.ll @@ -4,9 +4,9 @@ ; Test new-pass-manager and debug-pass-manager option ; RUN: ld.lld --plugin-opt=new-pass-manager --plugin-opt=debug-pass-manager -o /dev/null %t.o 2>&1 | FileCheck %s ; RUN: ld.lld --plugin-opt=new-pass-manager --lto-debug-pass-manager -o /dev/null %t.o 2>&1 | FileCheck %s -; RUN: ld.lld --lto-new-pass-manager --plugin-opt=debug-pass-manager -o /dev/null %t.o 2>&1 | FileCheck %s -; RUN: ld.lld --lto-new-pass-manager --lto-debug-pass-manager -o /dev/null %t.o 2>&1 | FileCheck %s -; RUN: ld.lld --lto-new-pass-manager --no-lto-new-pass-manager --lto-debug-pass-manager -o /dev/null %t.o 2>&1 | FileCheck %s --check-prefix=LEGACY +; RUN: ld.lld --no-lto-legacy-pass-manager --plugin-opt=debug-pass-manager -o /dev/null %t.o 2>&1 | FileCheck %s +; RUN: ld.lld --no-lto-legacy-pass-manager --lto-debug-pass-manager -o /dev/null %t.o 2>&1 | FileCheck %s +; RUN: ld.lld --no-lto-legacy-pass-manager --lto-legacy-pass-manager --lto-debug-pass-manager -o /dev/null %t.o 2>&1 | FileCheck %s --check-prefix=LEGACY ; RUN: ld.lld --plugin-opt=legacy-pass-manager --plugin-opt=debug-pass-manager -o /dev/null %t.o 2>&1 | FileCheck %s --check-prefix=LEGACY ; CHECK: Starting llvm::Module pass manager run diff --git a/lld/test/ELF/lto/verify-invalid.ll b/lld/test/ELF/lto/verify-invalid.ll --- a/lld/test/ELF/lto/verify-invalid.ll +++ b/lld/test/ELF/lto/verify-invalid.ll @@ -1,16 +1,16 @@ ; REQUIRES: x86 ; RUN: llvm-as %s -o %t.o -; RUN: ld.lld %t.o -o %t2 -mllvm -debug-pass=Arguments --no-lto-new-pass-manager \ +; RUN: ld.lld %t.o -o %t2 -mllvm -debug-pass=Arguments --lto-legacy-pass-manager \ ; RUN: 2>&1 | FileCheck -check-prefix=DEFAULT-LPM %s -; RUN: ld.lld %t.o -o %t2 -mllvm -debug-pass=Arguments --no-lto-new-pass-manager \ +; RUN: ld.lld %t.o -o %t2 -mllvm -debug-pass=Arguments --lto-legacy-pass-manager \ ; RUN: -disable-verify 2>&1 | FileCheck -check-prefix=DISABLE-LPM %s -; RUN: ld.lld %t.o -o %t2 -mllvm -debug-pass=Arguments --no-lto-new-pass-manager \ +; RUN: ld.lld %t.o -o %t2 -mllvm -debug-pass=Arguments --lto-legacy-pass-manager \ ; RUN: --plugin-opt=disable-verify 2>&1 | FileCheck -check-prefix=DISABLE-LPM %s -; RUN: ld.lld %t.o -o %t2 --lto-new-pass-manager --lto-debug-pass-manager \ +; RUN: ld.lld %t.o -o %t2 --no-lto-legacy-pass-manager --lto-debug-pass-manager \ ; RUN: 2>&1 | FileCheck -check-prefix=DEFAULT-NPM %s -; RUN: ld.lld %t.o -o %t2 --lto-new-pass-manager --lto-debug-pass-manager \ +; RUN: ld.lld %t.o -o %t2 --no-lto-legacy-pass-manager --lto-debug-pass-manager \ ; RUN: -disable-verify 2>&1 | FileCheck -check-prefix=DISABLE-NPM %s -; RUN: ld.lld %t.o -o %t2 --lto-new-pass-manager --lto-debug-pass-manager \ +; RUN: ld.lld %t.o -o %t2 --no-lto-legacy-pass-manager --lto-debug-pass-manager \ ; RUN: --plugin-opt=disable-verify 2>&1 | FileCheck -check-prefix=DISABLE-NPM %s target triple = "x86_64-unknown-linux-gnu"