summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/or-xor.ll
diff options
context:
space:
mode:
authorMayur Pandey <mayur.p@samsung.com>2014-08-19 08:19:19 +0000
committerMayur Pandey <mayur.p@samsung.com>2014-08-19 08:19:19 +0000
commit960507beb4666d2289cd78f160ff9074cd1225ad (patch)
tree65178898efc0bc823bf160e68bb2f72932e7a36e /llvm/test/Transforms/InstCombine/or-xor.ll
parent97ebe53032e82c7575a1e9c18277c96a2005ac7c (diff)
downloadbcm5719-llvm-960507beb4666d2289cd78f160ff9074cd1225ad.tar.gz
bcm5719-llvm-960507beb4666d2289cd78f160ff9074cd1225ad.zip
InstCombine: ((A & ~B) ^ (~A & B)) to A ^ B
Proof using CVC3 follows: $ cat t.cvc A, B : BITVECTOR(32); QUERY BVXOR((A & ~B),(~A & B)) = BVXOR(A,B); $ cvc3 t.cvc Valid. Differential Revision: http://reviews.llvm.org/D4898 llvm-svn: 215974
Diffstat (limited to 'llvm/test/Transforms/InstCombine/or-xor.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/or-xor.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/or-xor.ll b/llvm/test/Transforms/InstCombine/or-xor.ll
index 984178aeb34..e2a3baf2f35 100644
--- a/llvm/test/Transforms/InstCombine/or-xor.ll
+++ b/llvm/test/Transforms/InstCombine/or-xor.ll
@@ -160,3 +160,16 @@ define i32 @test16(i32 %x, i32 %y) {
; CHECK-NEXT: %xor = xor i32 %x, %y
; CHECK-NEXT: ret i32 %xor
}
+
+; ((x & ~y) ^ (~x & y)) -> x ^ y
+define i32 @test17(i32 %x, i32 %y) {
+ %noty = xor i32 %y, -1
+ %notx = xor i32 %x, -1
+ %and1 = and i32 %x, %noty
+ %and2 = and i32 %notx, %y
+ %xor = xor i32 %and1, %and2
+ ret i32 %xor
+; CHECK-LABEL: @test17(
+; CHECK-NEXT: %xor = xor i32 %x, %y
+; CHECK-NEXT: ret i32 %xor
+}
OpenPOWER on IntegriCloud