[all-commits] [llvm/llvm-project] 66d5ca: Reland "[flang] add extra component information in...

jeanPerier via All-commits all-commits at lists.llvm.org
Tue Jul 2 06:20:11 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 66d5ca2a3d8df780951ce2987157ef03e73393c7
      https://github.com/llvm/llvm-project/commit/66d5ca2a3d8df780951ce2987157ef03e73393c7
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2024-07-02 (Tue, 02 Jul 2024)

  Changed paths:
    M flang/include/flang/Optimizer/Builder/FIRBuilder.h
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M flang/include/flang/Optimizer/Support/InternalNames.h
    M flang/include/flang/Optimizer/Support/Utils.h
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Optimizer/Builder/FIRBuilder.cpp
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M flang/lib/Optimizer/Support/CMakeLists.txt
    M flang/lib/Optimizer/Support/InternalNames.cpp
    A flang/lib/Optimizer/Support/Utils.cpp
    M flang/test/Fir/fir-ops.fir
    A flang/test/Lower/HLFIR/type-info-components.f90

  Log Message:
  -----------
  Reland "[flang] add extra component information in fir.type_info" (#97404)

Reland #96746 with the proper Support/CMakelist.txt change.

fir.type does not contain all Fortran level information about
components. For instance, component lower bounds and default initial
value are lost. For correctness purpose, this does not matter because
this information is "applied" in lowering (e.g., when addressing the
components, the lower bounds are reflected in the hlfir.designate).

However, this "loss" of information will prevent the generation of
correct debug info for the type (needs to know about lower bounds). The
initial value could help building some optimization pass to get rid of
initialization runtime calls.

This patch adds lower bound and initial value information into
fir.type_info via a new fir.dt_component operation. This operation is
generated only for component that needs it, which helps keeping the IR
small for "boring" types.

In general, adding Fortran level info in fir.type_info will allow
delaying the generation of "type descriptors" gobals that are very
verbose in FIR and make it hard to work with FIR dumps from applications
with many derived types.



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