Jump Theading/GVN bug

Chandler Carruth chandlerc at google.com
Mon Feb 23 09:55:18 PST 2015


On Mon, Feb 23, 2015 at 8:21 AM, Daniel Berlin <dberlin at dberlin.org> wrote:

> On Mon Feb 23 2015 at 7:38:37 AM Rafael Espíndola <
> rafael.espindola at gmail.com> wrote:
>
>> >> This instruction doesn’t appear to be well formed. However, one could
>> >> argue that it is – formally %2 def does dominate all %2 uses because
>> both
>> >> are located in an unreachable block, so every path to the use is
>> passing
>> >> through the def (because there are 0 paths like that).
>> >>
>> >> That is likely the reason why –verify doesn’t complain about it.
>> >
>> >
>> > Why is jump-threading creating this funky instruction?
>>
>> It is well formed. I agree with Hal: it might be a quality improvement
>> to generate tidier IR from jump-threading, but GVN has to handle
>> whatever input passes the verifier.
>>
>
> Then, IMHO, we should start the long process of making forward-unreachable
> code not acceptable except inside a single pass (IE at the end of each
> pass, there should be no unreachable code).
>
> There are a very very small number of passes that generate such code, and
> it's not that difficult to fix them to make them not do that.
>

I will write up a longer reply soon, but I strongly disagree. I think this
would be a really bad direction for LLVM to move in.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150223/06ebe1f7/attachment.html>


More information about the llvm-commits mailing list