[all-commits] [llvm/llvm-project] 1119c1: [flang][hlfir] Enable lowering and passing of allo...

jeanPerier via All-commits all-commits at lists.llvm.org
Thu Jan 19 05:19:17 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1119c15ef5c55f2fe8a219443a9ea28f82ffe870
      https://github.com/llvm/llvm-project/commit/1119c15ef5c55f2fe8a219443a9ea28f82ffe870
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2023-01-19 (Thu, 19 Jan 2023)

  Changed paths:
    M flang/include/flang/Lower/Allocatable.h
    M flang/include/flang/Optimizer/Builder/HLFIRTools.h
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td
    M flang/lib/Lower/Allocatable.cpp
    M flang/lib/Lower/ConvertCall.cpp
    M flang/lib/Lower/ConvertVariable.cpp
    M flang/lib/Optimizer/Builder/HLFIRTools.cpp
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    A flang/test/Lower/HLFIR/allocatables-and-pointers.f90

  Log Message:
  -----------
  [flang][hlfir] Enable lowering and passing of allocatables and pointers.

Adds support for:
- referencing a whole allocatable/pointer symbol
- passing allocatable/pointer in a call

This required update in HLFIRTools.cpp helpers so that the
raw address, extents, lower bounds, and type parameters of a
fir.box/fir.class can be extracted.
This is required because in hlfir lowering, dereferencing a
pointer/alloc is only doing the fir.load fir.box part, and the
helpers have to be able to reason about that fir.box without the
help of a "fir::FortranVariableOpInterface".

Missing:
- referencing part of allocatable/pointer (will need to update
  Designator lowering to dereference the pointer/alloc). Same
  for whole allocatable and pointer components.
- allocate/deallocate/pointer assignment statements.
- Whole allocatable assignment.
- Lower inquires.

Differential Revision: https://reviews.llvm.org/D142043




More information about the All-commits mailing list