Venkataramanan Kumar via llvm-dev
2018-Apr-25 12:43 UTC
[llvm-dev] Help on understanding assume shape array processing and array descriptors in LLVM IR
Hi, I am trying to understand how assume shaped arrays are received and processed in LLVM IR. I am using "flang" for my front end. 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 LLVM's array descriptors and how they are processed ? regards, Venkat. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180425/0946e0f5/attachment.html>
Epshteyn, Eugene via llvm-dev
2018-Apr-25 17:09 UTC
[llvm-dev] Help on understanding assume shape array processing and array descriptors in LLVM IR
Hello, I believe these descriptors are specific to flang, not to LLVM. You should probably ask your question on flang-dev list. Thank you, --Eugene From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Venkataramanan Kumar via llvm-dev Sent: Wednesday, April 25, 2018 8:44 AM To: llvm-dev at lists.llvm.org Subject: [llvm-dev] Help on understanding assume shape array processing and array descriptors in LLVM IR Hi, I am trying to understand how assume shaped arrays are received and processed in LLVM IR. I am using "flang" for my front end. 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 LLVM's array descriptors and how they are processed ? regards, Venkat. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180425/e930f9a1/attachment.html>
Venkataramanan Kumar via llvm-dev
2018-Apr-26 08:40 UTC
[llvm-dev] Help on understanding assume shape array processing and array descriptors in LLVM IR
Hi Eugene, On 25 April 2018 at 22:39, Epshteyn, Eugene via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hello, > > > > I believe these descriptors are specific to flang, not to LLVM. You > should probably ask your question on flang-dev list. > > > > Thank you, > > > > --Eugene >Thanks I will check with flang dev list.> > > *From:* llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] *On Behalf Of *Venkataramanan > Kumar via llvm-dev > *Sent:* Wednesday, April 25, 2018 8:44 AM > *To:* llvm-dev at lists.llvm.org > *Subject:* [llvm-dev] Help on understanding assume shape array processing > and array descriptors in LLVM IR > > > > Hi, > > I am trying to understand how assume shaped arrays are received and > processed in LLVM IR. I am using "flang" for my front end. > > 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 LLVM's array descriptors and how they > are processed ? > > regards, > Venkat. > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180426/c79b1c62/attachment.html>
Reasonably Related Threads
- Help on understanding assume shape array processing and array descriptors in LLVM IR
- [LLVMdev] EquivalenceClasses: findValue vs. findLeader
- [LLVMdev] RFC: change BoundsChecking.cpp to use address-based tests
- [LLVMdev] RFC: change BoundsChecking.cpp to use address-based tests
- BRI/ISDN, misdn.conf/misdn-init.conf, OpenVOX B100P and Etisalat in Dubai