blob: d2265ed4b6709e3f097155984cf70239b2411601 [file] [log] [blame]
Reid Spencerea8b07e2007-03-23 20:48:34 +00001; This test case checks that the merge of and/xor can work on arbitrary
2; precision integers.
3
4; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | wc -l | grep 1 &&
5; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | wc -l | grep 2
6
7; (x &z ) ^ (y & z) -> (x ^ y) & z
8define i57 @test1(i57 %x, i57 %y, i57 %z) {
9 %tmp3 = and i57 %z, %x
10 %tmp6 = and i57 %z, %y
11 %tmp7 = xor i57 %tmp3, %tmp6
12 ret i57 %tmp7
13}
14
15; (x & y) ^ (x | y) -> x ^ y
16define i23 @test2(i23 %x, i23 %y, i23 %z) {
17 %tmp3 = and i23 %y, %x
18 %tmp6 = or i23 %y, %x
19 %tmp7 = xor i23 %tmp3, %tmp6
20 ret i23 %tmp7
21}
22