<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 9, 2016, at 11:01 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Dec 9, 2016 at 10:43 AM Adrian Prantl via Phabricator <<a href="mailto:reviews@reviews.llvm.org" class="">reviews@reviews.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">aprantl marked 4 inline comments as done.<br class="gmail_msg">
aprantl added a comment.<br class="gmail_msg">
<br class="gmail_msg">
In <a href="https://reviews.llvm.org/D27550#618335" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D27550#618335</a>, @dblaikie wrote:<br class="gmail_msg">
<br class="gmail_msg">
> Not quite following all the changes here, but they look roughly plausible.<br class="gmail_msg">
><br class="gmail_msg">
> Is there some code I couldn't find that sorts all the fragments before emitting them? (the old scheme wouldn't've needed this, since each bit_piece could specify where it appears - but maybe we were already sorting them anyway so pieces were linearly increasing in position? - the new scheme would require such sorting because the positions are implicit relative to prior pieces)<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Yes, DebugLocEntry::sortUniqueValues() (and possibly others locations) is sorting the fragments by offset.<br class="gmail_msg"></blockquote><div class=""><br class="">Ah, thanks - and what happens if there's overlap? Is there some error handling?</div></div></div></div></blockquote><div><br class=""></div><div>DwarfDebug::buildLocationList() collects looks at the fragments and and then chops up their ranges into the smallest continuous region that is covered by a set of non-overlapping fragments. So what will likely happen is that it will produce a zero-sized region for the first overlapping fragment that will then be silently dropped.</div><div><br class=""></div><div>-- adrian</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
================<br class="gmail_msg">
Comment at: lib/CodeGen/AsmPrinter/DwarfUnit.cpp:505<br class="gmail_msg">
   }<br class="gmail_msg">
+  Expr.AddExpression(ArrayRef<uint64_t>(DIExpr));<br class="gmail_msg">
+  Expr.finalize();<br class="gmail_msg">
----------------<br class="gmail_msg">
dblaikie wrote:<br class="gmail_msg">
> makeArrayRef?<br class="gmail_msg">
Nice. Didn't know we had that.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
================<br class="gmail_msg">
Comment at: test/DebugInfo/AArch64/frameindices.ll:9<br class="gmail_msg">
+; CHECK: DW_AT_location [DW_FORM_block1]    (<0x0c> 93 01 91 51 93 0f 93 01 91 4a 93 07 )<br class="gmail_msg">
+;  -- piece 0x00000001, fbreg -47, piece 0x0000000f, piece 0x00000001, fbreg -54, piece 0x00000007 ------^<br class="gmail_msg">
 ; CHECK: DW_AT_abstract_origin {{.*}} "p1"<br class="gmail_msg">
----------------<br class="gmail_msg">
dblaikie wrote:<br class="gmail_msg">
> Took me a bit to go through both these examples (keeping both the DW_OP_bit_piece/piece interpretations in my head, etc) - but yes, great to see this, as it looks good/right/etc :)<br class="gmail_msg">
Thanks, from past experience,  I really appreciate someone double-checking this!<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
================<br class="gmail_msg">
Comment at: test/DebugInfo/MIR/X86/bit-piece-dh.mir:1<br class="gmail_msg">
+# RUN: llc -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s<br class="gmail_msg">
+# CHECK: .debug_info contents:<br class="gmail_msg">
----------------<br class="gmail_msg">
dblaikie wrote:<br class="gmail_msg">
> what's 'dh' stand for in the title of this test?<br class="gmail_msg">
><br class="gmail_msg">
> What codepath does this test? (looks like the expression isn't in DIExpression - it's created in some MI/CodeGen layer?)<br class="gmail_msg">
The 8-bit x86 register "dh" hi-part of (r)dx.<br class="gmail_msg">
<br class="gmail_msg">
```<br class="gmail_msg">
0    8   16    32       64<br class="gmail_msg">
+-----------------------+<br class="gmail_msg">
|              rdx      |<br class="gmail_msg">
|        edx    |       |<br class="gmail_msg">
|    dx   |     |       |<br class="gmail_msg">
| dl | dh |     |       |<br class="gmail_msg">
+----+----+-----+-------+<br class="gmail_msg">
```<br class="gmail_msg">
<br class="gmail_msg">
This is testing DwarfExpression.cpp:111 (Walk up the super-register chain until we find a valid number and emit a DW_OP_bit_piece for it).<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
================<br class="gmail_msg">
Comment at: test/DebugInfo/X86/dw_op_minus_direct.ll:9-12<br class="gmail_msg">
+; CHECK: Beginning address offset: 0x0000000000000000<br class="gmail_msg">
+; CHECK:    Ending address offset: 0x0000000000000004<br class="gmail_msg">
+; CHECK:     Location description: 50 10 01 1c 93 04<br class="gmail_msg">
+;                                  rax, constu 0x00000001, minus, piece 0x00000004<br class="gmail_msg">
----------------<br class="gmail_msg">
dblaikie wrote:<br class="gmail_msg">
> This is test coverage for DwarfExpression.cpp:244-ish? Probably better as a separate commit?<br class="gmail_msg">
It tests a bugfix that fell out of this rewrite/factoring. The code in trunk would have crashed when it encountered a DW_OP_minus without a DW_OP_deref. I would leave it in here.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D27550" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D27550</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div></div>
</div></blockquote></div><br class=""></body></html>