[all-commits] [llvm/llvm-project] d1aa9b: [flang] lower select rank (#93967)

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Jun 3 08:20:29 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d1aa9bac3c8ecc30fcc5d4d80a1f70c729aec909
      https://github.com/llvm/llvm-project/commit/d1aa9bac3c8ecc30fcc5d4d80a1f70c729aec909
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2024-06-03 (Mon, 03 Jun 2024)

  Changed paths:
    M flang/include/flang/Lower/ConvertExprToHLFIR.h
    M flang/lib/Evaluate/check-expression.cpp
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Optimizer/Builder/HLFIRTools.cpp
    A flang/test/Lower/HLFIR/select-rank.f90

  Log Message:
  -----------
  [flang] lower select rank (#93967)

Lower select rank according to [assumed-rank lowering design
doc](https://github.com/llvm/llvm-project/blob/main/flang/docs/AssumedRank.md).

The construct is lowered using fir.box_rank and fir.select_case
operation and, for the non pointer/allocatable case, a
fir.is_assumed_size + conditional branch before the select_case to deal
with the assumed-size case.

The way the CFG logic is generated, apart from the extra conditional
branch for assumed-size, is similar to what is done for SELECT CASE
lowering, hence the sharing of the construct level visitor. 
For the CFG parts. The main difference is that we need to keep track of
the selector to cook it and map it inside the cases (hence the new
members of the ConstructContext).

The only TODOs left are to deal with the RANK(*) case for polymorphic
entities and PDTs. I will do the polymorphic case in a distinct patch,
this patch has enough content.

Fortran::evaluate::IsSimplyContiguous change  is needed to avoid generating
copy-in/copy-out runtime calls when passing the RANK(*) associating
entity to some implicit interface.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list