[InstCombine] Improve the expansion in SimplifyUsingDistributiveLaws to handle cases...
authorCraig Topper <craig.topper@intel.com>
Sat, 15 Jul 2017 21:49:49 +0000 (21:49 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 15 Jul 2017 21:49:49 +0000 (21:49 +0000)
commitd918d5b36b71450898f4f8be94f4c6098633567b
tree43431c0b93197386b08c10a86766a675f791d04b
parentf9ea0959d97af6a24dd37d6053d7afce2bf1bfb6
[InstCombine] Improve the expansion in SimplifyUsingDistributiveLaws to handle cases where one side doesn't simplify, but the other side resolves to an identity value

Summary:
If one side simplifies to the identity value for inner opcode, we can replace the value with just the operation that can't be simplified.

I've removed a couple now unneeded special cases in visitAnd and visitOr. There are probably other cases I missed.

Reviewers: spatel, majnemer, hfinkel, dberlin

Reviewed By: spatel

Subscribers: grandinj, llvm-commits, spatel

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

llvm-svn: 308111
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/and.ll
llvm/test/Transforms/InstCombine/or.ll