blob: b183b216e9df647ddccc2237a069987681ff2625 [file] [log] [blame]
Bill Wendling9eef4212008-11-30 13:08:13 +00001; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {and i32 %y, %x} | count 2
2; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {and i32 %x, %y} | count 2
3; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {xor}
4; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {or}
5
6define i32 @func1(i32 %x, i32 %y) nounwind {
7entry:
8 %n = xor i32 %y, -1
9 %o = or i32 %n, %x
10 %a = and i32 %o, %y
11 ret i32 %a
12}
13
14define i32 @func2(i32 %x, i32 %y) nounwind {
15entry:
16 %n = xor i32 %y, -1
17 %o = or i32 %x, %n
18 %a = and i32 %o, %y
19 ret i32 %a
20}
21
22define i32 @func3(i32 %x, i32 %y) nounwind {
23entry:
24 %n = xor i32 %y, -1
25 %o = or i32 %n, %x
26 %a = and i32 %y, %o
27 ret i32 %a
28}
29
30define i32 @func4(i32 %x, i32 %y) nounwind {
31entry:
32 %n = xor i32 %y, -1
33 %o = or i32 %x, %n
34 %a = and i32 %y, %o
35 ret i32 %a
36}