<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=us-ascii">
<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;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Pedantically, DW_AT_abstract_origin is not required on a DW_TAG_inlined_subroutine; the DWARF spec says a concrete instance “may” omit attributes not specific to that instance, in which case there will be an abstract origin that will have
 those attributes.  It then goes on to point out that declaration coordinates (DW_AT_decl_[file,line,column]) are for the declaration, not the inlining site, which makes them good candidates for hoisting to the abstract origin.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">That is, DW_AT_abstract_origin is a way to optimize for size; it isn’t mandatory.  So, I think llvm-dwarfdump is correct to allow it.  I might prefer that “inlined functions without abstract origin” be what’s called out separately, rather
 than the “with” case, as the “without” cases represent a likely opportunity for size reduction.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I don’t *<b>think</b>* we ever emit an inlined_subroutine without an abstract origin?  If we want to make it an assertion on the emission side, that would be fine.  In fact, now that we omit DW_TAG_formal_parameter where the parameter has
 been optimized away, it’s probably a good idea to have an assertion like that.<o:p></o:p></p>
<p class="MsoNormal">--paulr<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> llvm-dev <llvm-dev-bounces@lists.llvm.org> <b>On Behalf Of
</b>Djordje Todorovic via llvm-dev<br>
<b>Sent:</b> Wednesday, April 28, 2021 7:12 AM<br>
<b>To:</b> llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Cc:</b> asowda@cisco.com<br>
<b>Subject:</b> [llvm-dev] llvm-dwarfdump stats for inlined functions<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><span style="color:black">Hi, <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><span style="color:black">As discussed on the
<a href="https://urldefense.com/v3/__https:/reviews.llvm.org/D101025__;!!JmoZiZGBv3RvKRSx!p1JI3vREt1U9y0e7eU5KzIYOZy_bS-TM7CS1N8x6VtUXLtdwkALSba9mVadBYExR-Q$">
https://reviews.llvm.org/D101025</a>, we have noticed that there are two different stat categories for inlined functions when using `llvm-dwarfdump –statistics`: <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;text-indent:.5in;line-height:106%">
<span style="color:black"># inlined functions <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;text-indent:.5in;line-height:106%">
<span style="color:black"># inlined functions with abstract origin <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><span style="color:black">and it was introduced after the
</span><b><span lang="EN-GB" style="font-size:10.5pt;line-height:106%;font-family:"Segoe UI",sans-serif;color:#464C5C;background:#ECEEF4">D58849</span><span style="color:black">.
</span></b><span style="color:black">We were wondering if there is a particular motivation of doing so.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><span style="color:black">Having an inlined_subroutine DIE with no abstract_origin attribute does not have so many benefits, so it might be better if we have an assertion/error (e.g., in the
 AsmPrinter) when we face such situation (or just to avoid dumping it into the final DWARF).<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><span style="color:black">Any thoughts? <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><span style="color:black">Best regards, <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><span style="color:black">Djordje <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
</div>
</div>
</body>
</html>