OSDN Git Service

[InstCombine] Support (X | C1) & C2 --> (X & C2^(C1&C2)) | (C1&C2) for vector splats
authorCraig Topper <craig.topper@intel.com>
Mon, 7 Aug 2017 18:10:39 +0000 (18:10 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 7 Aug 2017 18:10:39 +0000 (18:10 +0000)
commit4dc104b36bf1d8bea65e8d06980a44bb42ab02d3
treedb9b89e4bb506fc5008f0c5bcdc403e7b06fdf2f
parenta4262847c8fb1bfadfbec43e05a739c83431187f
[InstCombine] Support (X | C1) & C2 --> (X & C2^(C1&C2)) | (C1&C2) for vector splats

Note the original code I deleted incorrectly listed this as (X | C1) & C2 --> (X & C2^(C1&C2)) | C1 Which is only valid if C1 is a subset of C2. This relied on SimplifyDemandedBits to remove any extra bits from C1 before we got to that code.

My new implementation avoids relying on that behavior so that it can be naively verified with alive.

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

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