1 ; RUN: llc -march=mipsel -O0 -relocation-model=pic < %s | FileCheck %s
2 ; Check that register scavenging spill slot is close to $fp.
3 target triple="mipsel--"
5 ; FIXME: After recent rework to FastISel, don't know how to trigger the
6 ; emergency spill slot. Filed PR48301.
8 @var = external global i32
9 @ptrvar = external global i8*
13 %space = alloca i32, align 4
14 %stackspace = alloca[16384 x i32], align 4
16 ; ensure stackspace is not optimized out
17 %stackspace_casted = bitcast [16384 x i32]* %stackspace to i8*
18 store volatile i8* %stackspace_casted, i8** @ptrvar
20 ; Load values to increase register pressure.
21 %v0 = load volatile i32, i32* @var
22 %v1 = load volatile i32, i32* @var
23 %v2 = load volatile i32, i32* @var
24 %v3 = load volatile i32, i32* @var
25 %v4 = load volatile i32, i32* @var
26 %v5 = load volatile i32, i32* @var
27 %v6 = load volatile i32, i32* @var
28 %v7 = load volatile i32, i32* @var
29 %v8 = load volatile i32, i32* @var
30 %v9 = load volatile i32, i32* @var
31 %v10 = load volatile i32, i32* @var
32 %v11 = load volatile i32, i32* @var
33 %v12 = load volatile i32, i32* @var
34 %v13 = load volatile i32, i32* @var
35 %v14 = load volatile i32, i32* @var
36 %v15 = load volatile i32, i32* @var
37 %v16 = load volatile i32, i32* @var
39 ; Computing a stack-relative values needs an additional register.
40 ; We should get an emergency spill/reload for this.
41 ; CHECK: sw ${{.*}}, 0($sp)
42 ; CHECK: lw ${{.*}}, 0($sp)
43 store volatile i32 %v0, i32* %space
45 ; store values so they are used.
46 store volatile i32 %v0, i32* @var
47 store volatile i32 %v1, i32* @var
48 store volatile i32 %v2, i32* @var
49 store volatile i32 %v3, i32* @var
50 store volatile i32 %v4, i32* @var
51 store volatile i32 %v5, i32* @var
52 store volatile i32 %v6, i32* @var
53 store volatile i32 %v7, i32* @var
54 store volatile i32 %v8, i32* @var
55 store volatile i32 %v9, i32* @var
56 store volatile i32 %v10, i32* @var
57 store volatile i32 %v11, i32* @var
58 store volatile i32 %v12, i32* @var
59 store volatile i32 %v13, i32* @var
60 store volatile i32 %v14, i32* @var
61 store volatile i32 %v15, i32* @var
62 store volatile i32 %v16, i32* @var