1 ; RUN: llc < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s
3 @.str = private unnamed_addr constant [11 x i8] c"val = %ld\0A\00", align 1
5 ; Function Attrs: noinline optnone
6 define dso_local void @set_large(i64 %val) #0 {
8 %val.addr = alloca i64, align 8
9 %large = alloca [268435456 x i64], align 8
10 %i = alloca i32, align 4
11 store i64 %val, ptr %val.addr, align 8
12 %0 = load i64, ptr %val.addr, align 8
13 %arrayidx = getelementptr inbounds [268435456 x i64], ptr %large, i64 0, i64 %0
14 store i64 1, ptr %arrayidx, align 8
15 %1 = load i64, ptr %val.addr, align 8
16 %arrayidx1 = getelementptr inbounds [268435456 x i64], ptr %large, i64 0, i64 %1
17 %2 = load i64, ptr %arrayidx1, align 8
18 %call = call i32 (ptr, ...) @printf(ptr @.str, i64 %2)
22 declare dso_local i32 @printf(ptr, ...)
24 attributes #0 = { noinline optnone "frame-pointer"="all" uwtable }
26 ; CHECK: stp x[[SPILL_REG1:[0-9]+]], x[[SPILL_REG2:[0-9]+]], [sp, #-[[SPILL_OFFSET1:[0-9]+]]]
27 ; CHECK-NEXT: .cfi_def_cfa_offset [[SPILL_OFFSET1]]
28 ; CHECK-NEXT: str x[[SPILL_REG3:[0-9]+]], [sp, #[[SPILL_OFFSET2:[0-9]+]]]
29 ; CHECK-NEXT: mov x[[FRAME:[0-9]+]], sp
30 ; CHECK-NEXT: .cfi_def_cfa w[[FRAME]], [[SPILL_OFFSET1]]
31 ; CHECK-COUNT-128: sub sp, sp, #[[STACK1:[0-9]+]], lsl #12
32 ; CHECK-NEXT: sub sp, sp, #[[STACK2:[0-9]+]], lsl #12
33 ; CHECK-NEXT: sub sp, sp, #[[STACK3:[0-9]+]]
34 ; CHECK: sub x[[INDEX:[0-9]+]], x[[FRAME]], #8
35 ; CHECK-NEXT: str x0, [x[[INDEX]]]
36 ; CHECK-NEXT: ldr x[[VAL1:[0-9]+]], [x[[INDEX]]]
37 ; CHECK-NEXT: add x[[VAL3:[0-9]+]], sp, #8
38 ; CHECK-NEXT: mov x[[VAL2:[0-9]+]], #8
39 ; CHECK-NEXT: madd x[[VAL1]], x[[VAL1]], x[[VAL2]], x[[VAL3]]
40 ; CHECK-NEXT: mov x[[TMP1:[0-9]+]], #1
41 ; CHECK-NEXT: str x[[TMP1]], [x[[VAL1]]]
42 ; CHECK-NEXT: ldr x[[INDEX]], [x[[INDEX]]]
43 ; CHECK-NEXT: add x[[VAL3:[0-9]+]], sp, #8
44 ; CHECK-NEXT: mov x[[VAL4:[0-9]+]], #8
45 ; CHECK-NEXT: madd x[[INDEX]], x[[INDEX]], x[[VAL4]], x[[VAL3]]
46 ; CHECK-NEXT: ldr x1, [x[[INDEX]]
48 ; CHECK-COUNT-128: add sp, sp, #[[STACK1]], lsl #12
49 ; CHECK-NEXT: add sp, sp, #[[STACK2]], lsl #12
50 ; CHECK-NEXT: add sp, sp, #[[STACK3]]
51 ; CHECK-NEXT: .cfi_def_cfa wsp, [[SPILL_OFFSET1]]
52 ; CHECK-NEXT: ldr x[[SPILL_REG3]], [sp, #[[SPILL_OFFSET2]]]
53 ; CHECK-NEXT: ldp x[[SPILL_REG1]], x[[SPILL_REG2]], [sp], #[[SPILL_OFFSET1]]
54 ; CHECK-NEXT: .cfi_def_cfa_offset 0
55 ; CHECK-NEXT: .cfi_restore w[[SPILL_REG3]]
56 ; CHECK-NEXT: .cfi_restore w[[SPILL_REG2]]
57 ; CHECK-NEXT: .cfi_restore w[[SPILL_REG1]]