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 ptr
13 %space = alloca i32, align 4
14 %stackspace = alloca[16384 x i32], align 4
16 ; ensure stackspace is not optimized out
17 store volatile ptr %stackspace, ptr @ptrvar
19 ; Load values to increase register pressure.
20 %v0 = load volatile i32, ptr @var
21 %v1 = load volatile i32, ptr @var
22 %v2 = load volatile i32, ptr @var
23 %v3 = load volatile i32, ptr @var
24 %v4 = load volatile i32, ptr @var
25 %v5 = load volatile i32, ptr @var
26 %v6 = load volatile i32, ptr @var
27 %v7 = load volatile i32, ptr @var
28 %v8 = load volatile i32, ptr @var
29 %v9 = load volatile i32, ptr @var
30 %v10 = load volatile i32, ptr @var
31 %v11 = load volatile i32, ptr @var
32 %v12 = load volatile i32, ptr @var
33 %v13 = load volatile i32, ptr @var
34 %v14 = load volatile i32, ptr @var
35 %v15 = load volatile i32, ptr @var
36 %v16 = load volatile i32, ptr @var
38 ; Computing a stack-relative values needs an additional register.
39 ; We should get an emergency spill/reload for this.
40 ; CHECK: sw ${{.*}}, 0($sp)
41 ; CHECK: lw ${{.*}}, 0($sp)
42 store volatile i32 %v0, ptr %space
44 ; store values so they are used.
45 store volatile i32 %v0, ptr @var
46 store volatile i32 %v1, ptr @var
47 store volatile i32 %v2, ptr @var
48 store volatile i32 %v3, ptr @var
49 store volatile i32 %v4, ptr @var
50 store volatile i32 %v5, ptr @var
51 store volatile i32 %v6, ptr @var
52 store volatile i32 %v7, ptr @var
53 store volatile i32 %v8, ptr @var
54 store volatile i32 %v9, ptr @var
55 store volatile i32 %v10, ptr @var
56 store volatile i32 %v11, ptr @var
57 store volatile i32 %v12, ptr @var
58 store volatile i32 %v13, ptr @var
59 store volatile i32 %v14, ptr @var
60 store volatile i32 %v15, ptr @var
61 store volatile i32 %v16, ptr @var