InstCombine: Fold away tautological masked compares
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 18 Nov 2014 09:31:41 +0000 (09:31 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 18 Nov 2014 09:31:41 +0000 (09:31 +0000)
commit0ede3a2ae544fdaa7a2ca6964255b744c5fda4f4
tree220f1d414ac68953e8ea8d6443107db57b95910e
parent2c906a460774a836308bfc92a8d703c0d73ebfd0
InstCombine: Fold away tautological masked compares

It is impossible for (x & INT_MAX) == 0 && x == INT_MAX to ever be true.

While this sort of reasoning should normally live in InstSimplify,
the machinery that derives this result is not trivial to split out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222230 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
test/Transforms/InstCombine/icmp-logical.ll