[WebAssembly] Don't perform the returned-argument optimization on constants.
[oota-llvm.git] / test / CodeGen / ARM / uxtb.ll
1 ; RUN: llc < %s -mtriple=armv6-apple-darwin | \
2 ; RUN:   grep uxt | count 10
3
4 define i32 @test1(i32 %x) {
5         %tmp1 = and i32 %x, 16711935            ; <i32> [#uses=1]
6         ret i32 %tmp1
7 }
8
9 define i32 @test2(i32 %x) {
10         %tmp1 = lshr i32 %x, 8          ; <i32> [#uses=1]
11         %tmp2 = and i32 %tmp1, 16711935         ; <i32> [#uses=1]
12         ret i32 %tmp2
13 }
14
15 define i32 @test3(i32 %x) {
16         %tmp1 = lshr i32 %x, 8          ; <i32> [#uses=1]
17         %tmp2 = and i32 %tmp1, 16711935         ; <i32> [#uses=1]
18         ret i32 %tmp2
19 }
20
21 define i32 @test4(i32 %x) {
22         %tmp1 = lshr i32 %x, 8          ; <i32> [#uses=1]
23         %tmp6 = and i32 %tmp1, 16711935         ; <i32> [#uses=1]
24         ret i32 %tmp6
25 }
26
27 define i32 @test5(i32 %x) {
28         %tmp1 = lshr i32 %x, 8          ; <i32> [#uses=1]
29         %tmp2 = and i32 %tmp1, 16711935         ; <i32> [#uses=1]
30         ret i32 %tmp2
31 }
32
33 define i32 @test6(i32 %x) {
34         %tmp1 = lshr i32 %x, 16         ; <i32> [#uses=1]
35         %tmp2 = and i32 %tmp1, 255              ; <i32> [#uses=1]
36         %tmp4 = shl i32 %x, 16          ; <i32> [#uses=1]
37         %tmp5 = and i32 %tmp4, 16711680         ; <i32> [#uses=1]
38         %tmp6 = or i32 %tmp2, %tmp5             ; <i32> [#uses=1]
39         ret i32 %tmp6
40 }
41
42 define i32 @test7(i32 %x) {
43         %tmp1 = lshr i32 %x, 16         ; <i32> [#uses=1]
44         %tmp2 = and i32 %tmp1, 255              ; <i32> [#uses=1]
45         %tmp4 = shl i32 %x, 16          ; <i32> [#uses=1]
46         %tmp5 = and i32 %tmp4, 16711680         ; <i32> [#uses=1]
47         %tmp6 = or i32 %tmp2, %tmp5             ; <i32> [#uses=1]
48         ret i32 %tmp6
49 }
50
51 define i32 @test8(i32 %x) {
52         %tmp1 = shl i32 %x, 8           ; <i32> [#uses=1]
53         %tmp2 = and i32 %tmp1, 16711680         ; <i32> [#uses=1]
54         %tmp5 = lshr i32 %x, 24         ; <i32> [#uses=1]
55         %tmp6 = or i32 %tmp2, %tmp5             ; <i32> [#uses=1]
56         ret i32 %tmp6
57 }
58
59 define i32 @test9(i32 %x) {
60         %tmp1 = lshr i32 %x, 24         ; <i32> [#uses=1]
61         %tmp4 = shl i32 %x, 8           ; <i32> [#uses=1]
62         %tmp5 = and i32 %tmp4, 16711680         ; <i32> [#uses=1]
63         %tmp6 = or i32 %tmp5, %tmp1             ; <i32> [#uses=1]
64         ret i32 %tmp6
65 }
66
67 define i32 @test10(i32 %p0) {
68         %tmp1 = lshr i32 %p0, 7         ; <i32> [#uses=1]
69         %tmp2 = and i32 %tmp1, 16253176         ; <i32> [#uses=2]
70         %tmp4 = lshr i32 %tmp2, 5               ; <i32> [#uses=1]
71         %tmp5 = and i32 %tmp4, 458759           ; <i32> [#uses=1]
72         %tmp7 = or i32 %tmp5, %tmp2             ; <i32> [#uses=1]
73         ret i32 %tmp7
74 }