OSDN Git Service

[InstSimplify] move (A & ~B) | (A ^ B) -> (A ^ B) from InstCombine
authorSanjay Patel <spatel@rotateright.com>
Mon, 24 Apr 2017 18:24:36 +0000 (18:24 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 24 Apr 2017 18:24:36 +0000 (18:24 +0000)
commit943323e38a1982d4085b39138ff83c7b8dcc0e91
tree097cd70a26e1fa0f7dcd10ba2092a2a5ff19369d
parent1a8fba0ab277894ef9ec516821ff7d5b9220535a
[InstSimplify] move (A & ~B) | (A ^ B) -> (A ^ B) from InstCombine

This is a straight cut and paste, but there's a bigger problem: if this
fold exists for simplifyOr, there should be a DeMorganized version for
simplifyAnd. But more than that, we have a patchwork of ad hoc logic
optimizations in InstCombine. There should be some structure to ensure
that we're not missing sibling folds across and/or/xor.

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