[flang-commits] [PATCH] D134543: [flang] Lowers calls to procedure with CONTIGUOUS assumed shape dummies

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Sep 23 08:19:32 PDT 2022


jeanPerier created this revision.
jeanPerier added reviewers: clementval, PeteSteinfeld.
jeanPerier added a project: Flang.
Herald added subscribers: mehdi_amini, jdoerfert.
Herald added a project: All.
jeanPerier requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134543

Files:
  flang/include/flang/Lower/CallInterface.h
  flang/lib/Lower/CallInterface.cpp
  flang/lib/Lower/ConvertExpr.cpp
  flang/test/Lower/dummy-argument-assumed-shape-optional.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134543.462495.patch
Type: text/x-patch
Size: 32770 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220923/cb3318fe/attachment-0001.bin>


More information about the flang-commits mailing list