Remove use of implementation keyword.
[oota-llvm.git] / test / Transforms / InstCombine / apint-add2.ll
1 ; This test makes sure that add instructions are properly eliminated.
2 ; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
3
4 ; RUN: llvm-as < %s | opt -instcombine -disable-output &&
5 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
6 ; RUN:    grep -v OK | not grep add
7
8
9 define i111 @test1(i111 %x) {
10         %tmp.2 = shl i111 1, 110
11         %tmp.4 = xor i111 %x, %tmp.2
12         ;; Add of sign bit -> xor of sign bit.
13         %tmp.6 = add i111 %tmp.4, %tmp.2
14         ret i111 %tmp.6
15 }
16
17 define i65 @test2(i65 %x) {
18         %tmp.0 = shl i65 1, 64
19         %tmp.2 = xor i65 %x, %tmp.0
20         ;; Add of sign bit -> xor of sign bit.
21         %tmp.4 = add i65 %tmp.2, %tmp.0
22         ret i65 %tmp.4
23 }
24
25 define i1024 @test3(i1024 %x) {
26         %tmp.0 = shl i1024 1, 1023
27         %tmp.2 = xor i1024 %x, %tmp.0
28         ;; Add of sign bit -> xor of sign bit.
29         %tmp.4 = add i1024 %tmp.2, %tmp.0
30         ret i1024 %tmp.4
31 }
32
33 define i128 @test4(i128 %x) {
34         ;; If we have ADD(XOR(AND(X, 0xFF), 0xF..F80), 0x80), it's a sext.
35         %tmp.5 = shl i128 1, 127
36         %tmp.1 = ashr i128 %tmp.5, 120
37         %tmp.2 = xor i128 %x, %tmp.1      
38         %tmp.4 = add i128 %tmp.2, %tmp.5
39         ret i128 %tmp.4
40 }
41
42 define i77 @test6(i77 %x) {
43         ;; (x & 254)+1 -> (x & 254)|1
44         %tmp.2 = and i77 %x, 562949953421310
45         %tmp.4 = add i77 %tmp.2, 1
46         ret i77 %tmp.4
47 }