100 lines · plain
1# RUN: llc -mtriple=aarch64-none-linux-gnu -aarch64-stack-hazard-size=1024 -run-pass=prologepilog %s -o - | FileCheck %s2--- |3 4 define void @stack_hazard_streaming_compat() "aarch64_pstate_sm_compatible" { entry: unreachable }5 define void @stack_hazard_streaming_compat_emergency_spill_slot() "aarch64_pstate_sm_compatible" { entry: unreachable }6 7...8 9# +------------------+10# | GPR callee-saves |11# +------------------+ <- FP12# | <hazard padding> |13# +------------------+14# | FPR locals |15# | %stack.1 |16# +------------------+17# | <hazard padding> |18# +------------------+19# | GPR locals |20# | %stack.2 |21# | <emergency spill>|22# +------------------+ <- BP23# | <VLA> |24# +------------------+ <- SP (can't be used due to VLA)25 26# In this case without the base pointer we'd need the emergency spill slot to27# access both %stack.1 and %stack.2. With the base pointer we can reach both28# without spilling.29 30name: stack_hazard_streaming_compat31# CHECK-LABEL: name: stack_hazard_streaming_compat32# CHECK: bb.0:33# CHECK: STRDui $d0, $x19, 13134# CHECK-NEXT: STRXui $x0, $x19, 135# CHECK: bb.1:36tracksRegLiveness: true37frameInfo:38 isFrameAddressTaken: true39stack:40 - { id: 0, type: variable-sized, alignment: 1 }41 - { id: 1, size: 8, alignment: 8 }42 - { id: 2, size: 8, alignment: 8 }43body: |44 bb.0:45 liveins: $x0, $x8, $d046 $x9 = LDRXui $x0, 0 :: (load (s64))47 STRDui $d0, %stack.1, 0 :: (store (s64) into %stack.1)48 STRXui $x0, %stack.2, 0 :: (store (s64) into %stack.2)49 B %bb.150 bb.1:51 liveins: $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17, $x18, $x19, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $lr52 RET_ReallyLR implicit $x19, implicit $x20, implicit $x21, implicit $x22, implicit $x23, implicit $x24, implicit $x25, implicit $x26, implicit $x27, implicit $x28, implicit $lr53...54---55# +------------------+56# | GPR callee-saves |57# +------------------+ <- FP58# | <hazard padding> |59# +------------------+60# | FPR locals |61# | %stack.1 |62# +------------------+63# | <hazard padding> |64# +------------------+65# | GPR locals |66# | %stack.2 | (very large)67# | <emergency spill>|68# +------------------+ <- BP69# | <VLA> |70# +------------------+ <- SP (can't be used due to VLA)71 72# In this case we need to use the emergency spill slot to access %stack.1 as it73# is too far from the frame pointer and the base pointer to directly address.74# Note: This also tests that the <emergency spill> located near the SP/BP.75 76name: stack_hazard_streaming_compat_emergency_spill_slot77# CHECK-LABEL: name: stack_hazard_streaming_compat_emergency_spill_slot78# CHECK: bb.0:79# CHECK: STRXui killed $[[SCRATCH:x[0-9]+]], $x19, 080# CHECK-NEXT: $[[SCRATCH]] = ADDXri $x19, 1056, 081# CHECK-NEXT: STRDui $d0, killed $[[SCRATCH]], 409582# CHECK-NEXT: $[[SCRATCH]] = LDRXui $x19, 083# CHECK: bb.1:84tracksRegLiveness: true85frameInfo:86 isFrameAddressTaken: true87stack:88 - { id: 0, type: variable-sized, alignment: 1 }89 - { id: 1, size: 8, alignment: 8 }90 - { id: 2, size: 32761, alignment: 8 }91body: |92 bb.0:93 liveins: $x0, $x8, $d094 $x9 = LDRXui $x0, 0 :: (load (s64))95 STRDui $d0, %stack.1, 0 :: (store (s64) into %stack.1)96 B %bb.197 bb.1:98 liveins: $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17, $x18, $x19, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $lr99 RET_ReallyLR implicit $x19, implicit $x20, implicit $x21, implicit $x22, implicit $x23, implicit $x24, implicit $x25, implicit $x26, implicit $x27, implicit $x28, implicit $lr100