<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 15, 2015 at 1:45 PM, Frederic Riss <span dir="ltr"><<a href="mailto:friss@apple.com" target="_blank">friss@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: friss<br>
Date: Sun Mar 15 15:45:39 2015<br>
New Revision: 232332<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=232332&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=232332&view=rev</a><br>
Log:<br>
[MCDwarf] Do not emit useless line table opcode.<br>
<br>
No need to emit a DW_LNS_advance_pc with a 0 increment. Found out while<br>
comparing dsymutil's and LLVM's line table encoding. Not a correctenss<br>
fix, just a small encoding size optimization.<br>
<br>
I'm not sure how to generate a sequence that triggers this, and moreover<br>
llvm-dwardump doesn't dump the line table program, thus the effort<br>
involved in creating a testcase for this trivial patch seemed out of<br>
proportion.<br></blockquote><div><br></div><div>Still, nice to test optimizations, if you want them to hold/not regress. In this case, since it doesn't affect the resulting line table description (in terms of what dwarfdump would print - if I undrestand you correctly?) it might be appropriate to do a raw assembly test (or, if you're going to be debugging line table program issues - introducing a new dumping format that prints the actual line table program, rather than the table generated by the program, might be useful)<br><br>As for the sequence that triggers this - I guess you had some test case you were rurnning where you observed this behavior?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified:<br>
    llvm/trunk/lib/MC/MCDwarf.cpp<br>
<br>
Modified: llvm/trunk/lib/MC/MCDwarf.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=232332&r1=232331&r2=232332&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=232332&r1=232331&r2=232332&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/MC/MCDwarf.cpp (original)<br>
+++ llvm/trunk/lib/MC/MCDwarf.cpp Sun Mar 15 15:45:39 2015<br>
@@ -446,7 +446,7 @@ void MCDwarfLineAddr::Encode(MCContext &<br>
   if (LineDelta == INT64_MAX) {<br>
     if (AddrDelta == MAX_SPECIAL_ADDR_DELTA)<br>
       OS << char(dwarf::DW_LNS_const_add_pc);<br>
-    else {<br>
+    else if (AddrDelta) {<br>
       OS << char(dwarf::DW_LNS_advance_pc);<br>
       encodeULEB128(AddrDelta, OS);<br>
     }<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>