<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
@font-face
{font-family:Calibri}
@font-face
{font-family:Tahoma}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif"}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif"}
span.EmailStyle17
{font-family:"Calibri","sans-serif";
color:#1F497D}
.MsoChpDefault
{font-size:10.0pt}
@page WordSection1
{margin:72.0pt 72.0pt 72.0pt 72.0pt}
div.WordSection1
{}
-->
</style>
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">> We did this at Tartan Labs back in the 90s.<span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Glad to know the idea makes sense.
</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal">> Sadly, you can't express the resulting source line information in the debug
</p>
<p class="MsoNormal">> directives used by any commonly available debugger (that I am aware of). </p>
<p class="MsoNormal">> So -- at the very most optimistic -- this approach won't get you anything
</p>
<p class="MsoNormal">> any time soon.</p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Oh, well. I wish I was more surprised by this.
</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:#1F497D">--
</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:#1F497D">John Dallman
</span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> Dean Sutherland [mailto:dsutherland@cert.org]
<br>
<b>Sent:</b> 07 June 2013 18:15<br>
<b>To:</b> Renato Golin<br>
<b>Cc:</b> Dallman, John; Clang Dev; LLVM Dev<br>
<b>Subject:</b> Re: [cfe-dev] Meaning of LLVM optimization levels</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Of course it's *possible*, in a fundamental sense. It's even pretty easy to get right in a compiler back end (in a conceptual sense). You have to touch a LOT of code, but all the changes are trivial. We did this at Tartan Labs back in
the 90s. Done with only a bit of care, it makes debugging possible at any optimization level. The idea is to make the debug information reflect what the optimizer and code generator actually did, rather than restricting them to the linear mapping supported
by most debuggers. If anyone cares, I can even give details now that the NDAs have finally expired.
</p>
<div>
<div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Sadly, you can't express the resulting source line information in the debug directives used by any commonly available debugger (that I am aware of). So -- at the very most optimistic -- this approach won't get you anything any time soon.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Dean Sutherland</p>
</div>
<div>
<p class="MsoNormal"><a href="mailto:dsutherland@cert.org">dsutherland@cert.org</a></p>
</div>
<div>
<p class="MsoNormal"> </p>
<div>
<div>
<div>
<p class="MsoNormal">On Jun 7, 2013, at 12:38 PM, Renato Golin <<a href="mailto:renato.golin@linaro.org">renato.golin@linaro.org</a>> wrote:</p>
</div>
<p class="MsoNormal"><br>
<br>
</p>
<div>
<p class="MsoNormal">On 7 June 2013 13:53, Dallman, John <<a href="mailto:john.dallman@siemens.com" target="_blank">john.dallman@siemens.com</a>> wrote:</p>
<div>
<div>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0cm 0cm 0cm 6.0pt; margin-left:4.8pt; margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style=""><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">It needs to be possible to debug code at any optimisation level.</span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Yes, I agree. But after O1, sequential execution is a big impediment for optimizations, and keeping the debug information valid after so many transformations might pose a big penalty on the passes (time & memory). That was the whole idea
of metadata being a second-class citizen.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0cm 0cm 0cm 6.0pt; margin-left:4.8pt; margin-right:0cm">
<div>
<p class="MsoNormal" style=""><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Related to optimisation levels, it's quite helpful to have a way of controlling</span></p>
<p class="MsoNormal" style=""><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">optimisation on a function-by-function level. This is very useful when you're trying
</span></p>
<p class="MsoNormal" style=""><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">to work out where in a file with many functions an optimiser problem is happening;</span></p>
<p class="MsoNormal" style=""><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">it isn't foolproof, but it helps a lot.</span></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">There are already people working on that, and discussions on the list about this very topic. I agree that it would be extremely helpful for debugging large programs.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">cheers,</p>
</div>
<div>
<p class="MsoNormal">--renato</p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></p>
</div>
<p class="MsoNormal"> </p>
</div>
</div>
</div>
</div>
</div>
<p style="font-family:Arial; font-size:70%">-----------------<br>
Siemens Industry Software Limited is a limited company registered in England and Wales.<br>
Registered number: 3476850.<br>
Registered office: Faraday House, Sir William Siemens Square, Frimley, Surrey, GU16 8QD.
</p>
</body>
</html>