[flang] Implement more transformational intrinsic functions in runtime
authorpeter klausler <pklausler@nvidia.com>
Thu, 20 May 2021 17:37:03 +0000 (10:37 -0700)
committerpeter klausler <pklausler@nvidia.com>
Thu, 20 May 2021 20:22:01 +0000 (13:22 -0700)
commitc1db35f0c232a8672d44f2531d178d4da35b5b3c
tree43763693504fa14cdd8035e155f2ee07e582526b
parente3cf7c88c472aff8ca6c8a07ef8c6513f581c67a
[flang] Implement more transformational intrinsic functions in runtime

Define APIs, naively implement, and add basic sanity unit tests for
the transformational intrinsic functions CSHIFT, EOSHIFT, PACK,
SPREAD, TRANSPOSE, and UNPACK.  These are the remaining transformational
intrinsic functions that rearrange data without regard to type
(except for default boundary values in EOSHIFT); RESHAPE was already
in place as a stress test for the runtime's descriptor handling
facilities.

Code is in place to create copies of allocatable/automatic
components when transforming arrays of derived type, but it won't
do anything until we have derived type information being passed to the
runtime from the frontend.

Differential Revision: https://reviews.llvm.org/D102857
17 files changed:
flang/module/__fortran_type_info.f90
flang/runtime/CMakeLists.txt
flang/runtime/allocatable.cpp
flang/runtime/copy.cpp [new file with mode: 0644]
flang/runtime/copy.h [new file with mode: 0644]
flang/runtime/descriptor.h
flang/runtime/tools.cpp
flang/runtime/tools.h
flang/runtime/transformational.cpp
flang/runtime/transformational.h
flang/runtime/type-info.h
flang/unittests/Evaluate/reshape.cpp
flang/unittests/RuntimeGTest/CMakeLists.txt
flang/unittests/RuntimeGTest/Matmul.cpp
flang/unittests/RuntimeGTest/Namelist.cpp
flang/unittests/RuntimeGTest/Reduction.cpp
flang/unittests/RuntimeGTest/Transformational.cpp [new file with mode: 0644]