InstCombine: look for masked compares with subset relation
authorTim Northover <tnorthover@apple.com>
Wed, 4 Sep 2013 11:57:13 +0000 (11:57 +0000)
committerTim Northover <tnorthover@apple.com>
Wed, 4 Sep 2013 11:57:13 +0000 (11:57 +0000)
commit7bfabdac4ebf82f9f6a9ee7a00fd948f729dc7fe
tree1b055e115a9e2cdf1d252c94d510aaa6ba2b005f
parent19fdc268c316b3b0bdcb2b558449819f4f402d6a
InstCombine: look for masked compares with subset relation

Even in cases which aren't universally optimisable like "(A & B) != 0 && (A &
C) != 0", the masks can make one of the comparisons completely redundant. In
this case, since we've gone to the effort of spotting masked comparisons we
should combine them.

rdar://problem/7625728

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189930 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
test/Transforms/InstCombine/icmp-logical.ll [new file with mode: 0644]