[LLVMdev] On semantics of add instruction - nsw,nuw flags

Rekha R rekharamapai at nitc.ac.in
Wed Jul 23 07:18:46 PDT 2014


Hi Tim,
If:

>  It means that the person who wrote the IR has guaranteed that there's
>> no overflow (by some means) so LLVM can assume it during optimisation.
>>
> then

>  In both cases the add with nsw can be removed in favour of the one
>> without. Order is completely irrelevant for normal LLVM arithmetic
>> instructions.
>>
>
> why can't we retain *add nsw* and remove *add *(in the example Cases)?
Because there is a guarantee overflow wouldn't occur.

Thanks,
-- 
Rekha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140723/dcce858e/attachment.html>


More information about the llvm-dev mailing list