OSDN Git Service

[InstCombine] Add test cases for folding (select (icmp ne/eq (and X, C1), (bitwiseop...
authorCraig Topper <craig.topper@intel.com>
Tue, 5 Sep 2017 05:26:38 +0000 (05:26 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 5 Sep 2017 05:26:38 +0000 (05:26 +0000)
commit203c00ded6a62caffdd6a4d2fbde305e6ffdfddf
tree82b059b176852e15cea6c4bb9d8a349f16b974d8
parent783862083c7caea767964cb5da7841a040a86b8c
[InstCombine] Add test cases for folding (select (icmp ne/eq (and X, C1), (bitwiseop Y, C2), Y -> (bitwiseop Y, (shl/shr (and X, C1), C3)) or similar.

This is possible if C1 and C2 are both powers of 2. Or if binop is 'and' then ~C2 needs to be a power of 2.

We already support this for 'or', but we should be able to support 'and' and 'xor'. This will be enhanced by D37274.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312519 91177308-0d34-0410-b5e6-96231b3b80d8
test/Transforms/InstCombine/select-with-bitwise-ops.ll