[lld] 1104d79 - Revert "[ELF] Enable new passmanager plugin support for LTO"

Raphael Isemann via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 24 01:57:22 PDT 2022


Author: Raphael Isemann
Date: 2022-03-24T09:57:15+01:00
New Revision: 1104d792612490c0cc050307c4b6af600dc7baba

URL: https://github.com/llvm/llvm-project/commit/1104d792612490c0cc050307c4b6af600dc7baba
DIFF: https://github.com/llvm/llvm-project/commit/1104d792612490c0cc050307c4b6af600dc7baba.diff

LOG: Revert "[ELF] Enable new passmanager plugin support for LTO"

This reverts commit 32012eb11b235e1560a253664095676ea8ebd027.

Broke CMake configuration.

Added: 
    

Modified: 
    lld/ELF/Config.h
    lld/ELF/Driver.cpp
    lld/ELF/LTO.cpp
    lld/ELF/Options.td
    lld/test/CMakeLists.txt
    lld/test/lit.cfg.py
    lld/test/lit.site.cfg.py.in
    llvm/examples/Bye/Bye.cpp

Removed: 
    lld/test/ELF/lto/ltopasses-extension.ll


################################################################################
diff  --git a/lld/ELF/Config.h b/lld/ELF/Config.h
index 499223875ae2f..59df5ee596f61 100644
--- a/lld/ELF/Config.h
+++ b/lld/ELF/Config.h
@@ -140,7 +140,6 @@ struct Configuration {
   std::vector<VersionDefinition> versionDefinitions;
   std::vector<llvm::StringRef> auxiliaryList;
   std::vector<llvm::StringRef> filterList;
-  std::vector<llvm::StringRef> passPlugins;
   std::vector<llvm::StringRef> searchPaths;
   std::vector<llvm::StringRef> symbolOrderingFile;
   std::vector<llvm::StringRef> thinLTOModulesToCompile;

diff  --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index dd785cc698cb1..ebf0de0949f4f 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -1287,8 +1287,6 @@ static void readConfigs(opt::InputArgList &args) {
       error(arg->getSpelling() + ": unknown plugin option '" + arg->getValue() +
             "'");
 
-  config->passPlugins = args::getStrings(args, OPT_load_pass_plugins);
-
   // Parse -mllvm options.
   for (auto *arg : args.filtered(OPT_mllvm))
     parseClangOption(arg->getValue(), arg->getSpelling());

diff  --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp
index f1a74cf70f6d4..9ac21ddf18846 100644
--- a/lld/ELF/LTO.cpp
+++ b/lld/ELF/LTO.cpp
@@ -147,8 +147,6 @@ static lto::Config createConfig() {
 
   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;
   c.DwoDir = std::string(config->dwoDir);
 

diff  --git a/lld/ELF/Options.td b/lld/ELF/Options.td
index a69f255a0eef7..43c163b94b419 100644
--- a/lld/ELF/Options.td
+++ b/lld/ELF/Options.td
@@ -716,5 +716,3 @@ defm check_dynamic_relocations: BB<"check-dynamic-relocations",
     "Perform additional validation of the written dynamic relocations",
     "Do not perform additional validation of the written dynamic relocations">,
   Flags<[HelpHidden]>;
-
-defm load_pass_plugins: EEq<"load-pass-plugin", "Load passes from plugin library">;

diff  --git a/lld/test/CMakeLists.txt b/lld/test/CMakeLists.txt
index bfd731f41d9dc..6fb175077bebe 100644
--- a/lld/test/CMakeLists.txt
+++ b/lld/test/CMakeLists.txt
@@ -12,9 +12,6 @@ llvm_canonicalize_cmake_booleans(
   LLVM_ENABLE_LIBXML2
   LLD_DEFAULT_LD_LLD_IS_MINGW
   LLVM_HAVE_LIBXAR
-  LLVM_BUILD_EXAMPLES
-  LLVM_ENABLE_PLUGINS
-  LLVM_BYE_LINK_INTO_TOOLS
   )
 
 configure_lit_site_cfg(
@@ -63,11 +60,6 @@ if (NOT LLD_BUILT_STANDALONE)
     split-file
     yaml2obj
     )
-    if (NOT WIN32)
-      list(APPEND LLD_TEST_DEPS
-        Bye
-        )
-    endif()
 endif()
 
 add_lit_testsuite(check-lld "Running lld test suite"

diff  --git a/lld/test/ELF/lto/ltopasses-extension.ll b/lld/test/ELF/lto/ltopasses-extension.ll
deleted file mode 100644
index 179244888a4e4..0000000000000
--- a/lld/test/ELF/lto/ltopasses-extension.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; REQUIRES: x86, plugins, examples
-; UNSUPPORTED: windows
-; RUN: opt -module-summary %s -o %t.o
-; RUN: ld.lld -%loadnewpmbye --lto-newpm-passes="goodbye" -mllvm=%loadbye -mllvm=-wave-goodbye %t.o -o /dev/null 2>&1 | FileCheck %s
-; CHECK: Bye
-
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
- at junk = global i32 0
-
-define i32* @somefunk() {
-  ret i32* @junk
-}

diff  --git a/lld/test/lit.cfg.py b/lld/test/lit.cfg.py
index e0b8a824c4ef0..22012b5863f90 100644
--- a/lld/test/lit.cfg.py
+++ b/lld/test/lit.cfg.py
@@ -115,24 +115,6 @@
 if config.sizeof_void_p == 8:
     config.available_features.add("llvm-64-bits")
 
-if config.has_plugins:
-    config.available_features.add('plugins')
-
-if config.build_examples:
-    config.available_features.add('examples')
-
-if config.linked_bye_extension:
-    config.substitutions.append(('%loadbye', ''))
-    config.substitutions.append(('%loadnewpmbye', ''))
-else:
-    config.substitutions.append(('%loadbye',
-                                 '-load={}/Bye{}'.format(config.llvm_shlib_dir,
-                                                         config.llvm_shlib_ext)))
-    config.substitutions.append(('%loadnewpmbye',
-                                 '-load-pass-plugin={}/Bye{}'
-                                 .format(config.llvm_shlib_dir,
-                                         config.llvm_shlib_ext)))
-
 tar_executable = lit.util.which('tar', config.environment['PATH'])
 if tar_executable:
     env = os.environ

diff  --git a/lld/test/lit.site.cfg.py.in b/lld/test/lit.site.cfg.py.in
index c86e54722a4a8..ffc762d89e6a5 100644
--- a/lld/test/lit.site.cfg.py.in
+++ b/lld/test/lit.site.cfg.py.in
@@ -7,8 +7,6 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@"
 config.llvm_obj_root = "@LLVM_BINARY_DIR@"
 config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@")
 config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@")
-config.llvm_shlib_dir = "@SHLIBDIR@"
-config.llvm_shlib_ext = "@SHLIBEXT@"
 config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@"
 config.lld_obj_root = "@LLD_BINARY_DIR@"
@@ -21,9 +19,6 @@ config.have_libxar = @LLVM_HAVE_LIBXAR@
 config.have_libxml2 = @LLVM_ENABLE_LIBXML2@
 config.sizeof_void_p = @CMAKE_SIZEOF_VOID_P@
 config.ld_lld_default_mingw = @LLD_DEFAULT_LD_LLD_IS_MINGW@
-config.build_examples = @LLVM_BUILD_EXAMPLES@
-config.has_plugins = @LLVM_ENABLE_PLUGINS@
-config.linked_bye_extension = @LLVM_BYE_LINK_INTO_TOOLS@
 
 import lit.llvm
 lit.llvm.initialize(lit_config, config)

diff  --git a/llvm/examples/Bye/Bye.cpp b/llvm/examples/Bye/Bye.cpp
index ba50f9445d8a9..b75fbebf04ca1 100644
--- a/llvm/examples/Bye/Bye.cpp
+++ b/llvm/examples/Bye/Bye.cpp
@@ -50,11 +50,6 @@ static llvm::RegisterStandardPasses RegisterBye(
     [](const llvm::PassManagerBuilder &Builder,
        llvm::legacy::PassManagerBase &PM) { PM.add(new LegacyBye()); });
 
-static llvm::RegisterStandardPasses RegisterByeLTO(
-    llvm::PassManagerBuilder::EP_ModuleOptimizerEarly,
-    [](const llvm::PassManagerBuilder &Builder,
-       llvm::legacy::PassManagerBase &PM) { PM.add(new LegacyBye()); });
-
 /* New PM Registration */
 llvm::PassPluginLibraryInfo getByePluginInfo() {
   return {LLVM_PLUGIN_API_VERSION, "Bye", LLVM_VERSION_STRING,


        


More information about the llvm-commits mailing list