|
1 |
| -; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - | FileCheck -check-prefix=NO-OPTION %s |
2 |
| -; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -mattr=-no-movt | FileCheck -check-prefix=USE-MOVT %s |
3 |
| -; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -mattr=+no-movt | FileCheck -check-prefix=NO-USE-MOVT %s |
4 |
| -; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -O0 | FileCheck -check-prefix=NO-OPTION-O0 %s |
5 |
| -; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -O0 -mattr=-no-movt | FileCheck -check-prefix=USE-MOVT-O0 %s |
6 |
| -; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -O0 -mattr=+no-movt | FileCheck -check-prefix=NO-USE-MOVT-O0 %s |
| 1 | +; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - | \ |
| 2 | +; RUN: FileCheck -check-prefixes=CHECK,NO-OPTION,NO-OPTION-COMMON %s |
| 3 | +; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -mattr=-no-movt | \ |
| 4 | +; RUN: FileCheck -check-prefixes=CHECK,USE-MOVT,USE-MOVT-COMMON %s |
| 5 | +; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -mattr=+no-movt | \ |
| 6 | +; RUN: FileCheck -check-prefixes=CHECK,NO-USE-MOVT,NO-USE-MOVT-COMMON %s |
| 7 | +; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -O0 | \ |
| 8 | +; RUN: FileCheck -check-prefixes=CHECK,NO-OPTION-O0,NO-OPTION-COMMON %s |
| 9 | +; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -O0 -mattr=-no-movt | \ |
| 10 | +; RUN: FileCheck -check-prefixes=CHECK,USE-MOVT-O0,USE-MOVT-COMMON %s |
| 11 | +; RUN: llc -mcpu=cortex-a8 -relocation-model=static %s -o - -O0 -mattr=+no-movt | \ |
| 12 | +; RUN: FileCheck -check-prefixes=CHECK,NO-USE-MOVT-O0,NO-USE-MOVT-COMMON %s |
7 | 13 |
|
8 | 14 | target triple = "thumb-apple-darwin"
|
9 | 15 |
|
10 |
| -; NO-OPTION-LABEL: {{_?}}foo0 |
11 |
| -; NO-OPTION: ldr [[R0:r[0-9]+]], [[L0:.*]] |
12 |
| -; NO-OPTION: [[L0]]: |
13 |
| -; NO-OPTION: .long 2296237089 |
| 16 | +; NO-OPTION-COMMON-LABEL: {{_?}}foo0 |
| 17 | +; NO-OPTION-COMMON: ldr [[R0:r[0-9]+]], [[L0:.*]] |
| 18 | +; NO-OPTION-COMMON: [[L0]]: |
| 19 | +; NO-OPTION-COMMON: .long 2296237089 |
14 | 20 |
|
15 |
| -; NO-OPTION-O0-LABEL: {{_?}}foo0 |
16 |
| -; NO-OPTION-O0: ldr [[R0:r[0-9]+]], [[L0:.*]] |
17 |
| -; NO-OPTION-O0: [[L0]]: |
18 |
| -; NO-OPTION-O0: .long 2296237089 |
| 21 | +; USE-MOVT-COMMON-LABEL: {{_?}}foo0 |
| 22 | +; USE-MOVT-COMMON: movw [[R0:r[0-9]+]], #52257 |
| 23 | +; USE-MOVT-COMMON: movt [[R0]], #35037 |
19 | 24 |
|
20 |
| -; USE-MOVT-LABEL: {{_?}}foo0 |
21 |
| -; USE-MOVT: movw [[R0:r[0-9]+]], #52257 |
22 |
| -; USE-MOVT: movt [[R0]], #35037 |
23 |
| - |
24 |
| -; USE-MOVT-O0-LABEL: {{_?}}foo0 |
25 |
| -; USE-MOVT-O0: movw [[R0:r[0-9]+]], #52257 |
26 |
| -; USE-MOVT-O0: movt [[R0]], #35037 |
27 |
| - |
28 |
| -; NO-USE-MOVT-LABEL: {{_?}}foo0 |
29 |
| -; NO-USE-MOVT: ldr [[R0:r[0-9]+]], [[L0:.*]] |
30 |
| -; NO-USE-MOVT: [[L0]]: |
31 |
| -; NO-USE-MOVT: .long 2296237089 |
32 |
| - |
33 |
| -; NO-USE-MOVT-O0-LABEL: {{_?}}foo0 |
34 |
| -; NO-USE-MOVT-O0: ldr [[R0:r[0-9]+]], [[L0:.*]] |
35 |
| -; NO-USE-MOVT-O0: [[L0]]: |
36 |
| -; NO-USE-MOVT-O0: .long 2296237089 |
| 25 | +; NO-USE-MOVT-COMMON-LABEL: {{_?}}foo0 |
| 26 | +; NO-USE-MOVT-COMMON: ldr [[R0:r[0-9]+]], [[L0:.*]] |
| 27 | +; NO-USE-MOVT-COMMON: [[L0]]: |
| 28 | +; NO-USE-MOVT-COMMON: .long 2296237089 |
37 | 29 |
|
38 | 30 | define i32 @foo0(i32 %a) #0 {
|
39 | 31 | %1 = xor i32 -1998730207, %a
|
40 | 32 | ret i32 %1
|
41 | 33 | }
|
42 | 34 |
|
43 |
| -; NO-OPTION-LABEL: {{_?}}foo1 |
44 |
| -; NO-OPTION: movw [[R0:r[0-9]+]], #52257 |
45 |
| -; NO-OPTION: movt [[R0]], #35037 |
46 |
| - |
47 |
| -; NO-OPTION-O0-LABEL: {{_?}}foo1 |
48 |
| -; NO-OPTION-O0: movw [[R0:r[0-9]+]], #52257 |
49 |
| -; NO-OPTION-O0: movt [[R0]], #35037 |
| 35 | +; NO-OPTION-COMMON-LABEL: {{_?}}foo1 |
| 36 | +; NO-OPTION-COMMON: movw [[R0:r[0-9]+]], #52257 |
| 37 | +; NO-OPTION-COMMON: movt [[R0]], #35037 |
50 | 38 |
|
51 |
| -; USE-MOVT-LABEL: {{_?}}foo1 |
52 |
| -; USE-MOVT: movw [[R0:r[0-9]+]], #52257 |
53 |
| -; USE-MOVT: movt [[R0]], #35037 |
| 39 | +; USE-MOVT-COMMON-LABEL: {{_?}}foo1 |
| 40 | +; USE-MOVT-COMMON: movw [[R0:r[0-9]+]], #52257 |
| 41 | +; USE-MOVT-COMMON: movt [[R0]], #35037 |
54 | 42 |
|
55 |
| -; USE-MOVT-O0-LABEL: {{_?}}foo1 |
56 |
| -; USE-MOVT-O0: movw [[R0:r[0-9]+]], #52257 |
57 |
| -; USE-MOVT-O0: movt [[R0]], #35037 |
58 |
| - |
59 |
| -; NO-USE-MOVT-LABEL: {{_?}}foo1 |
60 |
| -; NO-USE-MOVT: ldr [[R0:r[0-9]+]], [[L0:.*]] |
61 |
| -; NO-USE-MOVT: [[L0]]: |
62 |
| -; NO-USE-MOVT: .long 2296237089 |
63 |
| - |
64 |
| -; NO-USE-MOVT-O0-LABEL: {{_?}}foo1 |
65 |
| -; NO-USE-MOVT-O0: ldr [[R0:r[0-9]+]], [[L0:.*]] |
66 |
| -; NO-USE-MOVT-O0: [[L0]]: |
67 |
| -; NO-USE-MOVT-O0: .long 2296237089 |
| 43 | +; NO-USE-MOVT-COMMON-LABEL: {{_?}}foo1 |
| 44 | +; NO-USE-MOVT-COMMON: ldr [[R0:r[0-9]+]], [[L0:.*]] |
| 45 | +; NO-USE-MOVT-COMMON: [[L0]]: |
| 46 | +; NO-USE-MOVT-COMMON: .long 2296237089 |
68 | 47 |
|
69 | 48 | define i32 @foo1(i32 %a) {
|
70 | 49 | %1 = xor i32 -1998730207, %a
|
71 | 50 | ret i32 %1
|
72 | 51 | }
|
73 | 52 |
|
74 |
| -; NO-OPTION-LABEL: {{_?}}foo2 |
| 53 | +; NO-OPTION-COMMON-LABEL: {{_?}}foo2 |
75 | 54 | ; NO-OPTION: mov.w [[R0:r[0-9]+]], #-536813568
|
76 |
| - |
77 |
| -; USE-MOVT-LABEL: {{_?}}foo2 |
78 |
| -; USE-MOVT: mov.w [[R0:r[0-9]+]], #-536813568 |
79 |
| - |
80 |
| -; NO-USE-MOVT-LABEL: {{_?}}foo2 |
81 |
| -; NO-USE-MOVT: mov.w [[R0:r[0-9]+]], #-536813568 |
82 |
| - |
83 |
| -; NO-OPTION-O0-LABEL: {{_?}}foo2 |
84 | 55 | ; NO-OPTION-O0: movw [[R0:r[0-9]+]], #57344
|
85 | 56 | ; NO-OPTION-O0: movt [[R0]], #57344
|
86 | 57 |
|
87 |
| -; USE-MOVT-O0-LABEL: {{_?}}foo2 |
88 |
| -; USE-MOVT-O0: movw [[R0:r[0-9]+]], #57344 |
89 |
| -; USE-MOVTT-O0: movt [[R0]], #57344 |
| 58 | +; USE-MOVT-COMMON-LABEL: {{_?}}foo2 |
| 59 | +; USE-MOVT: mov.w [[R0:r[0-9]+]], #-536813568 |
| 60 | +; USE-MOVT-O0: movw [[R0:r[0-9]+]], #57344 |
| 61 | +; USE-MOVT-O0: movt [[R0]], #57344 |
90 | 62 |
|
91 |
| -; NO-USE-MOVT-O0-LABEL: {{_?}}foo2 |
| 63 | +; NO-USE-MOVT-COMMON-LABEL: {{_?}}foo2 |
| 64 | +; NO-USE-MOVT: mov.w [[R0:r[0-9]+]], #-536813568 |
92 | 65 | ; NO-USE-MOVT-O0: ldr [[R0:r[0-9]+]], [[L0:.*]]
|
93 | 66 | ; NO-USE-MOVT-O0: [[L0]]:
|
94 | 67 | ; NO-USE-MOVT-O0: .long 3758153728 @ 0xe000e000
|
| 68 | + |
95 | 69 | define i32 @foo2() {
|
96 | 70 | %1 = load i32, i32* inttoptr (i32 -536813568 to i32*) ; load from 0xe000e000
|
97 | 71 | ret i32 %1
|
98 | 72 | }
|
99 | 73 | attributes #0 = { "target-features"="+no-movt" }
|
| 74 | + |
| 75 | +define hidden i32 @no_litpool() minsize optsize { |
| 76 | +; CHECK-LABEL: no_litpool: |
| 77 | +; CHECK: mov.w r{{.}}, #65536 |
| 78 | +; CHECK: mov.w r{{.}}, #-134217728 |
| 79 | +; CHECK: mvn r{{.}}, #-134217728 |
| 80 | +entry: |
| 81 | + %call0 = tail call i32 @eat_const(i32 65536) |
| 82 | + %call1 = tail call i32 @eat_const(i32 -134217728) |
| 83 | + %call2 = tail call i32 @eat_const(i32 134217727) |
| 84 | + ret i32 %call2 |
| 85 | +} |
| 86 | + |
| 87 | +define hidden i32 @litpool() minsize optsize { |
| 88 | +; CHECK-LABEL: litpool: |
| 89 | +; CHECK: ldr r0, {{.*}}LCPI{{.*}} |
| 90 | +; CHECK-NEXT: b.w {{.*}}eat_const |
| 91 | +entry: |
| 92 | + %call1 = tail call i32 @eat_const(i32 8388601) |
| 93 | + ret i32 %call1 |
| 94 | +} |
| 95 | + |
| 96 | +declare dso_local i32 @eat_const(i32) |
| 97 | + |
0 commit comments