[all-commits] [llvm/llvm-project] a49f63: [flang] Lower passing non assumed-rank/size to ass...

jeanPerier via All-commits all-commits at lists.llvm.org
Fri Jan 26 07:02:04 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a49f630cf6f12f3ca2d5814a581986140ee6e474
      https://github.com/llvm/llvm-project/commit/a49f630cf6f12f3ca2d5814a581986140ee6e474
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2024-01-26 (Fri, 26 Jan 2024)

  Changed paths:
    M flang/include/flang/Optimizer/Builder/FIRBuilder.h
    M flang/include/flang/Optimizer/Builder/HLFIRTools.h
    M flang/include/flang/Optimizer/Dialect/FIRType.h
    M flang/lib/Lower/CallInterface.cpp
    M flang/lib/Lower/ConvertCall.cpp
    M flang/lib/Lower/ConvertExprToHLFIR.cpp
    M flang/lib/Lower/ConvertVariable.cpp
    M flang/lib/Optimizer/Builder/FIRBuilder.cpp
    M flang/lib/Optimizer/Dialect/FIRType.cpp
    A flang/test/Lower/HLFIR/assumed-rank-iface-alloc-ptr.f90
    A flang/test/Lower/HLFIR/assumed-rank-iface.f90
    M flang/test/Lower/HLFIR/ignore-rank-unlimited-polymorphic.f90
    A flang/test/Lower/HLFIR/ignore-type-assumed-shape.f90

  Log Message:
  -----------
  [flang] Lower passing non assumed-rank/size to assumed-ranks (#79145)

Start implementing assumed-rank support as described in
https://github.com/llvm/llvm-project/blob/main/flang/docs/AssumedRank.md

This commit holds the minimal support for lowering calls to procedure
with assumed-rank arguments where the procedure implementation is done
in C.

The case for passing assumed-size to assumed-rank is left TODO since it
will be done a change in assumed-size lowering that is better done in
another patch.

Care is taken to set the lower bounds to zero when passing non allocatable no pointer as descriptor
to a BIND(C) procedure as required per 18.5.3 point 3. This was not done before while the requirements also applies to non assumed-rank descriptors. This change  required special attention with IGNORE_TKR(t) to avoid emitting invalid fir.rebox operations (the actual argument type must be used in this case as the output type). 

Implementation of Fortran procedure with assumed-rank arguments is still
TODO.




More information about the All-commits mailing list