diff options
author | Craig Topper <craig.topper@intel.com> | 2017-06-19 16:23:46 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-06-19 16:23:46 +0000 |
commit | ef85498e05e62325760b3e6e439984893d9d7c3e (patch) | |
tree | 08c648a5bb2a4f7e2775a9ceb60cf4c216ccd9d0 /llvm/test/Transforms/Reassociate/fast-ReassociateVector.ll | |
parent | 4350734d36dad4e1eed915f3c12984cca2dbcd5a (diff) | |
download | bcm5719-llvm-ef85498e05e62325760b3e6e439984893d9d7c3e.tar.gz bcm5719-llvm-ef85498e05e62325760b3e6e439984893d9d7c3e.zip |
[Reassociate] Support some reassociation of vector xors
Summary:
Currently we don't try to do anything with vector xors.
This patch adds support for removing duplicate pairs from a chain of vector xors as its pretty easy to support. We still dont' try to combine the xors with and/ors, but I might try that in a future patch.
Reviewers: mcrosier, davide, resistor
Reviewed By: mcrosier
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34338
llvm-svn: 305704
Diffstat (limited to 'llvm/test/Transforms/Reassociate/fast-ReassociateVector.ll')
-rw-r--r-- | llvm/test/Transforms/Reassociate/fast-ReassociateVector.ll | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/llvm/test/Transforms/Reassociate/fast-ReassociateVector.ll b/llvm/test/Transforms/Reassociate/fast-ReassociateVector.ll index fb76b9d990b..d4c7b809f61 100644 --- a/llvm/test/Transforms/Reassociate/fast-ReassociateVector.ll +++ b/llvm/test/Transforms/Reassociate/fast-ReassociateVector.ll @@ -205,15 +205,25 @@ define <2 x i32> @test16(<2 x i32> %x, <2 x i32> %y) { ret <2 x i32> %tmp3 } -; FIXME: Optimize vector xor. Currently only commute operands. define <2 x i32> @test17(<2 x i32> %x, <2 x i32> %y) { ; CHECK-LABEL: test17 -; CHECK-NEXT: %tmp1 = xor <2 x i32> %x, %y -; CHECK-NEXT: %tmp2 = xor <2 x i32> %x, %y -; CHECK-NEXT: %tmp3 = xor <2 x i32> %tmp1, %tmp2 +; CHECK-NEXT: ret <2 x i32> zeroinitializer %tmp1 = xor <2 x i32> %x, %y %tmp2 = xor <2 x i32> %y, %x %tmp3 = xor <2 x i32> %tmp1, %tmp2 ret <2 x i32> %tmp3 } + +define <2 x i32> @test18(<2 x i32> %x, <2 x i32> %y) { +; CHECK-LABEL: test18 +; CHECK-NEXT: %tmp5 = xor <2 x i32> %y, %x +; CHECK-NEXT: ret <2 x i32> %tmp5 + + %tmp1 = xor <2 x i32> %x, %y + %tmp2 = xor <2 x i32> %y, %x + %tmp3 = xor <2 x i32> %x, %y + %tmp4 = xor <2 x i32> %tmp1, %tmp2 + %tmp5 = xor <2 x i32> %tmp4, %tmp3 + ret <2 x i32> %tmp5 +} |