OSDN Git Service

[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)
commit47d34935368d02921c015ef00f0dfb29e40fcd98
tree291af185d8e2afbcea0cf711c1086c50e3dcfb25
parent281eb93196b8d9a6c90a8f92e8088c400978d398
[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'.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354221 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineSelect.cpp
test/Transforms/InstCombine/saturating-add-sub.ll