<div dir="ltr"><div class="gmail_extra">Will try to reply to the larger thread again soon, but a quick reply on a bit of a tangent...</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 23, 2015 at 8:45 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":4g6" class="a3s" style="overflow:hidden"> 2. Should unreachable code be allowed to contain nonsense (like instructions that depend on themselves)? To this, I believe the answer is no. We currently permit this, and I think that a lot of the bugs regarding unreachable code some from this. I've yet to hear a good argument why, for example, JumpThreading must produce self-referential instructions in trivially-dead regions.<br></div></blockquote></div><br>I could easily see tightening the rules on what passes the verifier within unreachable code to try to make it substantially cheaper, easier, and less error prone to handle unreachable code. It seems likely that there are good pragmatic compromises here that would actually cost nothing. Obvious example is, as you highlight, self-referential non-phi instructions could easily just be rejected, and asserted during construction by the IR builder.</div></div>