[all-commits] [llvm/llvm-project] 922443: [flang] Add a pass-pipeline config callback hook f...

Valentin Churavy via All-commits all-commits at lists.llvm.org
Fri Oct 2 19:33:10 PDT 2026


  Branch: refs/heads/users/vchuravy/pass-pipeline-config-augmentor
  Home:   https://github.com/llvm/llvm-project
  Commit: 9224437878777239bd274cd487f343415cb2195f
      https://github.com/llvm/llvm-project/commit/9224437878777239bd274cd487f343415cb2195f
  Author: Valentin Churavy <v.churavy at gmail.com>
  Date:   2026-10-03 (Sat, 03 Oct 2026)

  Changed paths:
    M flang/docs/FlangDriver.md
    M flang/include/flang/Optimizer/Passes/Pipelines.h
    M flang/lib/Frontend/FrontendActions.cpp
    M flang/lib/Optimizer/Passes/Pipelines.cpp
    M flang/unittests/Optimizer/HLFIRExtensionPointsTest.cpp

  Log Message:
  -----------
  [flang] Add a pass-pipeline config callback hook for plugins

The HLFIR-to-FIR pipeline extension points live on MLIRToLLVMPassPipelineConfig,
which the frontend builds as a local of CodeGenAction, out of reach of a plugin.

Add a process-global registry of callbacks that run on the config before the
pipeline is built. A plugin registers one from a static initializer, so it is in
place before any compilation begins, as FrontendPluginRegistry does for plugin
actions. Both code generation entry points invoke the callbacks, lowerHLFIRToFIR
for -emit-fir and generateLLVMIR for -emit-llvm/-emit-obj, and are mutually
exclusive for a given compilation, so a plugin sees the same behaviour whichever
output was asked for.

Co-Authored-By: Claude Opus 5 <noreply at anthropic.com>


  Commit: 4ebf187612bf65c84d045e20086265c3e5f67d12
      https://github.com/llvm/llvm-project/commit/4ebf187612bf65c84d045e20086265c3e5f67d12
  Author: Valentin Churavy <v.churavy at gmail.com>
  Date:   2026-10-03 (Sat, 03 Oct 2026)

  Changed paths:
    M flang/docs/FlangDriver.md
    M flang/include/flang/Optimizer/Passes/Pipelines.h
    M flang/lib/Frontend/FrontendActions.cpp
    M flang/lib/Optimizer/Passes/Pipelines.cpp
    M flang/unittests/Optimizer/HLFIRExtensionPointsTest.cpp

  Log Message:
  -----------
  [flang] Address review comments on the pipeline config callbacks

- Adopt the suggested doc comment wording and name the callback type
  (PassPipelineConfigCallback) instead of spelling std::function / auto.
- Run the callbacks in generateLLVMIR once the config is fully set up, so a
  plugin sees the OpenMP/OpenACC, vscale and other settings as on -emit-fir.
- Document that -emit-fir only reaches the HLFIR extension points, that
  callbacks must not register callbacks, and that bbc/tco/fir-opt do not run
  the registry.
- Tests: drop the redundant epRan flag and use a plain global recorder.

Assisted-by: Claude Code (Opus 5.5)


Compare: https://github.com/llvm/llvm-project/compare/f04c8d96179e...4ebf187612bf

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