[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)
commit599e65b1ff51d4f92ebf68696adb0955788db051
treea7fb8f32590fa1f86a592c4e2b946525b671b17e
parent5305d3933a55f7153971821b9c7194a080b6b699
[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

llvm-svn: 302370
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll [deleted file]
llvm/test/Transforms/InstCombine/and-or-icmps.ll
llvm/test/Transforms/InstCombine/or.ll
llvm/test/Transforms/InstSimplify/icmp-ranges.ll