[llvm-dev] killing undef and spreading poison

Peter Lawrence via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 23 06:28:56 PDT 2017


Sanjoy,
            we still need an example, some C source code, that shows
clearly why the definition of immediate-UB for branch-on-undef / poison
is the right choice. Talking, even on topic, isn’t an example.

Peter Lawrence.


> On Jun 19, 2017, at 9:43 AM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote:
> 
>> 
>> However you have changed the subject, and we still need an example
> 
> I'm not convinced that I changed the subject.  You said
> 
>>          we still need some examples showing that the definition
>> “Branching on poison is immediate-UB” is the best choice,
>> so far we only have arguments against it (the one for loop-switching).
> 
> There are two ways we can avoid branching on “Branching on poison is
> immediate-UB” and still have GVN propagate equalities:
> 
> - Propagate equalities only if the thing we're propagating isn't
> poison.  As I've stated in this thread, that's almost impossible to
> prove in interesting cases.
> - Ditch poison and have an `undef` like instruction (which is
> equivalent to a live-in undef register), which brings us the regalloc
> and mid-level opt problem.
> 
> So both of the thing I said seem on-topic to me.
> 
> -- Sanjoy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170623/a158e2c7/attachment.html>


More information about the llvm-dev mailing list