1 ; This test makes sure that add instructions are properly eliminated.
2 ; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
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
9 define i1 @test1(i1 %x) {
11 ;; Add of sign bit -> xor of sign bit.
12 %tmp.4 = add i1 %tmp.2, 1
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
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
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