[all-commits] [llvm/llvm-project] 5ac8cc: [flang] Lowers calls to procedure with CONTIGUOUS ...

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Sep 26 06:11:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5ac8cc687bbc3b82fef8bdd289edf6e47015a634
      https://github.com/llvm/llvm-project/commit/5ac8cc687bbc3b82fef8bdd289edf6e47015a634
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2022-09-26 (Mon, 26 Sep 2022)

  Changed paths:
    M flang/include/flang/Lower/CallInterface.h
    M flang/lib/Lower/CallInterface.cpp
    M flang/lib/Lower/ConvertExpr.cpp
    A flang/test/Lower/dummy-argument-assumed-shape-optional.f90

  Log Message:
  -----------
  [flang] Lowers calls to procedure with CONTIGUOUS assumed shape dummies

Copy-in/copy-out was not triggered when calling a procedure with a
CONTIGUOUS assumed shape. The actual argument must be copied-in/out
if it is not contiguous.
The copy-in/copy-out takes care of argument optionality, and uses a
runtime check in order to only do the copy if the actual is not
contiguous at runtime.

This was already implemented for explicit shape dummy arguments. This
patch takes advantage of this implementation to deal with the copy-in
copy-out aspects. It only need add code to deals with wrapping the
created bare contiguous address into a fir.box (runtime descriptor),
taking care of the optional box aspects.

Using this existing code is only possible for actual argument that can
be passed via a bare address. Add a TODO for polymorphic entity, PDTs
and assumed rank where the existing copy-in/copy-out code may fail
(these copies are more complex) and that cannot be tested currently.

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




More information about the All-commits mailing list