]> granicus.if.org Git - llvm/commit
[InstCombine] Add missing commute handling to (A | B) & (B ^ (~A)) -> (A & B)
authorCraig Topper <craig.topper@gmail.com>
Tue, 25 Apr 2017 15:19:04 +0000 (15:19 +0000)
committerCraig Topper <craig.topper@gmail.com>
Tue, 25 Apr 2017 15:19:04 +0000 (15:19 +0000)
commit1276764736eee61bd56daa5f6330f4c7b51de9c0
tree4be56ffe9f020c4a4c8c3cb7a852f1efcb2ca2da
parent05711fea069bca34ccc0a96193bddac25b81a9bb
[InstCombine] Add missing commute handling to (A | B) & (B ^ (~A)) -> (A & B)

The matching here wasn't able to handle all the possible commutes. It always assumed the not would be on the left of the xor, but that's not guaranteed.

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

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