55 lines · plain
1# RUN: llc -run-pass=prologepilog %s -o - | FileCheck %s2 3# Make sure we use the correct offset for stack accesses using the base pointer4# within call frame blocks. Key points of test:5# + A large SP in ADJCALLSTACKDOWN forces each call to get its own adjustment.6# + An over-aligned stack variable means that we must use r6 rather than fp7# to access this variables.8#9# Under these circumstances, the ADJCALLSTACKDOWN must not apply to r6 offsets.10 11--- |12 ; ModuleID = 'simple.ll'13 source_filename = "simple.ll"14 target datalayout = "e-m:o-p:32:32-i64:64-a:0:32-n32-S128"15 target triple = "thumbv7k-apple-ios"16 17 declare void @bar([4 x i32], i32)18 19 define void @foo(i32 %n) {20 ret void21 }22 23...24---25name: foo26liveins:27 - { reg: '$r0', virtual-reg: '' }28frameInfo:29 adjustsStack: true30 hasCalls: true31 maxCallFrameSize: 227632stack:33 - { id: 0, name: '', type: spill-slot, offset: 0, alignment: 32, size: 4 }34constants: []35body: |36 bb.0 (%ir-block.0):37 liveins: $r038 39 ; CHECK: t2STRi12 killed $r0, $r6, [[OFFSET:[0-9]+]]40 t2STRi12 killed $r0, %stack.0, 0, 14, $noreg :: (store (s32) into %stack.0)41 42 ADJCALLSTACKDOWN 2276, 0, 14, $noreg, implicit-def dead $sp, implicit $sp43 44 ; CHECK: renamable $r0 = t2LDRi12 $r6, [[OFFSET]]45 renamable $r0 = t2LDRi12 %stack.0, 0, 14, $noreg, :: (load (s32) from %stack.0)46 renamable $r1 = IMPLICIT_DEF47 renamable $r2 = IMPLICIT_DEF48 renamable $r3 = IMPLICIT_DEF49 tBL 14, $noreg, @bar, csr_ios, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit killed $r1, implicit killed $r2, implicit killed $r3, implicit-def $sp50 51 ADJCALLSTACKUP 2276, 0, 14, $noreg, implicit-def dead $sp, implicit $sp52 tBX_RET 14, $noreg53 54...55