Skip to content

Commit 0481d2a

Browse files
authored
Revert "[CodeGen] Expose the extensibility of PassConfig to plugins" (#147947)
Reverts #139059 This broke https://lab.llvm.org/buildbot/#/builders/10/builds/9125/steps/8/logs/stdio The bot does a SHARED_LIBS=ON build. I can reproduce locally with the CMake cache file in offload/cmake/caches/AMDGPUBot.cmake as the build config.
1 parent 1d8b516 commit 0481d2a

File tree

13 files changed

+0
-342
lines changed

13 files changed

+0
-342
lines changed

llvm/docs/WritingAnLLVMPass.rst

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -442,28 +442,6 @@ in certain circumstances (such as calling the ``Pass::dump()`` from a
442442
debugger), so it should only be used to enhance debug output, it should not be
443443
depended on.
444444

445-
Scheduling a MachineFunctionPass
446-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
447-
448-
Backends create a ``TargetPassConfig`` and use ``addPass`` to schedule
449-
``MachineFunctionPass``\ es. External plugins can register a callback to modify
450-
and insert additional passes:
451-
452-
.. code-block:: c++
453-
454-
RegisterTargetPassConfigCallback X{[](auto &TM, auto &PM, auto *TPC) {
455-
TPC->insertPass(/* ... */);
456-
TPC->substitutePass(/* ... */);
457-
}};
458-
459-
Note that passes still have to be registered:
460-
461-
.. code-block:: c++
462-
463-
__attribute__((constructor)) static void initCodeGenPlugin() {
464-
initializeExamplePass(*PassRegistry::getPassRegistry());
465-
}
466-
467445
.. _writing-an-llvm-pass-interaction:
468446

469447
Specifying interactions between passes

llvm/include/llvm/Target/RegisterTargetPassConfigCallback.h

Lines changed: 0 additions & 37 deletions
This file was deleted.

llvm/lib/CodeGen/CodeGenTargetMachineImpl.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include "llvm/MC/TargetRegistry.h"
3131
#include "llvm/Support/CommandLine.h"
3232
#include "llvm/Support/FormattedStream.h"
33-
#include "llvm/Target/RegisterTargetPassConfigCallback.h"
3433
#include "llvm/Target/TargetMachine.h"
3534
#include "llvm/Target/TargetOptions.h"
3635
using namespace llvm;
@@ -123,7 +122,6 @@ addPassesToGenerateCode(CodeGenTargetMachineImpl &TM, PassManagerBase &PM,
123122
PassConfig->setDisableVerify(DisableVerify);
124123
PM.add(PassConfig);
125124
PM.add(&MMIWP);
126-
invokeGlobalTargetPassConfigCallbacks(TM, PM, PassConfig);
127125

128126
if (PassConfig->addISelPasses())
129127
return nullptr;

llvm/lib/Target/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen)
33
list(APPEND LLVM_TABLEGEN_FLAGS -I ${LLVM_MAIN_SRC_DIR}/lib/Target)
44

55
add_llvm_component_library(LLVMTarget
6-
RegisterTargetPassConfigCallback.cpp
76
Target.cpp
87
TargetLoweringObjectFile.cpp
98
TargetMachine.cpp

llvm/lib/Target/RegisterTargetPassConfigCallback.cpp

Lines changed: 0 additions & 39 deletions
This file was deleted.

llvm/test/Other/codegen-plugin-loading.ll

Lines changed: 0 additions & 7 deletions
This file was deleted.

llvm/unittests/CodeGen/CGPluginTest/CMakeLists.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.

llvm/unittests/CodeGen/CGPluginTest/Plugin/CMakeLists.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

llvm/unittests/CodeGen/CGPluginTest/Plugin/CodeGenTestPass.cpp

Lines changed: 0 additions & 34 deletions
This file was deleted.

llvm/unittests/CodeGen/CGPluginTest/Plugin/CodeGenTestPass.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)