[flang-commits] [PATCH] D142043: [flang] Enable lowering and passing of allocatables and pointers.

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Jan 18 10:32:11 PST 2023


jeanPerier created this revision.
jeanPerier added reviewers: PeteSteinfeld, clementval.
jeanPerier added a project: Flang.
Herald added subscribers: sunshaoce, mehdi_amini, jdoerfert.
Herald added a reviewer: sscalpone.
Herald added a project: All.
jeanPerier requested review of this revision.
Herald added a reviewer: nicolasvasilache.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142043

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142043.490225.patch
Type: text/x-patch
Size: 44935 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230118/46b1d35d/attachment-0001.bin>


More information about the flang-commits mailing list