[llvm-branch-commits] [llvm] a7f3a62 - Revert "[llc] Register pass plugin callbacks with the new pass manager (#217727)"

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Aug 22 03:49:05 PDT 2026


Author: Alexis Engelke
Date: 2026-08-22T12:49:01+02:00
New Revision: a7f3a62f1ced8af0978fc9712e1574b89a808834

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

LOG: Revert "[llc] Register pass plugin callbacks with the new pass manager (#217727)"

This reverts commit aa8d1afeed3714c2805bdf069ca273f00a789f31.

Added: 
    

Modified: 
    llvm/tools/llc/NewPMDriver.cpp
    llvm/tools/llc/NewPMDriver.h
    llvm/tools/llc/llc.cpp

Removed: 
    llvm/test/Feature/codegen-plugin-passes.mir


################################################################################
diff  --git a/llvm/test/Feature/codegen-plugin-passes.mir b/llvm/test/Feature/codegen-plugin-passes.mir
deleted file mode 100644
index 9d2837c548199..0000000000000
--- a/llvm/test/Feature/codegen-plugin-passes.mir
+++ /dev/null
@@ -1,17 +0,0 @@
-# Check that llc registers a loaded plugin's PassBuilder callbacks, so that a
-# pass provided by the plugin can be named in -passes.
-# REQUIRES: x86-registered-target, plugins, examples
-# UNSUPPORTED: target={{.*windows.*}}
-# Plugins are currently broken on AIX, at least in the CI.
-# XFAIL: target={{.*}}-aix{{.*}}
-# RUN: llc -mtriple=x86_64-- %loadnewpmbye -passes=goodbye -wave-goodbye %s -o /dev/null 2>&1 | FileCheck %s
-# RUN: llc -mtriple=x86_64-- %loadnewpmbye -passes=goodbye --print-pipeline-passes -filetype=null %s | FileCheck %s --check-prefix=PIPELINE
-
-# CHECK: Bye: somefunk
-# PIPELINE: function((anonymous namespace)::Bye)
----
-name:            somefunk
-body: |
-  bb.0:
-    RET 0
-...

diff  --git a/llvm/tools/llc/NewPMDriver.cpp b/llvm/tools/llc/NewPMDriver.cpp
index cbb34dd7b2495..cc13f2f545549 100644
--- a/llvm/tools/llc/NewPMDriver.cpp
+++ b/llvm/tools/llc/NewPMDriver.cpp
@@ -35,7 +35,6 @@
 #include "llvm/IRReader/IRReader.h"
 #include "llvm/Passes/PassBuilder.h"
 #include "llvm/Passes/StandardInstrumentations.h"
-#include "llvm/Plugins/PassPlugin.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Error.h"
@@ -93,7 +92,7 @@ int llvm::compileModuleWithNewPM(
     std::unique_ptr<TargetMachine> Target, std::unique_ptr<ToolOutputFile> Out,
     std::unique_ptr<ToolOutputFile> DwoOut, LLVMContext &Context,
     const TargetLibraryInfoImpl &TLII, VerifierKind VK, StringRef PassPipeline,
-    ArrayRef<PassPlugin> PassPlugins, CodeGenFileType FileType) {
+    CodeGenFileType FileType) {
 
   if (!PassPipeline.empty() && TargetPassConfig::hasLimitedCodeGenPipeline()) {
     WithColor::error(errs(), Arg0)
@@ -141,8 +140,6 @@ int llvm::compileModuleWithNewPM(
   MAM.registerPass([&] { return MachineModuleAnalysis(MMI); });
 
   PassBuilder PB(Target.get(), PipelineTuningOptions(), std::nullopt, &PIC);
-  for (auto &PassPlugin : PassPlugins)
-    PassPlugin.registerPassBuilderCallbacks(PB);
   PB.registerModuleAnalyses(MAM);
   PB.registerCGSCCAnalyses(CGAM);
   PB.registerFunctionAnalyses(FAM);

diff  --git a/llvm/tools/llc/NewPMDriver.h b/llvm/tools/llc/NewPMDriver.h
index e37dd17d5f377..0dbd46797dabc 100644
--- a/llvm/tools/llc/NewPMDriver.h
+++ b/llvm/tools/llc/NewPMDriver.h
@@ -19,14 +19,12 @@
 #ifndef LLVM_TOOLS_LLC_NEWPMDRIVER_H
 #define LLVM_TOOLS_LLC_NEWPMDRIVER_H
 
-#include "llvm/ADT/ArrayRef.h"
 #include "llvm/IR/DiagnosticHandler.h"
 #include "llvm/Support/CodeGen.h"
 #include <memory>
 
 namespace llvm {
 class Module;
-class PassPlugin;
 class TargetLibraryInfoImpl;
 class TargetMachine;
 class ToolOutputFile;
@@ -39,12 +37,14 @@ struct LLCDiagnosticHandler : public DiagnosticHandler {
   bool handleDiagnostics(const DiagnosticInfo &DI) override;
 };
 
-int compileModuleWithNewPM(
-    StringRef Arg0, std::unique_ptr<Module> M, std::unique_ptr<MIRParser> MIR,
-    std::unique_ptr<TargetMachine> Target, std::unique_ptr<ToolOutputFile> Out,
-    std::unique_ptr<ToolOutputFile> DwoOut, LLVMContext &Context,
-    const TargetLibraryInfoImpl &TLII, VerifierKind VK, StringRef PassPipeline,
-    ArrayRef<PassPlugin> PassPlugins, CodeGenFileType FileType);
+int compileModuleWithNewPM(StringRef Arg0, std::unique_ptr<Module> M,
+                           std::unique_ptr<MIRParser> MIR,
+                           std::unique_ptr<TargetMachine> Target,
+                           std::unique_ptr<ToolOutputFile> Out,
+                           std::unique_ptr<ToolOutputFile> DwoOut,
+                           LLVMContext &Context,
+                           const TargetLibraryInfoImpl &TLII, VerifierKind VK,
+                           StringRef PassPipeline, CodeGenFileType FileType);
 } // namespace llvm
 
 #endif

diff  --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index 0ce1f3a5b4719..2c2a543862a28 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -755,10 +755,10 @@ static int compileModule(char **argv, SmallVectorImpl<PassPlugin> &PluginList,
       (Target->shouldDefaultToNewPM() &&
        !(EnableNewPassManager.getNumOccurrences() && !EnableNewPassManager) &&
        getRunPassNames().empty())) {
-    return compileModuleWithNewPM(
-        argv[0], std::move(M), std::move(MIR), std::move(Target),
-        std::move(Out), std::move(DwoOut), Context, TLII, VK, PassPipeline,
-        PluginList, codegen::getFileType());
+    return compileModuleWithNewPM(argv[0], std::move(M), std::move(MIR),
+                                  std::move(Target), std::move(Out),
+                                  std::move(DwoOut), Context, TLII, VK,
+                                  PassPipeline, codegen::getFileType());
   }
 
   // Build up all of the passes that we want to do to the module.


        


More information about the llvm-branch-commits mailing list