1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --no_x86_scrub_sp
2 ; RUN: llc -mtriple=x86_64-linux-android < %s | FileCheck -check-prefix=CHECK-X86-64 %s
3 ; RUN: llc -mtriple=i686-linux-android < %s | FileCheck -check-prefix=CHECK-X86-32 %s
5 define i32 @foo(i32 %n) local_unnamed_addr #0 {
6 ; CHECK-X86-64-LABEL: foo:
7 ; CHECK-X86-64: # %bb.0:
8 ; CHECK-X86-64-NEXT: pushq %rbp
9 ; CHECK-X86-64-NEXT: .cfi_def_cfa_offset 16
10 ; CHECK-X86-64-NEXT: .cfi_offset %rbp, -16
11 ; CHECK-X86-64-NEXT: movq %rsp, %rbp
12 ; CHECK-X86-64-NEXT: .cfi_def_cfa_register %rbp
13 ; CHECK-X86-64-NEXT: movq %rsp, %rax
14 ; CHECK-X86-64-NEXT: movl %edi, %ecx
15 ; CHECK-X86-64-NEXT: leaq 15(,%rcx,4), %rcx
16 ; CHECK-X86-64-NEXT: andq $-16, %rcx
17 ; CHECK-X86-64-NEXT: subq %rcx, %rax
18 ; CHECK-X86-64-NEXT: cmpq %rsp, %rax
19 ; CHECK-X86-64-NEXT: jge .LBB0_3
20 ; CHECK-X86-64-NEXT: .LBB0_2: # =>This Inner Loop Header: Depth=1
21 ; CHECK-X86-64-NEXT: xorq $0, (%rsp)
22 ; CHECK-X86-64-NEXT: subq $4096, %rsp # imm = 0x1000
23 ; CHECK-X86-64-NEXT: cmpq %rsp, %rax
24 ; CHECK-X86-64-NEXT: jl .LBB0_2
25 ; CHECK-X86-64-NEXT: .LBB0_3:
26 ; CHECK-X86-64-NEXT: movq %rax, %rsp
27 ; CHECK-X86-64-NEXT: movl $1, 4792(%rax)
28 ; CHECK-X86-64-NEXT: movl (%rax), %eax
29 ; CHECK-X86-64-NEXT: movq %rbp, %rsp
30 ; CHECK-X86-64-NEXT: popq %rbp
31 ; CHECK-X86-64-NEXT: .cfi_def_cfa %rsp, 8
32 ; CHECK-X86-64-NEXT: retq
34 ; CHECK-X86-32-LABEL: foo:
35 ; CHECK-X86-32: # %bb.0:
36 ; CHECK-X86-32-NEXT: pushl %ebp
37 ; CHECK-X86-32-NEXT: .cfi_def_cfa_offset 8
38 ; CHECK-X86-32-NEXT: .cfi_offset %ebp, -8
39 ; CHECK-X86-32-NEXT: movl %esp, %ebp
40 ; CHECK-X86-32-NEXT: .cfi_def_cfa_register %ebp
41 ; CHECK-X86-32-NEXT: subl $8, %esp
42 ; CHECK-X86-32-NEXT: movl 8(%ebp), %ecx
43 ; CHECK-X86-32-NEXT: movl %esp, %eax
44 ; CHECK-X86-32-NEXT: leal 15(,%ecx,4), %ecx
45 ; CHECK-X86-32-NEXT: andl $-16, %ecx
46 ; CHECK-X86-32-NEXT: subl %ecx, %eax
47 ; CHECK-X86-32-NEXT: cmpl %esp, %eax
48 ; CHECK-X86-32-NEXT: jge .LBB0_3
49 ; CHECK-X86-32-NEXT: .LBB0_2: # =>This Inner Loop Header: Depth=1
50 ; CHECK-X86-32-NEXT: xorl $0, (%esp)
51 ; CHECK-X86-32-NEXT: subl $4096, %esp # imm = 0x1000
52 ; CHECK-X86-32-NEXT: cmpl %esp, %eax
53 ; CHECK-X86-32-NEXT: jl .LBB0_2
54 ; CHECK-X86-32-NEXT: .LBB0_3:
55 ; CHECK-X86-32-NEXT: movl %eax, %esp
56 ; CHECK-X86-32-NEXT: movl $1, 4792(%eax)
57 ; CHECK-X86-32-NEXT: movl (%eax), %eax
58 ; CHECK-X86-32-NEXT: movl %ebp, %esp
59 ; CHECK-X86-32-NEXT: popl %ebp
60 ; CHECK-X86-32-NEXT: .cfi_def_cfa %esp, 4
61 ; CHECK-X86-32-NEXT: retl
62 %a = alloca i32, i32 %n, align 16
63 %b = getelementptr inbounds i32, ptr %a, i64 1198
64 store volatile i32 1, ptr %b
65 %c = load volatile i32, ptr %a
69 attributes #0 = {"probe-stack"="inline-asm"}