61 lines · plain
1# RUN: llc -o - %s -mtriple=arm-- -run-pass prologepilog | FileCheck %s2--- |3 define swiftcc ptr @need_emergency_slot(ptr swiftself %v) {4 ; Just a dummy to add a swiftself bit. The real code is in the MI below.5 unreachable6 }7...8---9# CHECK-LABEL: name: need_emergency_slot10# Make sure we do not just assume an unsaved/restored callee saved register11# is free to use. Callee saved parameters may still be used if they were used12# to pass arguments (as in swiftself).13name: need_emergency_slot14tracksRegLiveness: true15stack:16 - { id: 0, type: default, size: 8, alignment: 8 }17 - { id: 1, type: default, size: 4096, alignment: 8 }18body: |19 bb.0:20 liveins: $r10 ; swiftself parameter comes in as $r1021 22 ; Bring up register pressure to force emergency spilling, coax scavenging23 ; to use $r10 as that one is not spilled/restored.24 $r0 = IMPLICIT_DEF25 $r1 = IMPLICIT_DEF26 $r2 = IMPLICIT_DEF27 $r3 = IMPLICIT_DEF28 $r4 = IMPLICIT_DEF29 $r5 = IMPLICIT_DEF30 $r6 = IMPLICIT_DEF31 $r7 = IMPLICIT_DEF32 $r8 = IMPLICIT_DEF33 $r9 = IMPLICIT_DEF34 $r11 = IMPLICIT_DEF35 $r12 = IMPLICIT_DEF36 $lr = IMPLICIT_DEF37 38 ; Computing the large stack offset requires an extra register. We should39 ; not just use $r10 for that.40 ; CHECK-NOT: STRi12 %1,{{.*}}$r1041 42 STRi12 $r1, %stack.0, 0, 14, $noreg :: (store (s32))43 44 ; use the swiftself parameter value.45 KILL $r1046 47 KILL $r048 KILL $r149 KILL $r250 KILL $r351 KILL $r452 KILL $r553 KILL $r654 KILL $r755 KILL $r856 KILL $r957 KILL $r1158 KILL $r1259 KILL $lr60...61