<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:11.0pt;
font-family:"Calibri",sans-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;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
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;-webkit-nbsp-mode: space;line-break:after-white-space">
<div class="WordSection1">
<p class="MsoNormal">This is not how tuning-controlled features are supposed to work. I will comment on the review.<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> vsk@apple.com <vsk@apple.com> <b>On Behalf Of </b>
Vedant Kumar<br>
<b>Sent:</b> Friday, February 7, 2020 3:26 PM<br>
<b>To:</b> Robinson, Paul <paul.robinson@sony.com><br>
<b>Cc:</b> David Blaikie <dblaikie@gmail.com>; nikola.prica@rt-rk.com; ibaev@cisco.com; asowda@cisco.com; llvm-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [llvm-dev] Enabling debug entry value production by default<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The actual DWARF emission for call site parameters is gated inside of DwarfDebug::constructCallSiteEntryDIEs by `tuneForGDB() || tuneForLLDB()`.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">However, we are creating+updating CallSiteInfo (basically, in-memory only bookkeeping used by the backend to keep track of call sites) even when the debugger tuning is set to the Sony debugger. If this creates problems, feel free to file
a bug and I'll address it. However, there's an upside to maintaining all this CallSiteInfo even if TAG_call_site_parameters won't be emitted. The backend asserts whenever a MachineInstr carrying CallSiteInfo is destroyed without the call information being
updated. This provides useful test coverage.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">vedant<o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Feb 7, 2020, at 2:50 PM, Robinson, Paul <<a href="mailto:paul.robinson@sony.com">paul.robinson@sony.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">I’ve asked someone to check with our (Sony) debugger people, likely hear back early next week. I’d say proceed with having it default on/off based on tuning as you described, and if my guys want to see it turned on, we can fix it later.
I have to say, a quick skim through D73534 made me think it’s not controlled that way right now, is that still a TODO?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks for all the work to support this feature!<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">--paulr<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<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">
<div>
<p class="MsoNormal"><b>From:</b><span class="apple-converted-space"> </span>llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org"><span style="color:purple">llvm-dev-bounces@lists.llvm.org</span></a>><span class="apple-converted-space"> </span><b>On Behalf
Of<span class="apple-converted-space"> </span></b>Vedant Kumar via llvm-dev<br>
<b>Sent:</b><span class="apple-converted-space"> </span>Friday, February 7, 2020 2:04 PM<br>
<b>To:</b><span class="apple-converted-space"> </span>David Blaikie <<a href="mailto:dblaikie@gmail.com"><span style="color:purple">dblaikie@gmail.com</span></a>><br>
<b>Cc:</b><span class="apple-converted-space"> </span><a href="mailto:llvm-dev@lists.llvm.org"><span style="color:purple">llvm-dev@lists.llvm.org</span></a>;<span class="apple-converted-space"> </span><a href="mailto:nikola.prica@rt-rk.com"><span style="color:purple">nikola.prica@rt-rk.com</span></a>;<span class="apple-converted-space"> </span><a href="mailto:ibaev@cisco.com"><span style="color:purple">ibaev@cisco.com</span></a>;<span class="apple-converted-space"> </span><a href="mailto:asowda@cisco.com"><span style="color:purple">asowda@cisco.com</span></a><br>
<b>Subject:</b><span class="apple-converted-space"> </span>Re: [llvm-dev] Enabling debug entry value production by default<o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Yep, TAG_call_site_parameter and its children shouldn't require any extra relocations. Thanks!<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">vedant<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><br>
<br>
<br>
<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal">On Feb 7, 2020, at 2:01 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com"><span style="color:purple">dblaikie@gmail.com</span></a>> wrote:<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">For that sort of small growth, if it doesn't add more relocations (I think the call sites need them (but they're already emitted/that's not what we're discussing enabling here), but call value descriptions don't), sounds good to me :)<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">On Fri, Feb 7, 2020 at 12:04 PM Vedant Kumar <<a href="mailto:vedant_kumar@apple.com"><span style="color:purple">vedant_kumar@apple.com</span></a>> wrote:<o:p></o:p></p>
</div>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal">Hi all,<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">I think we've reached a state where we're ready to enable debug entry value production by default for the x86_64, ARM, and AArch64 targets. For context, this is a debug info feature that allows debuggers to recover the value of unmodified
optimized-out parameters by 'going up' a stack frame and interpreting spilled values, constants, etc. to work out what was passed to the callee. There's a nice write-up about the impact of this feature in [3]. A big thank you to all of contributors who've
helped us get here (I've tried to CC everyone, sincere apologies if I've accidentally left you out).<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">I believe Djordje and I have shown that there isn't an outsized binary size or compile time impact of enabling this feature. The aggregate size of DWARF in a stage2 x86_64 RelWithDebInfo clang build grows by under 0.2%, and we didn't find
a significant compile time impact. We've shared CTMark results (both compile-time & DWARF section size numbers), as well as a size analysis of stage2 builds of {llc, clang, lldb} in [1].<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Djordje has also shared a nice location statistics comparison chart in [1], showing increased variable availability with entry values enabled.<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">For my part, I instrumented lldb's DWARFExpression::Evaluate method to log instances in which a variable location is unavailable. I then used a script [4] to single-step through a stage2 RelWithDebInfo+entryvals clang binary as it was compiling
sqlite3.c, printing local variables at each stop. Without entry values, lldb reported "variable not available" 883,918 times. With entry values lldb reported "variable not available" 687,899 times (a 22% drop).<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Does anyone have concerns about enabling this feature?<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">thanks,<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">vedant<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">[1] <a href="https://reviews.llvm.org/D73534" target="_blank"><span style="color:purple">[DebugInfo] Enable the debug entry values feature by default</span></a><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">[2] <a href="https://reviews.llvm.org/D73700" target="_blank"><span style="color:purple">[CallSiteInfo] Fix the assertions regarding updating the CallSiteInfo</span></a>, <a href="https://reviews.llvm.org/D74122" target="_blank"><span style="color:purple">[CallSiteInfo]
Use the isCandidateForCallSiteEntry() when update the cs info</span></a><o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">[3]<span class="apple-converted-space"> </span><a href="https://robert.ocallahan.org/2018/11/comparing-quality-of-debug-information.html" target="_blank"><span style="color:purple">https://robert.ocallahan.org/2018/11/comparing-quality-of-debug-information.html</span></a><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">[4] <a href="https://gist.github.com/vedantk/7602b20a9e1d44c42d32dcca36591cc0" target="_blank"><span style="color:purple">https://gist.github.com/vedantk/7602b20a9e1d44c42d32dcca36591cc0</span></a><o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>