<div dir="ltr">My experience is that just running mem2reg (while <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">disabling virtually all other passes<span> </span></span>) in O1 will substantially improve <font face="arial, helvetica, sans-serif">d<span style="color:rgb(34,34,34);font-size:13.3333px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">ebuggability</span></font>

 while giving acceptable performance.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 29, 2018 at 11:39 AM, via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_187929368929619482WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">(Remembering to +llvm-dev this time…)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><a name="m_187929368929619482__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">There has been some progress in the direction of improving debuggability of optimized code, in the past year.  There have been a number
 of patches to improve tracking of debug info in various passes, and some more general improvements such as work on the LiveDebugValues pass.  I don't think anyone has done a specific analysis to identify passes that lose debug info.<u></u><u></u></span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">However, various people/teams have an interest in making improvements here, and continue to devote some resources to the longer term project.  For example there
 is the Extend Lifetimes work described by Wolfgang Pieb at the 2017 LLVM Developers Meeting.  We have also looked into how the instruction scheduler might be interfering with the debugging experience.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Part of the problem is that the "debugging experience" is a fairly qualitative thing, but in order to attack the problem properly we need a more analytic quantitative
 measure of how we are doing, which will hopefully lead us to areas where things can improve.  See for example the DIVA tool, described at the 2017 EuroLLVM.  Sony also has some other internal tools, which I hope we can describe at future meetings and make
 available to the community.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">In short, there is continued interest and (more importantly) effort towards both –Og in particular and improving the debugging of optimized code in general. 
 I am hopeful that we can eventually reach a point where we can define an –Og that is as debuggable as –O0 while still having distinctly better runtime performance.  Whether –Og becomes its own thing, or ends up as a redefinition of –O1, remains to be decided.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thanks for your interest, and giving me a reason to write up this little summary.  And if you are motivated to help with the project, that's great!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">--paulr<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></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 #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> llvm-dev [mailto:<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@<wbr>lists.llvm.org</a>]
<b>On Behalf Of </b>Son Tuan VU via llvm-dev<br>
<b>Sent:</b> Monday, January 29, 2018 7:35 AM<br>
<b>To:</b> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<b>Subject:</b> [llvm-dev] Debuggability of -O1 level<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hello all,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I've found an old post (November 2016) <a href="http://lists.llvm.org/pipermail/llvm-dev/2016-November/107006.html" target="_blank">
http://lists.llvm.org/<wbr>pipermail/llvm-dev/2016-<wbr>November/107006.html</a> which discussed debug information for optimized code. At the end of that discussion, Adrian broached <span style="color:black">the interest in making -O1 only enable optimizations. I see
 in the code (<b>clang/lib/Frontend/<wbr>CompilerInvocation.cpp</b>, in function <b>getOptimizationLevel</b>) that
<b>-Og</b> option is equivalent to <b>-O1</b>. Does this mean any progress on making
<b>-O1</b> the GCC's <b>-Og</b>? If not, would someone kindly tell me what is holding the debuggability at
<b>-O1</b> back? Which optimization passes are removing our debug info at this <b>
-O1</b> level?</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">Thank you for your help,</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">Son Tuan Vu<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div></div></div>
</div>
</div>

<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>