]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/blob - test/Transforms/InstCombine/apint-and-xor-merge.ll
[canonicalize] Teach InstCombine to canonicalize loads which are only
[opencl/llvm.git] / test / Transforms / InstCombine / apint-and-xor-merge.ll
1 ; This test case checks that the merge of and/xor can work on arbitrary
2 ; precision integers.
4 ; RUN: opt < %s -instcombine -S | grep and | count 1
5 ; RUN: opt < %s -instcombine -S | grep xor | count 2
7 ; (x &z ) ^ (y & z) -> (x ^ y) & z
8 define 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 }
15 ; (x & y) ^ (x | y) -> x ^ y
16 define 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 }