37 lines · plain
1; RUN: llc -mtriple=thumbv7-linux-gnueabi -o - %s | FileCheck %s2 3; This alloca is just large enough that FrameLowering decides it needs a frame4; to guarantee access, based on the range of ldrex.5 6; The actual alloca size is a bit of black magic, unfortunately: the real7; maximum accessible is 1020, but FrameLowering adds 16 bytes to its estimated8; stack size just because so the alloca is not actually the what the limit gets9; compared to. The important point is that we don't go up to ~4096, which is the10; default with no strange instructions.11define void @test_large_frame() {12; CHECK-LABEL: test_large_frame:13; CHECK: push14; CHECK: sub.w sp, sp, #100815 16 %ptr = alloca i32, i32 25217 18 %addr = getelementptr i32, ptr %ptr, i32 119 call i32 @llvm.arm.ldrex.p0(ptr elementtype(i32) %addr)20 ret void21}22 23; This alloca is just is just the other side of the limit, so no frame24define void @test_small_frame() {25; CHECK-LABEL: test_small_frame:26; CHECK-NOT: push27; CHECK: sub.w sp, sp, #100428 29 %ptr = alloca i32, i32 25130 31 %addr = getelementptr i32, ptr %ptr, i32 132 call i32 @llvm.arm.ldrex.p0(ptr elementtype(i32) %addr)33 ret void34}35 36declare i32 @llvm.arm.ldrex.p0(ptr)37