https://llvm.org/bugs/show_bug.cgi?id=25986

David Majnemer <david.majne...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |david.majne...@gmail.com
          Component|new bugs                    |Scalar Optimizations
         Resolution|---                         |INVALID
            Product|new-bugs                    |libraries

--- Comment #1 from David Majnemer <david.majne...@gmail.com> ---
Hi Yuanrui,

I do not believe InstCombine is wrong here.

The value you chose for '%j' is 'i32 2147483647'.
The add instruction in '%inc' is 'add nsw i32 %j, 1'.  Notice the 'nsw' flag on
the add instruction, it means that '%inc' is poison if it sign overflows or
sign underflows (see http://llvm.org/docs/LangRef.html#poisonvalues)

This means that we have the following dynamic values:
%j = i32 2147483647
%inc = i32 poison
%cmp = i1 poison
%conv = i32 poison

If you want signed overflow/underflow to be well defined, remove the nsw flag
from the add instruction.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to