[all-commits] [llvm/llvm-project] 3191e8: [flang] Lower binary and unary elemental array ope...

jeanPerier via All-commits all-commits at lists.llvm.org
Thu Dec 15 04:16:51 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3191e8e19f1a7007ddd0e55cee60a51a058c99f5
      https://github.com/llvm/llvm-project/commit/3191e8e19f1a7007ddd0e55cee60a51a058c99f5
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2022-12-15 (Thu, 15 Dec 2022)

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

  Log Message:
  -----------
  [flang] Lower binary and unary elemental array operations

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).

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




More information about the All-commits mailing list