<div class="gmail_quote">On Mon, Jan 9, 2012 at 6:44 PM, Jakob Stoklund Olesen <span dir="ltr"><<a href="mailto:stoklund@2pi.dk">stoklund@2pi.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class="h5"><br><div><div>On Jan 9, 2012, at 6:10 PM, Chandler Carruth wrote:</div><br><blockquote type="cite"><div class="gmail_quote">On Mon, Jan 9, 2012 at 5:34 PM, Jakob Stoklund Olesen <span dir="ltr"><<a href="mailto:stoklund@2pi.dk" target="_blank">stoklund@2pi.dk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>As always, test cases for this stuff are insane.<br></div></blockquote></div><br><div>This is starting to worry me. How will we ever catch regressions? It seems like there has to be a way to write test cases for this kind of stuff, even if it means digging out and exposing more of the innards... Maybe this is a place where unit tests could actually work? I haven't looked at it at all, I'm just looking for a way to write non-insane test cases for this (clearly tricky) part of the backend....</div>

</blockquote></div><br></div></div><div>The particular issue is exposed when an instruction is at a function offset == 2 (mod 4), and it references an 8-byte aligned constant pool entry, and there is at least 4k of basic block both before and after the instruction.</div>
<div><br></div><div>While it may be practical to write a unit test for that particular case, it seems like a dead end for most other cases. A codegen pass depends on a lot of data structures being in place, and generating MI IR programmatically is horrible.</div>
</div></blockquote><div><br></div><div>Sorry, I didn't mean to call any particular attention to this patch or its specifics...</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>As we discussed before, the best solution is to feed serialized MI IR directly into the pass. It's just a small matter of engineering.</div></div></blockquote><div><br></div><div>
I agree with the strategy, sorry that my previous email was a bit confusing.</div><div><br></div><div>I'm mostly just trying to periodically check to see if we've crossed the threshold where the engineering for the serialization and deserialization of MI IR needs to be done. It isn't clear to me where the threshold is, but it seems we must be close to it given complexity in the ARM backend....</div>
<div><br></div><div>Anyways, it seems you're not worried yet, so I'll go away for a while again. =]</div></div>