<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Courier New";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#1F497D">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#1F497D">I believe these descriptors are specific to flang, not to LLVM.  You should probably ask your question on flang-dev list.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#1F497D">Thank you,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#1F497D">--Eugene<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> llvm-dev [mailto:llvm-dev-bounces@lists.llvm.org]
<b>On Behalf Of </b>Venkataramanan Kumar via llvm-dev<br>
<b>Sent:</b> Wednesday, April 25, 2018 8:44 AM<br>
<b>To:</b> llvm-dev@lists.llvm.org<br>
<b>Subject:</b> [llvm-dev] Help on understanding assume shape array processing and array descriptors in LLVM IR<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:#222222;background:white">Hi,</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:#222222"><br>
<br>
<span style="background:white">I am trying to understand how assume shaped arrays are received and</span><br>
<span style="background:white">processed in LLVM IR.  I am using "flang" for my front end.</span><br>
<br>
<span style="background:white">There seems to be an array descriptor received as implicit argument</span><br>
<span style="background:white">for every assume shaped array.</span><br>
<br>
<span style="background:white">For my test routine:</span><br>
<br>
<span style="background:white">---snip--</span><br>
<span style="background:white">   SUBROUTINE test(a,b,Li,Lj,Istr,Iend,Jstr,Jend)</span><br>
<span style="background:white">     INTEGER, INTENT(IN) :: Li,Lj</span><br>
<span style="background:white">     INTEGER, INTENT(IN) :: Istr, Iend, Jstr,Jend</span><br>
<span style="background:white">     INTEGER :: i, j</span><br>
<span style="background:white">     REAL*8, INTENT(INOUT)   :: a(Li:,Lj:)</span><br>
<span style="background:white">     REAL*8, INTENT(IN)      :: b(Li:,Lj:)</span><br>
<span style="background:white">--snip--</span><br>
<br>
<span style="background:white">I got the below LLVM IR, the parameters received.</span><br>
<br>
<span style="background:white">--snip--</span><br>
<span style="background:white">; Function Attrs: norecurse nounwind</span><br>
<span style="background:white">define void @test_(i64* noalias nocapture %a, i64* noalias nocapture</span><br>
<span style="background:white">readonly %b, i64* noalias nocapture readonly %li, i64* noalias</span><br>
<span style="background:white">nocapture readonly %lj, i64* noalias nocapture readonly %istr, i64*</span><br>
<span style="background:white">noalias nocapture readonly %iend, i64* noalias nocapture readonly</span><br>
<span style="background:white">%jstr, i64* noalias nocapture readonly %jend, i64* noalias nocapture</span><br>
<span style="background:white">readonly %"a$sd", i64* noalias nocapture readonly %"b$sd")</span><br>
<span style="background:white">local_unnamed_addr #0 !dbg !5 {</span><br>
<span style="background:white">--snip--</span><br>
<br>
<span style="background:white">Here "a$sd" and "b$sd" looks like array descriptors and received as</span><br>
<span style="background:white">implicit parameters.</span><br>
<br>
<span style="background:white">I found this article which explains how gfortran implements:</span><br>
</span><a href="http://thinkingeek.com/2017/01/14/gfortran-array-descriptor/" target="_blank"><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:#1155CC;background:white">http://thinkingeek.com/2017/01/14/gfortran-array-descriptor/</span></a><span style="font-size:9.5pt;font-family:"Arial",sans-serif;color:#222222"><br>
<br>
<span style="background:white">Can Someone throw some light on LLVM's array descriptors and how they</span><br>
<span style="background:white">are processed ?</span><br>
<br>
<span style="background:white">regards,</span><br>
<span style="background:white">Venkat.</span></span> <o:p></o:p></p>
</div>
</div>
</body>
</html>