[all-commits] [llvm/llvm-project] 9f867a: [flang][hlfir] Add assignment mask operations

jeanPerier via All-commits all-commits at lists.llvm.org
Thu May 4 01:02:36 PDT 2023


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

  Changed paths:
    M flang/include/flang/Optimizer/HLFIR/HLFIROps.td
    M flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
    A flang/test/HLFIR/elsewhere.fir
    A flang/test/HLFIR/forall_mask.fir
    M flang/test/HLFIR/invalid.fir
    A flang/test/HLFIR/where.fir

  Log Message:
  -----------
  [flang][hlfir] Add assignment mask operations

Add hlfir.forall_mask, hlfir.where, and hlfir.elsewhere operations that
are operations that holds (optionally for hlfir.elsewhere) the
evaluation of a logical mask that controls the evaluation of nested
operations.

They allow representing Fortran forall control mask, as well as where
and eslewhere statements/constructs.

They use the OrderedAssignmentTreeOpInterface since they can all be used
inside Forall and their masks should be fully evaluated for all the
index-value set induced by parent Forall before any of the nested
operations in their body is evaluated.

I initially tried making them into a single operation with some attributes
to make a difference, but I felt this made the verifier/parser/printer and
usages messier/tricky compared to making three distinct operations that
represent the three Fortran feature in a vanilla way.

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




More information about the All-commits mailing list