[flang-commits] [flang] [flang][RFC] Adding a design document for assumed-rank objects (PR #71959)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Nov 13 08:55:55 PST 2023


================
@@ -0,0 +1,632 @@
+<!--===- docs/AssumedRank.md
+
+   Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+   See https://llvm.org/LICENSE.txt for license information.
+   SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+-->
+# Assumed-Rank Objects
+
+An assumed-rank is a data object that takes its rank from its effective
+argument. It is a dummy, or the associated entity of a SELECT RANK in the `RANK
+DEFAULT` or `RANK(*)` blocks. Its rank is not known at compile time. The rank
----------------
klausler wrote:

Please think about the case where an assumed-size array is associated with an assumed-rank dummy argument that is later forwarded to another assumed-size dummy argument.  When will the rank change then?  I seems best to change the rank to 1 at the first call; it reduces overall code size in this case, and makes the check for `RANK(*)` in `SELECT RANK` perhaps faster -- look for rank 1 and upper bound of -1.

https://github.com/llvm/llvm-project/pull/71959


More information about the flang-commits mailing list