1; RUN: llc < %s -mcpu=cortex-a15 -verify-machineinstrs -arm-atomic-cfg-tidy=0 | FileCheck %s
2
3; Check a spill right after a function call with large struct byval is correctly
4; generated.
5; PR16393
6
7; We expect 4-byte spill and reload to be generated.
8
9; CHECK-LABEL: set_stored_macroblock_parameters:
10; CHECK:         str r0, [sp, #{{[0-9]}}] @ 4-byte Spill
11; CHECK:         @APP
12; CHECK:         bl RestoreMVBlock8x8
13; CHECK:         ldr r0, [sp, #{{[0-9]}}] @ 4-byte Reload
14
15target triple = "armv7l-unknown-linux-gnueabihf"
16
17%structN = type { i32, [16 x [16 x i32]], [16 x [16 x i32]], [16 x [16 x i32]], [3 x [16 x [16 x i32]]], [4 x i16], [4 x i8], [4 x i8], [4 x i8], [16 x [16 x i16]], [16 x [16 x i16]], [16 x [16 x i32]] }
18
19@tr8x8 = external global %structN, align 4
20@luma_transform_size_8x8_flag = external global i32, align 4
21
22; Function Attrs: nounwind
23define void @set_stored_macroblock_parameters(i16 %a0, i32 %a1) #1 {
24entry:
25  %0 = load i32, i32* @luma_transform_size_8x8_flag, align 4
26  tail call void asm sideeffect "", "~{r1},~{r2},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11}"()
27  tail call void @RestoreMVBlock8x8(i32 1, i32 2, %structN* byval(%structN) @tr8x8, i32 0)
28  %arrayidx313 = getelementptr inbounds i8*, i8** null, i32 %0
29  %1 = load i8*, i8** %arrayidx313, align 4
30  %arrayidx314 = getelementptr inbounds i8, i8* %1, i32 0
31  store i8 -1, i8* %arrayidx314, align 1
32  ret void
33}
34
35; Function Attrs: nounwind
36declare void @RestoreMVBlock8x8(i32, i32, %structN* byval(%structN) nocapture, i32) #1
37
38attributes #1 = { nounwind "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
39