<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 18, 2013 at 10:45 AM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.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="HOEnZb"><div class="h5">On Mon, Nov 18, 2013 at 10:37 AM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:<br>

><br>
> On Mon, Nov 18, 2013 at 10:35 AM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>><br>
> wrote:<br>
>><br>
>> >> At a minimum, it seems like we need a version number in the debug info<br>
>> >> metadata so we can detect this situation and avoid crashing.<br>
>> ><br>
>> ><br>
>> > Or to put it in the terms of the IR: we need to autoupgrade the debug<br>
>> > info<br>
>> > metadata just like we do intrinsics. With debug info this might (at the<br>
>> > worst) involve dropping old metadata.<br>
>> ><br>
>><br>
>> The verifier is probably the best route here. I think if we fail debug<br>
>> info verification we can just strip it and continue.<br>
><br>
><br>
> I'm slightly worried about relying on verification based "autoupgrade"<br>
> (where by upgrade I mean discard old cruft since it doesn't impact<br>
> correctness) due to compile time costs, but if the verification is fast<br>
> enough to be "always on", then cool.<br>
<br>
</div></div>Agreed, it's not really that fast either. The problem with versions is<br>
that it makes small changes that only require a bit of modification to<br>
the testcase to be pretty heinous upgrade paths and a lot of work -<br>
you can see that from the work any of us have had to do when changing<br>
the format. We'd like to keep the testcases and upgrade those as well<br>
because otherwise we're just dropping testcases like mad constantly.<br>
It's a lot of work, but the format has been changing frequently enough<br>
that we'd be on version 1000 or something by now and it wouldn't<br>
really accomplish much. The verifier seems to be the best route for<br>
that. It isn't too fast, but then reading in bitcode files from disk<br>
isn't particularly speedy either.</blockquote><div><br></div><div>It depends a bit, also, on what kind of guarantees we need to offer. If the guarantee when reading IR from disk is "will not crash" then there's nothing for it but to run full debug info verification. <br>
<br>On the other hand, if we can assume that some specific metadata implies the correctness of some other metadata, then all we need to do is check a known debug info version number. If it's the current number, do nothing (assume the rest of the debug info is up to date and well formed), otherwise do all the work to find the debug info and dump it (no need to verify it - we just have to do the work to find it, so we don't go following bad links later on - that should be as easy as dropping the <a href="http://llvm.dbg.cu">llvm.dbg.cu</a> named node and removing all debug intrinsics and the instruction metadata line references). But this latter scheme isn't robust against arbitrary metadata (that could, coincidentally, have the right version number and arbitrary metadata that breaks all our debug info metadata assumptions)<br>
<br>If the latter is sufficient for everyone's needs/principles, great.<br><br>- David</div></div></div></div>