Index: lld/COFF/Config.h =================================================================== --- lld/COFF/Config.h +++ lld/COFF/Config.h @@ -170,8 +170,6 @@ // Used for /opt:lldltocachepolicy=policy llvm::CachePruningPolicy ltoCachePolicy; - // Used for /opt:[no]ltonewpassmanager - bool ltoNewPassManager = false; // Used for /opt:[no]ltodebugpassmanager bool ltoDebugPassManager = false; Index: lld/COFF/Driver.cpp =================================================================== --- lld/COFF/Driver.cpp +++ lld/COFF/Driver.cpp @@ -1679,7 +1679,6 @@ if (args.hasArg(OPT_profile)) icfLevel = ICFLevel::None; unsigned tailMerge = 1; - bool ltoNewPM = true; bool ltoDebugPM = false; for (auto *arg : args.filtered(OPT_opt)) { std::string str = StringRef(arg->getValue()).lower(); @@ -1701,9 +1700,7 @@ } else if (s == "nolldtailmerge") { tailMerge = 0; } else if (s == "ltonewpassmanager") { - ltoNewPM = true; - } else if (s == "noltonewpassmanager") { - ltoNewPM = false; + /* We always use the new PM. */ } else if (s == "ltodebugpassmanager") { ltoDebugPM = true; } else if (s == "noltodebugpassmanager") { @@ -1733,7 +1730,6 @@ config->doICF = icfLevel.getValue(); config->tailMerge = (tailMerge == 1 && config->doICF != ICFLevel::None) || tailMerge == 2; - config->ltoNewPassManager = ltoNewPM; config->ltoDebugPassManager = ltoDebugPM; // Handle /lldsavetemps Index: lld/COFF/LTO.cpp =================================================================== --- lld/COFF/LTO.cpp +++ lld/COFF/LTO.cpp @@ -83,7 +83,6 @@ c.MAttrs = getMAttrs(); c.CGOptLevel = args::getCGOptLevel(config->ltoo); c.AlwaysEmitRegularLTOObj = !config->ltoObjPath.empty(); - c.UseNewPM = config->ltoNewPassManager; c.DebugPassManager = config->ltoDebugPassManager; c.CSIRProfile = std::string(config->ltoCSProfileFile); c.RunCSIRInstr = config->ltoCSProfileGenerate; Index: lld/ELF/Config.h =================================================================== --- lld/ELF/Config.h +++ lld/ELF/Config.h @@ -187,7 +187,6 @@ bool ltoPGOWarnMismatch; bool ltoDebugPassManager; bool ltoEmitAsm; - bool ltoNewPassManager; bool ltoUniqueBasicBlockSectionNames; bool ltoWholeProgramVisibility; bool mergeArmExidx; Index: lld/ELF/Driver.cpp =================================================================== --- lld/ELF/Driver.cpp +++ lld/ELF/Driver.cpp @@ -1102,8 +1102,6 @@ OPT_no_lto_pgo_warn_mismatch, true); config->ltoDebugPassManager = args.hasArg(OPT_lto_debug_pass_manager); config->ltoEmitAsm = args.hasArg(OPT_lto_emit_asm); - config->ltoNewPassManager = args.hasFlag(OPT_no_lto_legacy_pass_manager, - OPT_lto_legacy_pass_manager, true); config->ltoNewPmPasses = args.getLastArgValue(OPT_lto_newpm_passes); config->ltoWholeProgramVisibility = args.hasFlag(OPT_lto_whole_program_visibility, Index: lld/ELF/LTO.cpp =================================================================== --- lld/ELF/LTO.cpp +++ lld/ELF/LTO.cpp @@ -146,7 +146,6 @@ c.StatsFile = std::string(config->optStatsFilename); c.SampleProfile = std::string(config->ltoSampleProfile); - c.UseNewPM = config->ltoNewPassManager; for (StringRef pluginFn : config->passPlugins) c.PassPlugins.push_back(std::string(pluginFn)); c.DebugPassManager = config->ltoDebugPassManager; Index: lld/ELF/Options.td =================================================================== --- lld/ELF/Options.td +++ lld/ELF/Options.td @@ -547,9 +547,8 @@ HelpText<"Debug new pass manager">; def lto_emit_asm: FF<"lto-emit-asm">, HelpText<"Emit assembly code">; -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 no_lto_legacy_pass_manager: FF<"no-lto-legacy-pass-manager">, + HelpText<"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<"">, @@ -622,8 +621,6 @@ def plugin_opt_mcpu_eq: J<"plugin-opt=mcpu=">; def: F<"plugin-opt=new-pass-manager">, Alias, HelpText<"Alias for --no-lto-legacy-pass-manager">; -def: F<"plugin-opt=legacy-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=">, Index: lld/MachO/Config.h =================================================================== --- lld/MachO/Config.h +++ lld/MachO/Config.h @@ -107,7 +107,6 @@ bool implicitDylibs = false; bool isPic = false; bool headerPadMaxInstallNames = false; - bool ltoNewPassManager = true; bool markDeadStrippableDylib = false; bool printDylibSearch = false; bool printEachFile = false; Index: lld/MachO/Driver.cpp =================================================================== --- lld/MachO/Driver.cpp +++ lld/MachO/Driver.cpp @@ -1222,8 +1222,6 @@ config->umbrella = arg->getValue(); } config->ltoObjPath = args.getLastArgValue(OPT_object_path_lto); - config->ltoNewPassManager = args.hasFlag(OPT_no_lto_legacy_pass_manager, - OPT_lto_legacy_pass_manager, true); config->ltoo = args::getInteger(args, OPT_lto_O, 2); if (config->ltoo > 3) error("--lto-O: invalid optimization level: " + Twine(config->ltoo)); Index: lld/MachO/LTO.cpp =================================================================== --- lld/MachO/LTO.cpp +++ lld/MachO/LTO.cpp @@ -38,7 +38,6 @@ c.CPU = getCPUStr(); c.MAttrs = getMAttrs(); c.DiagHandler = diagnosticHandler; - c.UseNewPM = config->ltoNewPassManager; c.PreCodeGenPassesHook = [](legacy::PassManager &pm) { pm.add(createObjCARCContractPass()); }; Index: lld/MachO/Options.td =================================================================== --- lld/MachO/Options.td +++ lld/MachO/Options.td @@ -40,9 +40,6 @@ def version: Flag<["--"], "version">, HelpText<"Display the version number and exit">, Group; -def lto_legacy_pass_manager: Flag<["--"], "lto-legacy-pass-manager">, - HelpText<"Use the legacy pass manager in LLVM">, - Group; def no_lto_legacy_pass_manager : Flag<["--"], "no-lto-legacy-pass-manager">, HelpText<"Use the new pass manager in LLVM">, Group; Index: lld/test/COFF/lto-new-pass-manager.ll =================================================================== --- lld/test/COFF/lto-new-pass-manager.ll +++ lld/test/COFF/lto-new-pass-manager.ll @@ -4,11 +4,6 @@ ; RUN: lld-link %t.obj -entry:main -opt:ltonewpassmanager -opt:ltodebugpassmanager 2>&1 | FileCheck %s --check-prefix=ENABLED ; ENABLED: Running pass: InstCombinePass -; Passing -time just to avoid empty FileCheck input -; RUN: lld-link %t.obj -entry:main -time -opt:ltonewpassmanager -opt:ltodebugpassmanager -opt:noltonewpassmanager 2>&1 | FileCheck %s --check-prefix=DISABLED -; RUN: lld-link %t.obj -entry:main -time -opt:ltonewpassmanager -opt:ltodebugpassmanager -opt:noltodebugpassmanager 2>&1 | FileCheck %s --check-prefix=DISABLED -; DISABLED-NOT: Running pass: InstCombinePass - target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-windows-msvc19.11.0" Index: lld/test/ELF/lto/new-pass-manager.ll =================================================================== --- lld/test/ELF/lto/new-pass-manager.ll +++ lld/test/ELF/lto/new-pass-manager.ll @@ -6,11 +6,8 @@ ; RUN: ld.lld --plugin-opt=new-pass-manager --lto-debug-pass-manager -o /dev/null %t.o 2>&1 | FileCheck %s ; 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: Running pass: GlobalOptPass -; LEGACY-NOT: Running pass: GlobalOptPass target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" Index: lld/test/ELF/lto/verify-invalid.ll =================================================================== --- lld/test/ELF/lto/verify-invalid.ll +++ lld/test/ELF/lto/verify-invalid.ll @@ -1,11 +1,5 @@ ; REQUIRES: x86 ; RUN: llvm-as %s -o %t.o -; 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 --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 --lto-legacy-pass-manager \ -; RUN: --plugin-opt=disable-verify 2>&1 | FileCheck -check-prefix=DISABLE-LPM %s ; 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 --no-lto-legacy-pass-manager --lto-debug-pass-manager \ @@ -21,8 +15,6 @@ } ; -disable-verify should disable the verification of bitcode. -; DEFAULT-LPM: Pass Arguments: {{.*}} -verify {{.*}} -verify -; DISABLE-LPM-NOT: Pass Arguments: {{.*}} -verify {{.*}} -verify ; DEFAULT-NPM: Running pass: VerifierPass ; DEFAULT-NPM: Running pass: VerifierPass ; DEFAULT-NPM-NOT: Running pass: VerifierPass Index: lld/test/MachO/lto-objc-arc-contract.ll =================================================================== --- lld/test/MachO/lto-objc-arc-contract.ll +++ lld/test/MachO/lto-objc-arc-contract.ll @@ -5,14 +5,10 @@ ;; which doesn't know how to handle it. ; RUN: llvm-as %s -o %t.o -; RUN: %lld -dylib -lSystem %t.o -o %t --lto-legacy-pass-manager -; RUN: llvm-objdump -d %t | FileCheck %s ; RUN: %lld -dylib -lSystem %t.o -o %t --no-lto-legacy-pass-manager ; RUN: llvm-objdump -d %t | FileCheck %s ; RUN: opt -module-summary %s -o %t.o -; RUN: %lld -dylib -lSystem %t.o -o %t --lto-legacy-pass-manager -; RUN: llvm-objdump -d %t | FileCheck %s ; RUN: %lld -dylib -lSystem %t.o -o %t --no-lto-legacy-pass-manager ; RUN: llvm-objdump -d %t | FileCheck %s Index: lld/test/wasm/lto/new-pass-manager.ll =================================================================== --- lld/test/wasm/lto/new-pass-manager.ll +++ lld/test/wasm/lto/new-pass-manager.ll @@ -1,9 +1,7 @@ ; RUN: llvm-as -o %t.bc %s ; RUN: wasm-ld --no-lto-legacy-pass-manager --lto-debug-pass-manager -o /dev/null %t.bc 2>&1 | FileCheck %s -; RUN: wasm-ld --no-lto-legacy-pass-manager --lto-debug-pass-manager --lto-legacy-pass-manager -o /dev/null %t.bc 2>&1 | FileCheck %s --allow-empty --check-prefix=LPM ; CHECK: Running pass: GlobalOptPass -; LPM-NOT: Running pass: GlobalOptPass target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128" target triple = "wasm32-unknown-unknown" Index: lld/test/wasm/lto/verify-invalid.ll =================================================================== --- lld/test/wasm/lto/verify-invalid.ll +++ lld/test/wasm/lto/verify-invalid.ll @@ -1,8 +1,4 @@ ; RUN: llvm-as %s -o %t.o -; RUN: wasm-ld %t.o -o %t2 --lto-legacy-pass-manager -mllvm -debug-pass=Arguments \ -; RUN: 2>&1 | FileCheck -check-prefix=DEFAULT-LPM %s -; RUN: wasm-ld %t.o -o %t2 --lto-legacy-pass-manager -mllvm -debug-pass=Arguments \ -; RUN: -disable-verify 2>&1 | FileCheck -check-prefix=DISABLE-LPM %s ; RUN: wasm-ld %t.o -o %t2 --no-lto-legacy-pass-manager --lto-debug-pass-manager \ ; RUN: 2>&1 | FileCheck -check-prefix=DEFAULT-NPM %s ; RUN: wasm-ld %t.o -o %t2 --no-lto-legacy-pass-manager --lto-debug-pass-manager \ @@ -16,8 +12,6 @@ } ; -disable-verify should disable the verification of bitcode. -; DEFAULT-LPM: Pass Arguments: {{.*}} -verify {{.*}} -verify -; DISABLE-LPM-NOT: Pass Arguments: {{.*}} -verify {{.*}} -verify ; DEFAULT-NPM: Running pass: VerifierPass ; DEFAULT-NPM: Running pass: VerifierPass ; DEFAULT-NPM-NOT: Running pass: VerifierPass Index: lld/wasm/Config.h =================================================================== --- lld/wasm/Config.h +++ lld/wasm/Config.h @@ -61,7 +61,6 @@ unsigned ltoo; unsigned optimize; llvm::StringRef thinLTOJobs; - bool ltoNewPassManager; bool ltoDebugPassManager; UnresolvedPolicy unresolvedSymbols; Index: lld/wasm/Driver.cpp =================================================================== --- lld/wasm/Driver.cpp +++ lld/wasm/Driver.cpp @@ -365,8 +365,6 @@ config->importUndefined = args.hasArg(OPT_import_undefined); config->ltoo = args::getInteger(args, OPT_lto_O, 2); config->ltoPartitions = args::getInteger(args, OPT_lto_partitions, 1); - config->ltoNewPassManager = args.hasFlag(OPT_no_lto_legacy_pass_manager, - OPT_lto_legacy_pass_manager, true); config->ltoDebugPassManager = args.hasArg(OPT_lto_debug_pass_manager); config->mapFile = args.getLastArgValue(OPT_Map); config->optimize = args::getInteger(args, OPT_O, 1); Index: lld/wasm/LTO.cpp =================================================================== --- lld/wasm/LTO.cpp +++ lld/wasm/LTO.cpp @@ -52,7 +52,6 @@ c.OptLevel = config->ltoo; c.MAttrs = getMAttrs(); c.CGOptLevel = args::getCGOptLevel(config->ltoo); - c.UseNewPM = config->ltoNewPassManager; c.DebugPassManager = config->ltoDebugPassManager; if (config->relocatable) Index: lld/wasm/Options.td =================================================================== --- lld/wasm/Options.td +++ lld/wasm/Options.td @@ -228,7 +228,8 @@ defm thinlto_cache_policy: Eq<"thinlto-cache-policy", "Pruning policy for the ThinLTO cache">; def thinlto_jobs: J<"thinlto-jobs=">, HelpText<"Number of ThinLTO jobs. Default to --threads=">; -defm lto_legacy_pass_manager: BB<"lto-legacy-pass-manager", "Use legacy pass manager", "Use new pass manager">; +def no_lto_legacy_pass_manager: F<"no-lto-legacy-pass-manager">, + HelpText<"Use new pass manager">; def lto_debug_pass_manager: F<"lto-debug-pass-manager">, HelpText<"Debug new pass manager">;