[flang-commits] [PATCH] D144102: [flang][hlfir] Array constructor lowering [part 1/4]

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Feb 15 06:23:49 PST 2023


jeanPerier created this revision.
jeanPerier added reviewers: clementval, PeteSteinfeld, vdonaldson.
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.

This is the first and biggest chunk that introduces support for
array constructor to HLFIR.

This patch:

- adds a new ConvertArrayConstructor.cpp that centralizes the code dealing with array constructor lowering.
- introduces a framework to lower array constructor according to different strategies: A common analysis of the array constructor is done, and based on that, a lowering startegy is selected and driven through the ac-values of the array constructor. See ConvertArrayConstructor.cpp comments for more details.
- implements the first strategy that creates a temporary inlined and updates it with inlined code. This strategy can only be used if the temporary can be pre-allocated (i.e: the extents and length parameters can be pre-computed without evaluating any ac-values), and if all the ac-value expressions are scalars.

For the sake of simplicity, characters and derived type will be enabled
once all the strategies are added.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144102

Files:
  flang/include/flang/Lower/ConvertArrayConstructor.h
  flang/lib/Lower/CMakeLists.txt
  flang/lib/Lower/ConvertArrayConstructor.cpp
  flang/lib/Lower/ConvertExprToHLFIR.cpp
  flang/test/Lower/HLFIR/array-ctor-as-inlined-temp.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144102.497661.patch
Type: text/x-patch
Size: 47641 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230215/01ddfbd5/attachment-0001.bin>


More information about the flang-commits mailing list