]> granicus.if.org Git - llvm/commit
[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)
commit1cadf61272d8fc8280edf6ae5f8ecbfe546c8a7f
tree5bde2beadc750244e01a66e2d2caeb6cb6934229
parent4902f1b31a30e1a3dd212170e0239f9f563f521b
[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

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