• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-linux -mattr=-avx | FileCheck %s -check-prefix=X64
3; Win64 has not supported byval yet.
4; RUN: llc < %s -mtriple=i686-- -mattr=-avx | FileCheck %s -check-prefix=X86
5
6%struct.s = type { i32, i32, i32, i32, i32, i32, i32, i32,
7                   i32, i32, i32, i32, i32, i32, i32, i32,
8                   i32, i32, i32, i32, i32, i32, i32, i32,
9                   i32, i32, i32, i32, i32, i32, i32, i32,
10                   i32 }
11
12define void @g(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6) nounwind {
13; X64-LABEL: g:
14; X64:       # %bb.0: # %entry
15; X64-NEXT:    pushq %rbx
16; X64-NEXT:    subq $288, %rsp # imm = 0x120
17; X64-NEXT:    movl %edi, {{[0-9]+}}(%rsp)
18; X64-NEXT:    movl %esi, {{[0-9]+}}(%rsp)
19; X64-NEXT:    movl %edx, {{[0-9]+}}(%rsp)
20; X64-NEXT:    movl %ecx, {{[0-9]+}}(%rsp)
21; X64-NEXT:    movl %r8d, {{[0-9]+}}(%rsp)
22; X64-NEXT:    movl %r9d, {{[0-9]+}}(%rsp)
23; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rbx
24; X64-NEXT:    movl $16, %ecx
25; X64-NEXT:    movq %rsp, %rdi
26; X64-NEXT:    movq %rbx, %rsi
27; X64-NEXT:    rep;movsq (%rsi), %es:(%rdi)
28; X64-NEXT:    movl {{[0-9]+}}(%rsp), %eax
29; X64-NEXT:    movl %eax, {{[0-9]+}}(%rsp)
30; X64-NEXT:    callq f
31; X64-NEXT:    movl $16, %ecx
32; X64-NEXT:    movq %rsp, %rdi
33; X64-NEXT:    movq %rbx, %rsi
34; X64-NEXT:    rep;movsq (%rsi), %es:(%rdi)
35; X64-NEXT:    movl {{[0-9]+}}(%rsp), %eax
36; X64-NEXT:    movl %eax, {{[0-9]+}}(%rsp)
37; X64-NEXT:    callq f
38; X64-NEXT:    addq $288, %rsp # imm = 0x120
39; X64-NEXT:    popq %rbx
40; X64-NEXT:    retq
41;
42; X86-LABEL: g:
43; X86:       # %bb.0: # %entry
44; X86-NEXT:    pushl %ebp
45; X86-NEXT:    movl %esp, %ebp
46; X86-NEXT:    pushl %ebx
47; X86-NEXT:    pushl %edi
48; X86-NEXT:    pushl %esi
49; X86-NEXT:    andl $-16, %esp
50; X86-NEXT:    subl $288, %esp # imm = 0x120
51; X86-NEXT:    movl 8(%ebp), %eax
52; X86-NEXT:    movl %eax, {{[0-9]+}}(%esp)
53; X86-NEXT:    movl 12(%ebp), %eax
54; X86-NEXT:    movl %eax, {{[0-9]+}}(%esp)
55; X86-NEXT:    movl 16(%ebp), %eax
56; X86-NEXT:    movl %eax, {{[0-9]+}}(%esp)
57; X86-NEXT:    movl 20(%ebp), %eax
58; X86-NEXT:    movl %eax, {{[0-9]+}}(%esp)
59; X86-NEXT:    movl 24(%ebp), %eax
60; X86-NEXT:    movl %eax, {{[0-9]+}}(%esp)
61; X86-NEXT:    movl 28(%ebp), %eax
62; X86-NEXT:    movl %eax, {{[0-9]+}}(%esp)
63; X86-NEXT:    leal {{[0-9]+}}(%esp), %ebx
64; X86-NEXT:    movl $33, %ecx
65; X86-NEXT:    movl %esp, %edi
66; X86-NEXT:    movl %ebx, %esi
67; X86-NEXT:    rep;movsl (%esi), %es:(%edi)
68; X86-NEXT:    calll f
69; X86-NEXT:    movl $33, %ecx
70; X86-NEXT:    movl %esp, %edi
71; X86-NEXT:    movl %ebx, %esi
72; X86-NEXT:    rep;movsl (%esi), %es:(%edi)
73; X86-NEXT:    calll f
74; X86-NEXT:    leal -12(%ebp), %esp
75; X86-NEXT:    popl %esi
76; X86-NEXT:    popl %edi
77; X86-NEXT:    popl %ebx
78; X86-NEXT:    popl %ebp
79; X86-NEXT:    retl
80entry:
81        %d = alloca %struct.s, align 16
82        %tmp = getelementptr %struct.s, %struct.s* %d, i32 0, i32 0
83        store i32 %a1, i32* %tmp, align 16
84        %tmp2 = getelementptr %struct.s, %struct.s* %d, i32 0, i32 1
85        store i32 %a2, i32* %tmp2, align 16
86        %tmp4 = getelementptr %struct.s, %struct.s* %d, i32 0, i32 2
87        store i32 %a3, i32* %tmp4, align 16
88        %tmp6 = getelementptr %struct.s, %struct.s* %d, i32 0, i32 3
89        store i32 %a4, i32* %tmp6, align 16
90        %tmp8 = getelementptr %struct.s, %struct.s* %d, i32 0, i32 4
91        store i32 %a5, i32* %tmp8, align 16
92        %tmp10 = getelementptr %struct.s, %struct.s* %d, i32 0, i32 5
93        store i32 %a6, i32* %tmp10, align 16
94        call void @f(%struct.s* byval(%struct.s) %d)
95        call void @f(%struct.s* byval(%struct.s) %d)
96        ret void
97}
98
99declare void @f(%struct.s* byval(%struct.s))
100