[LLVMdev] Jump Theading/GVN bug - moving discussion to llvm-dev

Chandler Carruth chandlerc at google.com
Mon Feb 23 23:05:15 PST 2015


Will try to reply to the larger thread again soon, but a quick reply on a
bit of a tangent...

On Mon, Feb 23, 2015 at 8:45 PM, Hal Finkel <hfinkel at anl.gov> wrote:

>  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.
>

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150223/e565145f/attachment.html>


More information about the llvm-dev mailing list