]> granicus.if.org Git - llvm/commit
[InstSimplify] use ConstantRange to simplify or-of-icmps
authorSanjay Patel <spatel@rotateright.com>
Sun, 7 May 2017 15:11:40 +0000 (15:11 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 7 May 2017 15:11:40 +0000 (15:11 +0000)
commit2a7ef8d5f2ebcd05ccf85fd27950f8c382e89a65
tree5fbc1652daaf7f1b95fbec35c5d3c0745e5bc4cb
parent2c224bcd52a7f0e561e2729d1085fd390e20e189
[InstSimplify] use ConstantRange to simplify or-of-icmps

We can simplify (or (icmp X, C1), (icmp X, C2)) to 'true' or one of the icmps in many cases.
I had to check some of these with Alive to prove to myself it's right, but everything seems
to check out. Eg, the deleted code in instcombine was completely ignoring predicates with
mismatched signedness.

This is a follow-up to:
https://reviews.llvm.org/rL301260
https://reviews.llvm.org/D32143

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302370 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll [deleted file]
test/Transforms/InstCombine/and-or-icmps.ll
test/Transforms/InstCombine/or.ll
test/Transforms/InstSimplify/icmp-ranges.ll