[llvm-commits] Patch: instcombine on overflow intrinsics

Alastair Lynn arplynn at gmail.com
Mon Nov 9 02:09:41 PST 2009


Hello-

This patch adds the follow to instcombine:
   overflow intrinsic (undef, X) or overflow intrinsic (X, undef) ->  
undef
   add overflow (X, 0) or add overflow (0, X) -> {X, false}
   unsigned add overflow (X, Y) -> {X + Y, true} where the HO bit is  
provably 1 in both X and Y
   unsigned add overflow (X, Y) -> {X + Y, false} where the HO bit is  
provably 0 in both X and Y
   sub overflow (X, 0) -> {X, false}
   mul overflow (X, 0) -> {0, false}
   mul overflow (X, 1) -> {X, false}

Testcase in patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: overflow-instcombine.patch
Type: application/octet-stream
Size: 9868 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20091109/c86211dc/attachment.obj>
-------------- next part --------------




More information about the llvm-commits mailing list