[all-commits] [llvm/llvm-project] 35355f: [flang] Add HLFIR-to-FIR pass pipeline extension p...

Valentin Churavy via All-commits all-commits at lists.llvm.org
Tue Aug 4 00:11:37 PDT 2026


  Branch: refs/heads/users/vchuravy/hlfir-pipeline-extension-points
  Home:   https://github.com/llvm/llvm-project
  Commit: 35355f55744b7569744bbce284bb68fc2e3f3efb
      https://github.com/llvm/llvm-project/commit/35355f55744b7569744bbce284bb68fc2e3f3efb
  Author: Valentin Churavy <v.churavy at gmail.com>
  Date:   2026-08-04 (Tue, 04 Aug 2026)

  Changed paths:
    M flang/docs/FlangDriver.md
    M flang/include/flang/Tools/CrossToolHelpers.h
    M flang/lib/Optimizer/Passes/Pipelines.cpp
    M flang/unittests/Optimizer/CMakeLists.txt
    A flang/unittests/Optimizer/HLFIRExtensionPointsTest.cpp

  Log Message:
  -----------
  [flang] Add HLFIR-to-FIR pass pipeline extension points

The FIR optimizer extension points (FIROptEarly, FIRInliner, FIROptLast) all
run after HLFIR has been lowered to FIR, so the HLFIR intrinsic operations
(hlfir.sum, hlfir.matmul, ...) are gone by the time they run. Transformations
that need to see those operations have nowhere to attach.

Add two extension points to createHLFIRToFIRPassPipeline:

  * HLFIROptEarly, at the start of the pipeline, before any HLFIR
    simplification or inlining.
  * HLFIROptLast, just before createLowerHLFIRIntrinsics.

Drivers register passes through registerHLFIROptEarlyEPCallbacks and
registerHLFIROptLastEPCallbacks on MLIRToLLVMPassPipelineConfig. The invoke
methods are const so they can be called on the const config the HLFIR pipeline
receives. With no callbacks registered the pipeline is unchanged.

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



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