[all-commits] [llvm/llvm-project] 1f2c8f: [flang][hlfir] Add hlfir.forall and its OrderAssig...

jeanPerier via All-commits all-commits at lists.llvm.org
Thu May 4 00:59:48 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1f2c8f6a774c5b0e76e3770751a63f4794d96732
      https://github.com/llvm/llvm-project/commit/1f2c8f6a774c5b0e76e3770751a63f4794d96732
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2023-05-04 (Thu, 04 May 2023)

  Changed paths:
    M flang/include/flang/Optimizer/HLFIR/CMakeLists.txt
    M flang/include/flang/Optimizer/HLFIR/HLFIROps.h
    M flang/include/flang/Optimizer/HLFIR/HLFIROps.td
    M flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
    A flang/test/HLFIR/forall.fir
    M flang/test/HLFIR/invalid.fir

  Log Message:
  -----------
  [flang][hlfir] Add hlfir.forall and its OrderAssignmentTreeOpInterface

This patch adds the hlfir.forall operation and the
OrderAssignmentTreeOpInterface that allows representing Fortran forall.

It uses regions to keep Fortran expression evaluation independent from
each other in the IR. Forall assignments inside hlfir.forall are
represented with hlfir.region_assign which also keeps the IR generated
for each expressions independently.

The goal of this representation is to provide a representation that is
straightforward to generate from Fortran parse tree without any analysis, while
providing enough structure information so that an optimization pass can decide
how to schedule, and save if needed, the evaluations of the Forall and Where
expression and statements. It allows the data dependency analysis to be done at
the HLFIR level.

The OrderAssignmentTreeOpInterface allows ensuring that the Forall/Where
tree structure is kept in the IR. It will allow visiting this tree in
the IR without hard coding the operation structures in the pass.

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




More information about the All-commits mailing list