[flang-commits] [PATCH] D140040: [flang] Lower binary and unary elemental array operations

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Dec 14 11:25:56 PST 2022


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

Lower binary and unary elemental operations with an array argument
using hlfir.elemental, hlfir.yield_element, and hlfir.apply.

Concat implementation, which is a binary operation, is moved to a
BinaryOp struct so that it can leverage this new code.

This patch implements the "not yet implemented: character array
expression temp with dynamic length" TODO of the current lowering
by splitting the result length computation from the result value
computation. That way, the result length computation can be done
before lowering the operation to an hlfir.elemental, and the length
of the hlfir.elemental is known and storage for it can later be
allocated.

It adds a DesignatorOp builder to make "dumb" indexing (without triplets,
component, substrings or derived type component ref) easier since indexing
needs to be generated for array variables in elemental expression (in
the added hlfir::genElementAt helper).

Depends on D140031 <https://reviews.llvm.org/D140031>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140040

Files:
  flang/include/flang/Optimizer/Builder/HLFIRTools.h
  flang/include/flang/Optimizer/HLFIR/HLFIROpBase.td
  flang/include/flang/Optimizer/HLFIR/HLFIROps.td
  flang/lib/Lower/ConvertExprToHLFIR.cpp
  flang/lib/Optimizer/Builder/HLFIRTools.cpp
  flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
  flang/test/Lower/HLFIR/elemental-array-ops.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140040.482946.patch
Type: text/x-patch
Size: 34400 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20221214/07737fc5/attachment-0001.bin>


More information about the flang-commits mailing list