[InstCombine] reduce unsigned saturated add with 'not' op
authorSanjay Patel <spatel@rotateright.com>
Sun, 17 Feb 2019 15:58:48 +0000 (15:58 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 17 Feb 2019 15:58:48 +0000 (15:58 +0000)
commitbee207354271cec26da6c4866b0e80670fdc5082
tree3e7088fb48d66100d640a40e6d7946f72ec826ce
parentd72c1a0c5c66bc68b272518789bbebec307c9771
[InstCombine] reduce unsigned saturated add with 'not' op

We want to use the sum in the icmp to allow matching with
m_UAddWithOverflow and eliminate the 'not'. This is discussed
in D51929 and is another step towards solving PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613

(The matching here is incomplete. Trying to take minimal steps
to make sure we don't induce infinite looping from existing
canonicalizations of the 'select'.)

llvm-svn: 354221
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/saturating-add-sub.ll