blob: 5228fbb0f6daac11cd7e10baf62a734f66d4ab28 [file] [log] [blame]
Matthias Braunc618a462017-07-28 01:36:32 +00001# RUN: llc -o - %s -mtriple=arm-- -run-pass prologepilog | FileCheck %s
2--- |
3 define swiftcc i8* @need_emergency_slot(i8 *swiftself %v) {
4 ; Just a dummy to add a swiftself bit. The real code is in the MI below.
5 unreachable
6 }
7...
8---
9# CHECK-LABEL: name: need_emergency_slot
10# Make sure we do not just assume an unsaved/restored callee saved register
11# is free to use. Callee saved parameters may still be used if they were used
12# to pass arguments (as in swiftself).
13name: need_emergency_slot
14tracksRegLiveness: true
15stack:
16 - { id: 0, type: default, size: 8, alignment: 8 }
17 - { id: 1, type: default, size: 4096, alignment: 8 }
18body: |
19 bb.0:
Puyan Lotfi43e94b12018-01-31 22:04:26 +000020 liveins: $r10 ; swiftself parameter comes in as $r10
Matthias Braunc618a462017-07-28 01:36:32 +000021
22 ; Bring up register pressure to force emergency spilling, coax scavenging
Puyan Lotfi43e94b12018-01-31 22:04:26 +000023 ; to use $r10 as that one is not spilled/restored.
24 $r0 = IMPLICIT_DEF
25 $r1 = IMPLICIT_DEF
26 $r2 = IMPLICIT_DEF
27 $r3 = IMPLICIT_DEF
28 $r4 = IMPLICIT_DEF
29 $r5 = IMPLICIT_DEF
30 $r6 = IMPLICIT_DEF
31 $r7 = IMPLICIT_DEF
32 $r8 = IMPLICIT_DEF
33 $r9 = IMPLICIT_DEF
34 $r11 = IMPLICIT_DEF
35 $r12 = IMPLICIT_DEF
36 $lr = IMPLICIT_DEF
Matthias Braunc618a462017-07-28 01:36:32 +000037
38 ; Computing the large stack offset requires an extra register. We should
Puyan Lotfi43e94b12018-01-31 22:04:26 +000039 ; not just use $r10 for that.
40 ; CHECK-NOT: STRi12 %1,{{.*}}$r10
Matthias Braunc618a462017-07-28 01:36:32 +000041
Puyan Lotfi43e94b12018-01-31 22:04:26 +000042 STRi12 $r1, %stack.0, 0, 14, $noreg :: (store 4)
Matthias Braunc618a462017-07-28 01:36:32 +000043
44 ; use the swiftself parameter value.
Puyan Lotfi43e94b12018-01-31 22:04:26 +000045 KILL $r10
Matthias Braunc618a462017-07-28 01:36:32 +000046
Puyan Lotfi43e94b12018-01-31 22:04:26 +000047 KILL $r0
48 KILL $r1
49 KILL $r2
50 KILL $r3
51 KILL $r4
52 KILL $r5
53 KILL $r6
54 KILL $r7
55 KILL $r8
56 KILL $r9
57 KILL $r11
58 KILL $r12
59 KILL $lr
Matthias Braunc618a462017-07-28 01:36:32 +000060...