[LLVMdev] The nsw story

David A. Greene greened at obbligato.org
Mon Dec 12 09:25:59 PST 2011


Dan Gohman <gohman at apple.com> writes:

>> Or you put it immediately after the select.
>> 
>> That was my thinking. The select is an observation point for its first operand,
>> but then merely propagates poison from the second or third, just like any
>> computational instruction would.
>> The icmp is an observation point for both inputs.
>
> Put the observation point on the add, the select, the icmp, or even the
> and, or between any of them, and it'll still be before the branch. That
> means that the code will have unconditional undefined behavior when the
> add overflows, which the original code did not have.

So put it after the branch.  Absolutely nothing prevents that.  That's
what IA64 compilers have to do today.

                                -Dave



More information about the llvm-dev mailing list