<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 18, 2013 at 11:22 AM, Adrian Prantl <span dir="ltr"><<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On Oct 18, 2013, at 10:35, Adrian Prantl <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> wrote:<br>
<br>
><br>
> On Oct 18, 2013, at 10:24, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
><br>
>><br>
>><br>
>><br>
>> On Fri, Oct 18, 2013 at 10:12 AM, Adrian Prantl <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> wrote:<br>
>> Any final verdict for this change?<br>
>><br>
>> I'm not really familiar with this stuff to provide a 'final verdict' as it were, but I'll ask some questions anyway...<br>
>><br>
>> Is this the correct test? Is it possible that the variable might be reconstituted around the call, rather than kept live for the entire range?<br>
>> If there are things that prevent the alloca from being elided, are those things enshrined in a test somewhere that we could reuse, rather than reimplementing one part of them?<br>
><br>
> That’s a very good point indeed: I just discovered<br>
>> bool llvm::isAllocaPromotable(const AllocaInst *AI)<br>
> in mem2reg.<br>
<br>
</div>Yes that seems to work fine and is a lot cleaner.</blockquote><div><br>Great. So I'm reading your comment in the code and I'm curious - you say it reduces the number of location DIEs... I guess you mean entries in the location list? (in the debug_loc section) which aren't really DIEs?<br>
<br>Why is that? What kind of locations were we emitting? Should the DWARF emission code have been doing a better job coalescing these locations if the variable was in the alloca all along anyway?<br><br>Or are we dealing with a situation where the alloca exists, but the variable is temporarily in registers and without your change we described each of those register locations, but now we just describe the location as the alloca?<br>
<br>Is this going to improve or hurt the debugging experience much? What happens if the variable is in a register when the user goes to print it out and instead they get the stale value that's still in the alloca? </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> </blockquote></div></div></div>