[all-commits] [llvm/llvm-project] ffde9f: [flang][hlfir] Array constructor lowering [part 1/4]

jeanPerier via All-commits all-commits at lists.llvm.org
Thu Feb 16 06:20:20 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ffde9f17300b52c9b53311455b8991cbfc6da377
      https://github.com/llvm/llvm-project/commit/ffde9f17300b52c9b53311455b8991cbfc6da377
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2023-02-16 (Thu, 16 Feb 2023)

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

  Log Message:
  -----------
  [flang][hlfir] Array constructor lowering [part 1/4]

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.

Reviewed By: clementval, PeteSteinfeld

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




More information about the All-commits mailing list