|
1 |
| -; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --no_x86_scrub_sp |
2 | 2 | ; Run with --no_x86_scrub_rip because we care a lot about how globals are
|
3 | 3 | ; accessed in the code model.
|
4 | 4 |
|
5 | 5 | ; RUN: llc -verify-machineinstrs < %s -relocation-model=static -code-model=small | FileCheck %s --check-prefix=CHECK --check-prefix=SMALL-STATIC
|
6 | 6 | ; RUN: llc -verify-machineinstrs < %s -relocation-model=static -code-model=medium | FileCheck %s --check-prefix=CHECK --check-prefix=MEDIUM-STATIC
|
7 | 7 | ; RUN: llc -verify-machineinstrs < %s -relocation-model=static -code-model=large | FileCheck %s --check-prefix=CHECK --check-prefix=LARGE-STATIC
|
8 | 8 | ; RUN: llc -verify-machineinstrs < %s -relocation-model=pic -code-model=small | FileCheck %s --check-prefix=CHECK --check-prefix=SMALL-PIC
|
| 9 | +; RUN: llc -verify-machineinstrs < %s -relocation-model=pic -code-model=medium -large-data-threshold=1000 | FileCheck %s --check-prefix=CHECK --check-prefix=MEDIUM-SMALL-DATA-PIC |
9 | 10 | ; RUN: llc -verify-machineinstrs < %s -relocation-model=pic -code-model=medium | FileCheck %s --check-prefix=CHECK --check-prefix=MEDIUM-PIC
|
10 | 11 | ; RUN: llc -verify-machineinstrs < %s -relocation-model=pic -code-model=large | FileCheck %s --check-prefix=CHECK --check-prefix=LARGE-PIC
|
11 | 12 |
|
| 13 | +; FIXME: small pic and medium pic w/ big enough large data threshold should be equivalent |
| 14 | + |
12 | 15 | ; Generated from this C source:
|
13 | 16 | ;
|
14 | 17 | ; static int static_data[10];
|
@@ -62,6 +65,11 @@ define dso_local ptr @lea_static_data() #0 {
|
62 | 65 | ; SMALL-PIC-NEXT: leaq static_data(%rip), %rax
|
63 | 66 | ; SMALL-PIC-NEXT: retq
|
64 | 67 | ;
|
| 68 | +; MEDIUM-SMALL-DATA-PIC-LABEL: lea_static_data: |
| 69 | +; MEDIUM-SMALL-DATA-PIC: # %bb.0: |
| 70 | +; MEDIUM-SMALL-DATA-PIC-NEXT: leaq static_data(%rip), %rax |
| 71 | +; MEDIUM-SMALL-DATA-PIC-NEXT: retq |
| 72 | +; |
65 | 73 | ; MEDIUM-PIC-LABEL: lea_static_data:
|
66 | 74 | ; MEDIUM-PIC: # %bb.0:
|
67 | 75 | ; MEDIUM-PIC-NEXT: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rcx
|
@@ -102,6 +110,11 @@ define dso_local ptr @lea_global_data() #0 {
|
102 | 110 | ; SMALL-PIC-NEXT: leaq global_data(%rip), %rax
|
103 | 111 | ; SMALL-PIC-NEXT: retq
|
104 | 112 | ;
|
| 113 | +; MEDIUM-SMALL-DATA-PIC-LABEL: lea_global_data: |
| 114 | +; MEDIUM-SMALL-DATA-PIC: # %bb.0: |
| 115 | +; MEDIUM-SMALL-DATA-PIC-NEXT: leaq global_data(%rip), %rax |
| 116 | +; MEDIUM-SMALL-DATA-PIC-NEXT: retq |
| 117 | +; |
105 | 118 | ; MEDIUM-PIC-LABEL: lea_global_data:
|
106 | 119 | ; MEDIUM-PIC: # %bb.0:
|
107 | 120 | ; MEDIUM-PIC-NEXT: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rcx
|
@@ -142,6 +155,11 @@ define dso_local ptr @lea_extern_data() #0 {
|
142 | 155 | ; SMALL-PIC-NEXT: movq extern_data@GOTPCREL(%rip), %rax
|
143 | 156 | ; SMALL-PIC-NEXT: retq
|
144 | 157 | ;
|
| 158 | +; MEDIUM-SMALL-DATA-PIC-LABEL: lea_extern_data: |
| 159 | +; MEDIUM-SMALL-DATA-PIC: # %bb.0: |
| 160 | +; MEDIUM-SMALL-DATA-PIC-NEXT: movq extern_data@GOTPCREL(%rip), %rax |
| 161 | +; MEDIUM-SMALL-DATA-PIC-NEXT: retq |
| 162 | +; |
145 | 163 | ; MEDIUM-PIC-LABEL: lea_extern_data:
|
146 | 164 | ; MEDIUM-PIC: # %bb.0:
|
147 | 165 | ; MEDIUM-PIC-NEXT: movq extern_data@GOTPCREL(%rip), %rax
|
@@ -180,6 +198,13 @@ define dso_local ptr @lea_unknown_size_data() #0 {
|
180 | 198 | ; SMALL-PIC-NEXT: leaq unknown_size_data(%rip), %rax
|
181 | 199 | ; SMALL-PIC-NEXT: retq
|
182 | 200 | ;
|
| 201 | +; MEDIUM-SMALL-DATA-PIC-LABEL: lea_unknown_size_data: |
| 202 | +; MEDIUM-SMALL-DATA-PIC: # %bb.0: |
| 203 | +; MEDIUM-SMALL-DATA-PIC-NEXT: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rcx |
| 204 | +; MEDIUM-SMALL-DATA-PIC-NEXT: movabsq $unknown_size_data@GOTOFF, %rax |
| 205 | +; MEDIUM-SMALL-DATA-PIC-NEXT: addq %rcx, %rax |
| 206 | +; MEDIUM-SMALL-DATA-PIC-NEXT: retq |
| 207 | +; |
183 | 208 | ; MEDIUM-PIC-LABEL: lea_unknown_size_data:
|
184 | 209 | ; MEDIUM-PIC: # %bb.0:
|
185 | 210 | ; MEDIUM-PIC-NEXT: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rcx
|
@@ -222,6 +247,12 @@ define dso_local i32 @load_global_data() #0 {
|
222 | 247 | ; SMALL-PIC-NEXT: movl global_data+8(%rip), %eax
|
223 | 248 | ; SMALL-PIC-NEXT: retq
|
224 | 249 | ;
|
| 250 | +; MEDIUM-SMALL-DATA-PIC-LABEL: load_global_data: |
| 251 | +; MEDIUM-SMALL-DATA-PIC: # %bb.0: |
| 252 | +; MEDIUM-SMALL-DATA-PIC-NEXT: leaq global_data(%rip), %rax |
| 253 | +; MEDIUM-SMALL-DATA-PIC-NEXT: movl 8(%rax), %eax |
| 254 | +; MEDIUM-SMALL-DATA-PIC-NEXT: retq |
| 255 | +; |
225 | 256 | ; MEDIUM-PIC-LABEL: load_global_data:
|
226 | 257 | ; MEDIUM-PIC: # %bb.0:
|
227 | 258 | ; MEDIUM-PIC-NEXT: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rax
|
@@ -267,6 +298,12 @@ define dso_local i32 @load_extern_data() #0 {
|
267 | 298 | ; SMALL-PIC-NEXT: movl 8(%rax), %eax
|
268 | 299 | ; SMALL-PIC-NEXT: retq
|
269 | 300 | ;
|
| 301 | +; MEDIUM-SMALL-DATA-PIC-LABEL: load_extern_data: |
| 302 | +; MEDIUM-SMALL-DATA-PIC: # %bb.0: |
| 303 | +; MEDIUM-SMALL-DATA-PIC-NEXT: movq extern_data@GOTPCREL(%rip), %rax |
| 304 | +; MEDIUM-SMALL-DATA-PIC-NEXT: movl 8(%rax), %eax |
| 305 | +; MEDIUM-SMALL-DATA-PIC-NEXT: retq |
| 306 | +; |
270 | 307 | ; MEDIUM-PIC-LABEL: load_extern_data:
|
271 | 308 | ; MEDIUM-PIC: # %bb.0:
|
272 | 309 | ; MEDIUM-PIC-NEXT: movq extern_data@GOTPCREL(%rip), %rax
|
@@ -310,6 +347,13 @@ define dso_local i32 @load_unknown_size_data() #0 {
|
310 | 347 | ; SMALL-PIC-NEXT: movl unknown_size_data+8(%rip), %eax
|
311 | 348 | ; SMALL-PIC-NEXT: retq
|
312 | 349 | ;
|
| 350 | +; MEDIUM-SMALL-DATA-PIC-LABEL: load_unknown_size_data: |
| 351 | +; MEDIUM-SMALL-DATA-PIC: # %bb.0: |
| 352 | +; MEDIUM-SMALL-DATA-PIC-NEXT: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rax |
| 353 | +; MEDIUM-SMALL-DATA-PIC-NEXT: movabsq $unknown_size_data@GOTOFF, %rcx |
| 354 | +; MEDIUM-SMALL-DATA-PIC-NEXT: movl 8(%rax,%rcx), %eax |
| 355 | +; MEDIUM-SMALL-DATA-PIC-NEXT: retq |
| 356 | +; |
313 | 357 | ; MEDIUM-PIC-LABEL: load_unknown_size_data:
|
314 | 358 | ; MEDIUM-PIC: # %bb.0:
|
315 | 359 | ; MEDIUM-PIC-NEXT: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rax
|
@@ -367,6 +411,11 @@ define dso_local ptr @lea_static_fn() #0 {
|
367 | 411 | ; SMALL-PIC-NEXT: leaq static_fn(%rip), %rax
|
368 | 412 | ; SMALL-PIC-NEXT: retq
|
369 | 413 | ;
|
| 414 | +; MEDIUM-SMALL-DATA-PIC-LABEL: lea_static_fn: |
| 415 | +; MEDIUM-SMALL-DATA-PIC: # %bb.0: |
| 416 | +; MEDIUM-SMALL-DATA-PIC-NEXT: leaq static_fn(%rip), %rax |
| 417 | +; MEDIUM-SMALL-DATA-PIC-NEXT: retq |
| 418 | +; |
370 | 419 | ; MEDIUM-PIC-LABEL: lea_static_fn:
|
371 | 420 | ; MEDIUM-PIC: # %bb.0:
|
372 | 421 | ; MEDIUM-PIC-NEXT: leaq static_fn(%rip), %rax
|
@@ -405,6 +454,11 @@ define dso_local ptr @lea_global_fn() #0 {
|
405 | 454 | ; SMALL-PIC-NEXT: leaq global_fn(%rip), %rax
|
406 | 455 | ; SMALL-PIC-NEXT: retq
|
407 | 456 | ;
|
| 457 | +; MEDIUM-SMALL-DATA-PIC-LABEL: lea_global_fn: |
| 458 | +; MEDIUM-SMALL-DATA-PIC: # %bb.0: |
| 459 | +; MEDIUM-SMALL-DATA-PIC-NEXT: leaq global_fn(%rip), %rax |
| 460 | +; MEDIUM-SMALL-DATA-PIC-NEXT: retq |
| 461 | +; |
408 | 462 | ; MEDIUM-PIC-LABEL: lea_global_fn:
|
409 | 463 | ; MEDIUM-PIC: # %bb.0:
|
410 | 464 | ; MEDIUM-PIC-NEXT: leaq global_fn(%rip), %rax
|
@@ -443,6 +497,11 @@ define dso_local ptr @lea_extern_fn() #0 {
|
443 | 497 | ; SMALL-PIC-NEXT: movq extern_fn@GOTPCREL(%rip), %rax
|
444 | 498 | ; SMALL-PIC-NEXT: retq
|
445 | 499 | ;
|
| 500 | +; MEDIUM-SMALL-DATA-PIC-LABEL: lea_extern_fn: |
| 501 | +; MEDIUM-SMALL-DATA-PIC: # %bb.0: |
| 502 | +; MEDIUM-SMALL-DATA-PIC-NEXT: movq extern_fn@GOTPCREL(%rip), %rax |
| 503 | +; MEDIUM-SMALL-DATA-PIC-NEXT: retq |
| 504 | +; |
446 | 505 | ; MEDIUM-PIC-LABEL: lea_extern_fn:
|
447 | 506 | ; MEDIUM-PIC: # %bb.0:
|
448 | 507 | ; MEDIUM-PIC-NEXT: movq extern_fn@GOTPCREL(%rip), %rax
|
@@ -516,6 +575,13 @@ define dso_local float @load_constant_pool(float %x) #0 {
|
516 | 575 | ; SMALL-PIC-NEXT: addss {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
|
517 | 576 | ; SMALL-PIC-NEXT: retq
|
518 | 577 | ;
|
| 578 | +; MEDIUM-SMALL-DATA-PIC-LABEL: load_constant_pool: |
| 579 | +; MEDIUM-SMALL-DATA-PIC: # %bb.0: |
| 580 | +; MEDIUM-SMALL-DATA-PIC-NEXT: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rax |
| 581 | +; MEDIUM-SMALL-DATA-PIC-NEXT: movabsq ${{\.?LCPI[0-9]+_[0-9]+}}@GOTOFF, %rcx |
| 582 | +; MEDIUM-SMALL-DATA-PIC-NEXT: addss (%rax,%rcx), %xmm0 |
| 583 | +; MEDIUM-SMALL-DATA-PIC-NEXT: retq |
| 584 | +; |
519 | 585 | ; MEDIUM-PIC-LABEL: load_constant_pool:
|
520 | 586 | ; MEDIUM-PIC: # %bb.0:
|
521 | 587 | ; MEDIUM-PIC-NEXT: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rax
|
|
0 commit comments