OSDN Git Service

InstCombine: allow unmasked icmps to be combined with logical ops
authorTim Northover <tnorthover@apple.com>
Wed, 4 Sep 2013 11:57:17 +0000 (11:57 +0000)
committerTim Northover <tnorthover@apple.com>
Wed, 4 Sep 2013 11:57:17 +0000 (11:57 +0000)
commit0415b1810bbf93f434f1c561e172bf24c1cb37dc
treec2d7a5cda9e53e3e9e710e4b24749681a6ed8ac6
parent7bfabdac4ebf82f9f6a9ee7a00fd948f729dc7fe
InstCombine: allow unmasked icmps to be combined with logical ops

"(icmp op i8 A, B)" is equivalent to "(icmp op i8 (A & 0xff), B)" as a
degenerate case. Allowing this as a "masked" comparison when analysing "(icmp)
&/| (icmp)" allows us to combine them in more cases.

rdar://problem/7625728

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