1 ; This test makes sure that and instructions are properly eliminated.
2 ; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
4 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {and }
6 define i39 @test0(i39 %A) {
7 %B = and i39 %A, 0 ; zero result
11 define i47 @test1(i47 %A, i47 %B) {
12 ;; (~A & ~B) == (~(A | B)) - De Morgan's Law
13 %NotA = xor i47 %A, -1
14 %NotB = xor i47 %B, -1
15 %C1 = and i47 %NotA, %NotB
19 define i15 @test2(i15 %x) {
20 %tmp.2 = and i15 %x, -1 ; noop
24 define i23 @test3(i23 %x) {
25 %tmp.0 = and i23 %x, 127
26 %tmp.2 = and i23 %tmp.0, 128
30 define i1 @test4(i37 %x) {
31 %A = and i37 %x, -2147483648
32 %B = icmp ne i37 %A, 0
36 define i7 @test5(i7 %A, i7* %P) {
44 define i7 @test6(i7 %A, i7 %B) {
45 ;; ~(~X & Y) --> (X | ~Y)
52 define i47 @test7(i47 %A) {
53 %X = ashr i47 %A, 39 ;; sign extend