[SimplifyLibCalls] Remove useless bits of this tests.
[oota-llvm.git] / test / Transforms / InstCombine / and-xor-merge.ll
1 ; RUN: opt < %s -instcombine -S | FileCheck %s
2
3 ; (x&z) ^ (y&z) -> (x^y)&z
4 define i32 @test1(i32 %x, i32 %y, i32 %z) {
5 ; CHECK-LABEL: @test1(
6 ; CHECK-NEXT: %tmp61 = xor i32 %x, %y
7 ; CHECK-NEXT: %tmp7 = and i32 %tmp61, %z
8 ; CHECK-NEXT: ret i32 %tmp7
9         %tmp3 = and i32 %z, %x
10         %tmp6 = and i32 %z, %y
11         %tmp7 = xor i32 %tmp3, %tmp6
12         ret i32 %tmp7
13 }
14
15 ; (x & y) ^ (x|y) -> x^y
16 define i32 @test2(i32 %x, i32 %y, i32 %z) {
17 ; CHECK-LABEL: @test2(
18 ; CHECK-NEXT: %tmp7 = xor i32 %y, %x
19 ; CHECK-NEXT: ret i32 %tmp7
20         %tmp3 = and i32 %y, %x
21         %tmp6 = or i32 %y, %x
22         %tmp7 = xor i32 %tmp3, %tmp6
23         ret i32 %tmp7
24 }