]> granicus.if.org Git - llvm/commit
[InstSimplify] use ConstantRange to simplify more and-of-icmps
authorSanjay Patel <spatel@rotateright.com>
Mon, 24 Apr 2017 21:52:39 +0000 (21:52 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 24 Apr 2017 21:52:39 +0000 (21:52 +0000)
commit87f63fed9365450f3e11256241a3f3538fe0d4f6
treea9282cb9c89923ef1b46632cd0d32de184719931
parent60823da1a94eb1ce298fa6e4cbe83b26579d9c76
[InstSimplify] use ConstantRange to simplify more and-of-icmps

We can simplify (and (icmp X, C1), (icmp X, C2)) to 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 code in instcombine was completely ignoring predicates with
mismatched signedness.

Handling or-of-icmps would be a follow-up step.

Differential Revision: https://reviews.llvm.org/D32143

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301260 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
test/Transforms/InstCombine/and-or-icmps.ll
test/Transforms/InstCombine/minmax-fold.ll
test/Transforms/InstSimplify/icmp-ranges.ll