[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)
commitba011431938ec4e1716c13a1aada4510f547c89f
tree76cfb13de483dd990a650d6746d17b483efb91ea
parentf41b21e3848c5c215975593ff02843b50b7cca4d
[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

llvm-svn: 301316
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/test/Transforms/InstCombine/and.ll