Help on understanding assume shape array processing and array descriptors.

16 views
Skip to first unread message

Venkataramanan Kumar

unread,
Apr 26, 2018, 7:27:55 AM4/26/18
to flang-dev
Hi, 

I am trying to understand how assume shaped arrays are sent to a subroutine and
processed in flang and LLVM IR

There seems to be an array descriptor received as implicit argument
for every assume shaped array.

For my test routine:

---snip--
   SUBROUTINE test(a,b,Li,Lj,Istr,Iend,Jstr,Jend)
     INTEGER, INTENT(IN) :: Li,Lj
     INTEGER, INTENT(IN) :: Istr, Iend, Jstr,Jend
     INTEGER :: i, j
     REAL*8, INTENT(INOUT)   :: a(Li:,Lj:)
     REAL*8, INTENT(IN)      :: b(Li:,Lj:)
--snip--

I got the below LLVM IR, the parameters received.

--snip--
; Function Attrs: norecurse nounwind
define void @test_(i64* noalias nocapture %a, i64* noalias nocapture
readonly %b, i64* noalias nocapture readonly %li, i64* noalias
nocapture readonly %lj, i64* noalias nocapture readonly %istr, i64*
noalias nocapture readonly %iend, i64* noalias nocapture readonly
%jstr, i64* noalias nocapture readonly %jend, i64* noalias nocapture
readonly %"a$sd", i64* noalias nocapture readonly %"b$sd")
local_unnamed_addr #0 !dbg !5 {
--snip--

Here "a$sd" and "b$sd" looks like array descriptors and received as
implicit parameters.

I found this article which explains how gfortran implements:
http://thinkingeek.com/2017/01/14/gfortran-array-descriptor/

Can Someone throw some light on Flang's array descriptors and how they are set and processed ?

regards,
Venkat.

John Leidel

unread,
Apr 26, 2018, 7:35:01 AM4/26/18
to Venkataramanan Kumar, flang-dev
Venkat, Flang is no longer under active development. The official
Flang development was transferred over to PGI as they are developing
an official Fortran frontend for LLVM.
> --
> You received this message because you are subscribed to the Google Groups
> "flang-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to flang-dev+...@googlegroups.com.
> To post to this group, send email to flan...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/flang-dev/2be84bc6-f644-4bf7-b2aa-634c3f897664%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Venkataramanan Kumar

unread,
Apr 26, 2018, 7:48:13 AM4/26/18
to flang-dev
Thanks you for the reply. 

First I asked this question in LLVM mailing list but was told to check here.

Now  How can I contact PGI? do they have a mailing list ?

Hal Finkel

unread,
Apr 26, 2018, 1:40:25 PM4/26/18
to Venkataramanan Kumar, flang-dev
On 04/26/2018 06:48 AM, Venkataramanan Kumar wrote:
Thanks you for the reply. 

First I asked this question in LLVM mailing list but was told to check here.

Now  How can I contact PGI? do they have a mailing list ?

See here: https://github.com/flang-compiler/flang

The links to the mailing list, etc. are there as well.

 -Hal


For more options, visit https://groups.google.com/d/optout.

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory
Reply all
Reply to author
Forward
0 new messages