[flang-commits] [PATCH] D149734: [flang][hlfir] Add hlfir.forall and its OrderAssignmentTreeOpInterface

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed May 3 02:56:30 PDT 2023


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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149734

Files:
  flang/include/flang/Optimizer/HLFIR/CMakeLists.txt
  flang/include/flang/Optimizer/HLFIR/HLFIROps.h
  flang/include/flang/Optimizer/HLFIR/HLFIROps.td
  flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
  flang/test/HLFIR/forall.fir
  flang/test/HLFIR/invalid.fir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149734.519020.patch
Type: text/x-patch
Size: 17246 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230503/f329387a/attachment-0001.bin>


More information about the flang-commits mailing list