summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-07-12 13:44:00 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-07-12 13:44:00 +0000
commit98a8206e58d32adebaba501d40266eefb42cb06a (patch)
tree828953d034814bcd2b41302bec5f41cd557d5c42 /test/Transforms/InstCombine
parentad854f0764e6a386b0dc49a2640766b8e9ae0b61 (diff)
downloadllvm-98a8206e58d32adebaba501d40266eefb42cb06a.tar.gz
llvm-98a8206e58d32adebaba501d40266eefb42cb06a.tar.bz2
llvm-98a8206e58d32adebaba501d40266eefb42cb06a.tar.xz
Reapply 108136 with an ugly pasto fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108141 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r--test/Transforms/InstCombine/or.ll13
-rw-r--r--test/Transforms/InstCombine/xor2.ll14
2 files changed, 27 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/or.ll b/test/Transforms/InstCombine/or.ll
index c3526b77f6..0246925bd8 100644
--- a/test/Transforms/InstCombine/or.ll
+++ b/test/Transforms/InstCombine/or.ll
@@ -350,3 +350,16 @@ define <4 x i32> @test32(<4 x i1> %and.i1352, <4 x i32> %vecinit6.i176, <4 x i32
; CHECK: or <4 x i32> %and.i, %and.i129
}
+; PR6773
+define i32 @test33(i32 %x, i32 %y, i32 %z) nounwind readnone {
+ %and = and i32 %y, %x
+ %not = xor i32 %x, -1
+ %and2 = and i32 %z, %not
+ %or = or i32 %and2, %and
+ ret i32 %or
+; CHECK: @test33
+; CHECK-NEXT: xor i32
+; CHECK-NEXT: and i32
+; CHECK-NEXT: xor i32
+; CHECK-NEXT: ret i32
+}
diff --git a/test/Transforms/InstCombine/xor2.ll b/test/Transforms/InstCombine/xor2.ll
index 67f05efa23..19804c1948 100644
--- a/test/Transforms/InstCombine/xor2.ll
+++ b/test/Transforms/InstCombine/xor2.ll
@@ -51,3 +51,17 @@ define i32 @test4(i32 %A, i32 %B) {
; CHECK: %1 = ashr i32 %A, %B
; CHECK: ret i32 %1
}
+
+; PR6773
+define i32 @test5(i32 %x, i32 %y, i32 %z) nounwind readnone {
+ %and = and i32 %y, %x
+ %not = xor i32 %x, -1
+ %and2 = and i32 %z, %not
+ %xor = xor i32 %and2, %and
+ ret i32 %xor
+; CHECK: @test5
+; CHECK-NEXT: xor i32
+; CHECK-NEXT: and i32
+; CHECK-NEXT: xor i32
+; CHECK-NEXT: ret i32
+}