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
6 %struct.s = type { i64, i64, i64, i64, i64, i64, i64, i64,
7 i64, i64, i64, i64, i64, i64, i64, i64,
10 define void @g(i64 %a, i64 %b, i64 %c) nounwind {
12 ; X64: # %bb.0: # %entry
13 ; X64-NEXT: pushq %rbx
14 ; X64-NEXT: subq $288, %rsp # imm = 0x120
15 ; X64-NEXT: movq %rdi, {{[0-9]+}}(%rsp)
16 ; X64-NEXT: movq %rsi, {{[0-9]+}}(%rsp)
17 ; X64-NEXT: movq %rdx, {{[0-9]+}}(%rsp)
18 ; X64-NEXT: leaq {{[0-9]+}}(%rsp), %rbx
19 ; X64-NEXT: movl $17, %ecx
20 ; X64-NEXT: movq %rsp, %rdi
21 ; X64-NEXT: movq %rbx, %rsi
22 ; X64-NEXT: rep;movsq (%rsi), %es:(%rdi)
23 ; X64-NEXT: callq f@PLT
24 ; X64-NEXT: movl $17, %ecx
25 ; X64-NEXT: movq %rsp, %rdi
26 ; X64-NEXT: movq %rbx, %rsi
27 ; X64-NEXT: rep;movsq (%rsi), %es:(%rdi)
28 ; X64-NEXT: callq f@PLT
29 ; X64-NEXT: addq $288, %rsp # imm = 0x120
34 ; X86: # %bb.0: # %entry
35 ; X86-NEXT: pushl %ebp
36 ; X86-NEXT: movl %esp, %ebp
37 ; X86-NEXT: pushl %ebx
38 ; X86-NEXT: pushl %edi
39 ; X86-NEXT: pushl %esi
40 ; X86-NEXT: andl $-16, %esp
41 ; X86-NEXT: subl $288, %esp # imm = 0x120
42 ; X86-NEXT: movl 12(%ebp), %eax
43 ; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
44 ; X86-NEXT: movl 8(%ebp), %eax
45 ; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
46 ; X86-NEXT: movl 20(%ebp), %eax
47 ; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
48 ; X86-NEXT: movl 16(%ebp), %eax
49 ; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
50 ; X86-NEXT: movl 28(%ebp), %eax
51 ; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
52 ; X86-NEXT: movl 24(%ebp), %eax
53 ; X86-NEXT: movl %eax, {{[0-9]+}}(%esp)
54 ; X86-NEXT: leal {{[0-9]+}}(%esp), %ebx
55 ; X86-NEXT: movl $34, %ecx
56 ; X86-NEXT: movl %esp, %edi
57 ; X86-NEXT: movl %ebx, %esi
58 ; X86-NEXT: rep;movsl (%esi), %es:(%edi)
59 ; X86-NEXT: calll f@PLT
60 ; X86-NEXT: movl $34, %ecx
61 ; X86-NEXT: movl %esp, %edi
62 ; X86-NEXT: movl %ebx, %esi
63 ; X86-NEXT: rep;movsl (%esi), %es:(%edi)
64 ; X86-NEXT: calll f@PLT
65 ; X86-NEXT: leal -12(%ebp), %esp
72 %d = alloca %struct.s, align 16
73 %tmp = getelementptr %struct.s, %struct.s* %d, i32 0, i32 0
74 store i64 %a, i64* %tmp, align 16
75 %tmp2 = getelementptr %struct.s, %struct.s* %d, i32 0, i32 1
76 store i64 %b, i64* %tmp2, align 16
77 %tmp4 = getelementptr %struct.s, %struct.s* %d, i32 0, i32 2
78 store i64 %c, i64* %tmp4, align 16
79 call void @f(%struct.s* byval(%struct.s) %d)
80 call void @f(%struct.s* byval(%struct.s) %d)
84 declare void @f(%struct.s* byval(%struct.s))