Matthias Braun | c618a46 | 2017-07-28 01:36:32 +0000 | [diff] [blame] | 1 | # 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). |
| 13 | name: need_emergency_slot |
| 14 | tracksRegLiveness: true |
| 15 | stack: |
| 16 | - { id: 0, type: default, size: 8, alignment: 8 } |
| 17 | - { id: 1, type: default, size: 4096, alignment: 8 } |
| 18 | body: | |
| 19 | bb.0: |
Puyan Lotfi | 43e94b1 | 2018-01-31 22:04:26 +0000 | [diff] [blame] | 20 | liveins: $r10 ; swiftself parameter comes in as $r10 |
Matthias Braun | c618a46 | 2017-07-28 01:36:32 +0000 | [diff] [blame] | 21 | |
| 22 | ; Bring up register pressure to force emergency spilling, coax scavenging |
Puyan Lotfi | 43e94b1 | 2018-01-31 22:04:26 +0000 | [diff] [blame] | 23 | ; 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 Braun | c618a46 | 2017-07-28 01:36:32 +0000 | [diff] [blame] | 37 | |
| 38 | ; Computing the large stack offset requires an extra register. We should |
Puyan Lotfi | 43e94b1 | 2018-01-31 22:04:26 +0000 | [diff] [blame] | 39 | ; not just use $r10 for that. |
| 40 | ; CHECK-NOT: STRi12 %1,{{.*}}$r10 |
Matthias Braun | c618a46 | 2017-07-28 01:36:32 +0000 | [diff] [blame] | 41 | |
Puyan Lotfi | 43e94b1 | 2018-01-31 22:04:26 +0000 | [diff] [blame] | 42 | STRi12 $r1, %stack.0, 0, 14, $noreg :: (store 4) |
Matthias Braun | c618a46 | 2017-07-28 01:36:32 +0000 | [diff] [blame] | 43 | |
| 44 | ; use the swiftself parameter value. |
Puyan Lotfi | 43e94b1 | 2018-01-31 22:04:26 +0000 | [diff] [blame] | 45 | KILL $r10 |
Matthias Braun | c618a46 | 2017-07-28 01:36:32 +0000 | [diff] [blame] | 46 | |
Puyan Lotfi | 43e94b1 | 2018-01-31 22:04:26 +0000 | [diff] [blame] | 47 | 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 Braun | c618a46 | 2017-07-28 01:36:32 +0000 | [diff] [blame] | 60 | ... |