[all-commits] [llvm/llvm-project] 56a865: [CodeGen] Expose the extensibility of PassConfig t...

Tcc100 via All-commits all-commits at lists.llvm.org
Thu Jul 10 03:43:31 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 56a8655f4a9c3992fd401dcf12b956f24f0e2606
      https://github.com/llvm/llvm-project/commit/56a8655f4a9c3992fd401dcf12b956f24f0e2606
  Author: Tcc100 <Tcc100 at users.noreply.github.com>
  Date:   2025-07-10 (Thu, 10 Jul 2025)

  Changed paths:
    M llvm/docs/WritingAnLLVMPass.rst
    A llvm/include/llvm/Target/RegisterTargetPassConfigCallback.h
    M llvm/lib/CodeGen/CodeGenTargetMachineImpl.cpp
    M llvm/lib/Target/CMakeLists.txt
    A llvm/lib/Target/RegisterTargetPassConfigCallback.cpp
    A llvm/test/Other/codegen-plugin-loading.ll
    A llvm/unittests/CodeGen/CGPluginTest/CMakeLists.txt
    A llvm/unittests/CodeGen/CGPluginTest/Plugin/CMakeLists.txt
    A llvm/unittests/CodeGen/CGPluginTest/Plugin/CodeGenTestPass.cpp
    A llvm/unittests/CodeGen/CGPluginTest/Plugin/CodeGenTestPass.h
    A llvm/unittests/CodeGen/CGPluginTest/Plugin/Plugin.cpp
    A llvm/unittests/CodeGen/CGPluginTest/PluginTest.cpp
    M llvm/unittests/CodeGen/CMakeLists.txt

  Log Message:
  -----------
  [CodeGen] Expose the extensibility of PassConfig to plugins (#139059)

This PR exposes the backend pass config to plugins via a callback.
Plugin authors can register a callback that is being triggered before
the target backend adds their passes to the pipeline. In the callback
they then get access to the `TargetMachine`, the `PassManager`, and the
`TargetPassConfig`. This allows plugins to call
`TargetPassConfig::insertPass`, which is honored in the subsequent
`addPass` of the main backend. We implemented this using the legacy pass
manager since backends still use it as the default.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list