1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --no_x86_scrub_sp
2 ; RUN: llc < %s | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 define i32 @foo_noprotect() local_unnamed_addr {
8 ; CHECK-LABEL: foo_noprotect:
10 ; CHECK-NEXT: pushq %rbp
11 ; CHECK-NEXT: .cfi_def_cfa_offset 16
12 ; CHECK-NEXT: .cfi_offset %rbp, -16
13 ; CHECK-NEXT: movq %rsp, %rbp
14 ; CHECK-NEXT: .cfi_def_cfa_register %rbp
15 ; CHECK-NEXT: andq $-4096, %rsp # imm = 0xF000
16 ; CHECK-NEXT: subq $73728, %rsp # imm = 0x12000
17 ; CHECK-NEXT: movl $1, 392(%rsp)
18 ; CHECK-NEXT: movl $1, 28792(%rsp)
19 ; CHECK-NEXT: movl (%rsp), %eax
20 ; CHECK-NEXT: movq %rbp, %rsp
21 ; CHECK-NEXT: popq %rbp
22 ; CHECK-NEXT: .cfi_def_cfa %rsp, 8
24 %a = alloca i32, i64 18000, align 4096
25 %b0 = getelementptr inbounds i32, ptr %a, i64 98
26 %b1 = getelementptr inbounds i32, ptr %a, i64 7198
27 store volatile i32 1, ptr %b0
28 store volatile i32 1, ptr %b1
29 %c = load volatile i32, ptr %a
33 define i32 @foo_protect() local_unnamed_addr #0 {
34 ; CHECK-LABEL: foo_protect:
36 ; CHECK-NEXT: pushq %rbp
37 ; CHECK-NEXT: .cfi_def_cfa_offset 16
38 ; CHECK-NEXT: .cfi_offset %rbp, -16
39 ; CHECK-NEXT: movq %rsp, %rbp
40 ; CHECK-NEXT: .cfi_def_cfa_register %rbp
41 ; CHECK-NEXT: movq %rsp, %r11
42 ; CHECK-NEXT: andq $-4096, %r11 # imm = 0xF000
43 ; CHECK-NEXT: cmpq %rsp, %r11
44 ; CHECK-NEXT: je .LBB1_4
45 ; CHECK-NEXT: # %bb.1:
46 ; CHECK-NEXT: subq $4096, %rsp # imm = 0x1000
47 ; CHECK-NEXT: cmpq %rsp, %r11
48 ; CHECK-NEXT: jb .LBB1_3
49 ; CHECK-NEXT: .LBB1_2: # =>This Inner Loop Header: Depth=1
50 ; CHECK-NEXT: movq $0, (%rsp)
51 ; CHECK-NEXT: subq $4096, %rsp # imm = 0x1000
52 ; CHECK-NEXT: cmpq %rsp, %r11
53 ; CHECK-NEXT: jb .LBB1_2
54 ; CHECK-NEXT: .LBB1_3:
55 ; CHECK-NEXT: movq %r11, %rsp
56 ; CHECK-NEXT: movq $0, (%rsp)
57 ; CHECK-NEXT: .LBB1_4:
58 ; CHECK-NEXT: movq %rsp, %r11
59 ; CHECK-NEXT: subq $73728, %r11 # imm = 0x12000
60 ; CHECK-NEXT: .LBB1_5: # =>This Inner Loop Header: Depth=1
61 ; CHECK-NEXT: subq $4096, %rsp # imm = 0x1000
62 ; CHECK-NEXT: movq $0, (%rsp)
63 ; CHECK-NEXT: cmpq %r11, %rsp
64 ; CHECK-NEXT: jne .LBB1_5
65 ; CHECK-NEXT: # %bb.6:
66 ; CHECK-NEXT: movl $1, 392(%rsp)
67 ; CHECK-NEXT: movl $1, 28792(%rsp)
68 ; CHECK-NEXT: movl (%rsp), %eax
69 ; CHECK-NEXT: movq %rbp, %rsp
70 ; CHECK-NEXT: popq %rbp
71 ; CHECK-NEXT: .cfi_def_cfa %rsp, 8
73 %a = alloca i32, i64 18000, align 4096
74 %b0 = getelementptr inbounds i32, ptr %a, i64 98
75 %b1 = getelementptr inbounds i32, ptr %a, i64 7198
76 store volatile i32 1, ptr %b0
77 store volatile i32 1, ptr %b1
78 %c = load volatile i32, ptr %a
82 attributes #0 = {"probe-stack"="inline-asm"}