brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · a527354 Raw
60 lines · plain
1; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -tailcallopt | FileCheck %s2; RUN: llc -global-isel -global-isel-abort=1 -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -tailcallopt | FileCheck %s3 4; This test is designed to be run in the situation where the5; call-frame is not reserved (hence disable-fp-elim), but where6; callee-pop can occur (hence tailcallopt).7 8declare fastcc void @will_pop([8 x i64], i32 %val)9 10define fastcc void @foo(i32 %in) {11; CHECK-LABEL: foo:12 13  %addr = alloca i8, i32 %in14 15; Normal frame setup stuff:16; CHECK: stp     x29, x30, [sp, #-16]!17; CHECK: mov     x29, sp18 19; Reserve space for call-frame:20; CHECK: str w{{[0-9]+}}, [sp, #-16]!21 22  call fastcc void @will_pop([8 x i64] undef, i32 42)23; CHECK: bl will_pop24 25; Since @will_pop is fastcc with tailcallopt, it will put the stack26; back where it needs to be, we shouldn't duplicate that27; CHECK-NOT: sub sp, sp, #1628; CHECK-NOT: add sp, sp,29 30; CHECK: mov     sp, x2931; CHECK: ldp     x29, x30, [sp], #1632  ret void33}34 35declare void @wont_pop([8 x i64], i32 %val)36 37define void @foo1(i32 %in) {38; CHECK-LABEL: foo1:39 40  %addr = alloca i8, i32 %in41; Normal frame setup again42; CHECK: stp     x29, x30, [sp, #-16]!43; CHECK: mov     x29, sp44 45; Reserve space for call-frame46; CHECK: str w{{[0-9]+}}, [sp, #-16]!47 48  call void @wont_pop([8 x i64] undef, i32 42)49; CHECK: bl wont_pop50 51; This time we *do* need to unreserve the call-frame52; CHECK: add sp, sp, #1653 54; Check for epilogue (primarily to make sure sp spotted above wasn't55; part of it).56; CHECK: mov     sp, x2957; CHECK: ldp     x29, x30, [sp], #1658  ret void59}60