Remove use of implementation keyword.
[oota-llvm.git] / test / Transforms / InstCombine / apint-add1.ll
1 ; This test makes sure that add instructions are properly eliminated.
2 ; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
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 i1 @test1(i1 %x) {
10         %tmp.2 = xor i1 %x, 1
11         ;; Add of sign bit -> xor of sign bit.
12         %tmp.4 = add i1 %tmp.2, 1
13         ret i1 %tmp.4
14 }
15
16 define i47 @test2(i47 %x) {
17         %tmp.2 = xor i47 %x, 70368744177664
18         ;; Add of sign bit -> xor of sign bit.
19         %tmp.4 = add i47 %tmp.2, 70368744177664
20         ret i47 %tmp.4
21 }
22
23 define i15 @test3(i15 %x) {
24         %tmp.2 = xor i15 %x, 16384
25         ;; Add of sign bit -> xor of sign bit.
26         %tmp.4 = add i15 %tmp.2, 16384
27         ret i15 %tmp.4
28 }
29
30 define i49 @test6(i49 %x) {
31         ;; (x & 254)+1 -> (x & 254)|1
32         %tmp.2 = and i49 %x, 562949953421310
33         %tmp.4 = add i49 %tmp.2, 1
34         ret i49 %tmp.4
35 }