[all-commits] [llvm/llvm-project] f57f18: [flang] only instantiate required symbols from par...

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Apr 27 00:48:41 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f57f184f87d1caedc778bb1f1a972757083e998d
      https://github.com/llvm/llvm-project/commit/f57f184f87d1caedc778bb1f1a972757083e998d
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2026-04-27 (Mon, 27 Apr 2026)

  Changed paths:
    M flang/include/flang/Lower/PFTBuilder.h
    M flang/include/flang/Semantics/tools.h
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Lower/PFTBuilder.cpp
    M flang/lib/Semantics/tools.cpp
    M flang/test/Lower/OpenMP/target-map-complex.f90
    M flang/test/Lower/c-interoperability.f90
    A flang/test/Lower/host_module_variable_instantiation.f90
    A flang/test/Lower/proc_pointer_hidden_by_generic.f90

  Log Message:
  -----------
  [flang] only instantiate required symbols from parent modules (#193689)

Currently lowering is instantiating (creating
fir.address_of/hlfir.declare) for all module variables from host module
and submodules (for instance, in the new
host_module_variable_instantiation.f90 test, a fir.address_of was
generated the unused var2 inside the procedure foo).

This created a lot of noise (and in the worst cases, compile time
performance issues), and also some extra complexity at least for OpenACC
where the IR acc routine ended up referencing globals that are no
actually needed, creating the need to copy them on the GPU or to have
custom logic to ignore the globals.

This patch addresses this by doing a visit of the parse tree to detect
the required symbols and only instantiate those.



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