OSDN Git Service

[InstCombine] Remove canonicalization for (X & C1) | C2 --> (X | C2) & (C1|C2) when...
authorCraig Topper <craig.topper@gmail.com>
Mon, 3 Apr 2017 20:41:47 +0000 (20:41 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 3 Apr 2017 20:41:47 +0000 (20:41 +0000)
commitd1815f3bc324641e3d25bbf4c332ae0463554469
treed078134eef1ed88579934cb0e8c21a5206286154
parent019f65e751bfd5741dc0e0315dc16ae068cb546d
[InstCombine] Remove canonicalization for (X & C1) | C2 --> (X | C2) & (C1|C2) when C1 & C2 have common bits.

It turns out that SimplifyDemandedInstructionBits will get called earlier and remove bits from C1 first. Effectively doing (X & (C1&C2)) | C2. So by the time it got to this check there could be no common bits.

I think the DAGCombiner has the same check but its check can be executed because it handles demanded bits later. I'll look at it next.

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