1
- ; RUN: sed -e "s/RETTYPE/void/;s/RETVAL//" %s | llc -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck --check-prefixes=ALL,SSE,VOID %s
2
- ; RUN: sed -e "s/RETTYPE/i32/;s/RETVAL/undef/" %s | llc -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck --check-prefixes=ALL,SSE,INT %s
3
- ; RUN: sed -e "s/RETTYPE/\{i64\,i64\}/;s/RETVAL/undef/" %s | llc -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck --check-prefixes=ALL,SSE,INT128 %s
4
- ;
5
- ; RUN: sed -e "s/RETTYPE/void/;s/RETVAL//" %s | llc -mtriple=x86_64-apple-darwin -mcpu=corei7-avx | FileCheck --check-prefixes=ALL,AVX,VOID %s
6
- ; RUN: sed -e "s/RETTYPE/i32/;s/RETVAL/undef/" %s | llc -mtriple=x86_64-apple-darwin -mcpu=corei7-avx | FileCheck --check-prefixes=ALL,AVX,INT %s
7
- ; RUN: sed -e "s/RETTYPE/\{i64\,i64\}/;s/RETVAL/undef/" %s | llc -mtriple=x86_64-apple-darwin -mcpu=corei7-avx | FileCheck --check-prefixes=ALL,AVX,INT128 %s
1
+ ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck --check-prefix=SSE %s
2
+ ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx | FileCheck --check-prefix=AVX %s
8
3
9
- define preserve_allcc RETTYPE @preserve_allcc1 () nounwind {
4
+ define preserve_allcc void @preserve_allcc1 () nounwind {
10
5
entry:
11
- ;ALL-LABEL: preserve_allcc1
12
- ;ALL: pushq %r10
13
- ;ALL-NEXT: pushq %r9
14
- ;ALL-NEXT: pushq %r8
15
- ;ALL-NEXT: pushq %rdi
16
- ;ALL-NEXT: pushq %rsi
17
- ;VOID-NEXT: pushq %rdx
18
- ;INT-NEXT: pushq %rdx
19
- ;INT128-NOT: pushq %rdx
20
- ;ALL-NEXT: pushq %rcx
21
- ;VOID-NEXT: pushq %rax
22
- ;INT-NOT: pushq %rax
23
- ;INT128-NOT: pushq %rax
24
- ;ALL-NEXT: pushq %rbp
25
- ;ALL-NEXT: pushq %r15
26
- ;ALL-NEXT: pushq %r14
27
- ;ALL-NEXT: pushq %r13
28
- ;ALL-NEXT: pushq %r12
29
- ;ALL-NEXT: pushq %rbx
30
- ;SSE: movaps %xmm15
31
- ;SSE-NEXT: movaps %xmm14
32
- ;SSE-NEXT: movaps %xmm13
33
- ;SSE-NEXT: movaps %xmm12
34
- ;SSE-NEXT: movaps %xmm11
35
- ;SSE-NEXT: movaps %xmm10
36
- ;SSE-NEXT: movaps %xmm9
37
- ;SSE-NEXT: movaps %xmm8
38
- ;SSE-NEXT: movaps %xmm7
39
- ;SSE-NEXT: movaps %xmm6
40
- ;SSE-NEXT: movaps %xmm5
41
- ;SSE-NEXT: movaps %xmm4
42
- ;SSE-NEXT: movaps %xmm3
43
- ;SSE-NEXT: movaps %xmm2
44
- ;SSE-NEXT: movaps %xmm1
45
- ;SSE-NEXT: movaps %xmm0
46
- ;AVX: vmovups %ymm15
47
- ;AVX-NEXT: vmovups %ymm14
48
- ;AVX-NEXT: vmovups %ymm13
49
- ;AVX-NEXT: vmovups %ymm12
50
- ;AVX-NEXT: vmovups %ymm11
51
- ;AVX-NEXT: vmovups %ymm10
52
- ;AVX-NEXT: vmovups %ymm9
53
- ;AVX-NEXT: vmovups %ymm8
54
- ;AVX-NEXT: vmovups %ymm7
55
- ;AVX-NEXT: vmovups %ymm6
56
- ;AVX-NEXT: vmovups %ymm5
57
- ;AVX-NEXT: vmovups %ymm4
58
- ;AVX-NEXT: vmovups %ymm3
59
- ;AVX-NEXT: vmovups %ymm2
60
- ;AVX-NEXT: vmovups %ymm1
61
- ;AVX-NEXT: vmovups %ymm0
62
- ;SSE: movaps {{.*}} %xmm0
63
- ;SSE-NEXT: movaps {{.*}} %xmm1
64
- ;SSE-NEXT: movaps {{.*}} %xmm2
65
- ;SSE-NEXT: movaps {{.*}} %xmm3
66
- ;SSE-NEXT: movaps {{.*}} %xmm4
67
- ;SSE-NEXT: movaps {{.*}} %xmm5
68
- ;SSE-NEXT: movaps {{.*}} %xmm6
69
- ;SSE-NEXT: movaps {{.*}} %xmm7
70
- ;SSE-NEXT: movaps {{.*}} %xmm8
71
- ;SSE-NEXT: movaps {{.*}} %xmm9
72
- ;SSE-NEXT: movaps {{.*}} %xmm10
73
- ;SSE-NEXT: movaps {{.*}} %xmm11
74
- ;SSE-NEXT: movaps {{.*}} %xmm12
75
- ;SSE-NEXT: movaps {{.*}} %xmm13
76
- ;SSE-NEXT: movaps {{.*}} %xmm14
77
- ;SSE-NEXT: movaps {{.*}} %xmm15
78
- ;AVX: vmovups {{.*}} %ymm0
79
- ;AVX-NEXT: vmovups {{.*}} %ymm1
80
- ;AVX-NEXT: vmovups {{.*}} %ymm2
81
- ;AVX-NEXT: vmovups {{.*}} %ymm3
82
- ;AVX-NEXT: vmovups {{.*}} %ymm4
83
- ;AVX-NEXT: vmovups {{.*}} %ymm5
84
- ;AVX-NEXT: vmovups {{.*}} %ymm6
85
- ;AVX-NEXT: vmovups {{.*}} %ymm7
86
- ;AVX-NEXT: vmovups {{.*}} %ymm8
87
- ;AVX-NEXT: vmovups {{.*}} %ymm9
88
- ;AVX-NEXT: vmovups {{.*}} %ymm10
89
- ;AVX-NEXT: vmovups {{.*}} %ymm11
90
- ;AVX-NEXT: vmovups {{.*}} %ymm12
91
- ;AVX-NEXT: vmovups {{.*}} %ymm13
92
- ;AVX-NEXT: vmovups {{.*}} %ymm14
93
- ;AVX-NEXT: vmovups {{.*}} %ymm15
94
- ;ALL: popq %rbx
95
- ;ALL-NEXT: popq %r12
96
- ;ALL-NEXT: popq %r13
97
- ;ALL-NEXT: popq %r14
98
- ;ALL-NEXT: popq %r15
99
- ;ALL-NEXT: popq %rbp
100
- ;VOID-NEXT: popq %rax
101
- ;INT-NOT: popq %rax
102
- ;INT128-NOT: popq %rax
103
- ;ALL-NEXT: popq %rcx
104
- ;VOID-NEXT: popq %rdx
105
- ;INT-NEXT: popq %rdx
106
- ;INT128-NOT: popq %rdx
107
- ;ALL-NEXT: popq %rsi
108
- ;ALL-NEXT: popq %rdi
109
- ;ALL-NEXT: popq %r8
110
- ;ALL-NEXT: popq %r9
111
- ;ALL-NEXT: popq %r10
6
+ ;SSE-LABEL: preserve_allcc1
7
+ ;SSE: pushq %r10
8
+ ;SSE-NEXT: pushq %r9
9
+ ;SSE-NEXT: pushq %r8
10
+ ;SSE-NEXT: pushq %rdi
11
+ ;SSE-NEXT: pushq %rsi
12
+ ;SSE-NEXT: pushq %rdx
13
+ ;SSE-NEXT: pushq %rcx
14
+ ;SSE-NEXT: pushq %rax
15
+ ;SSE-NEXT: pushq %rbp
16
+ ;SSE-NEXT: pushq %r15
17
+ ;SSE-NEXT: pushq %r14
18
+ ;SSE-NEXT: pushq %r13
19
+ ;SSE-NEXT: pushq %r12
20
+ ;SSE-NEXT: pushq %rbx
21
+ ;SSE: movaps %xmm15
22
+ ;SSE-NEXT: movaps %xmm14
23
+ ;SSE-NEXT: movaps %xmm13
24
+ ;SSE-NEXT: movaps %xmm12
25
+ ;SSE-NEXT: movaps %xmm11
26
+ ;SSE-NEXT: movaps %xmm10
27
+ ;SSE-NEXT: movaps %xmm9
28
+ ;SSE-NEXT: movaps %xmm8
29
+ ;SSE-NEXT: movaps %xmm7
30
+ ;SSE-NEXT: movaps %xmm6
31
+ ;SSE-NEXT: movaps %xmm5
32
+ ;SSE-NEXT: movaps %xmm4
33
+ ;SSE-NEXT: movaps %xmm3
34
+ ;SSE-NEXT: movaps %xmm2
35
+ ;SSE-NEXT: movaps %xmm1
36
+ ;SSE-NEXT: movaps %xmm0
37
+ ;AVX-LABEL: preserve_allcc1
38
+ ;AVX: pushq %r10
39
+ ;AVX-NEXT: pushq %r9
40
+ ;AVX-NEXT: pushq %r8
41
+ ;AVX-NEXT: pushq %rdi
42
+ ;AVX-NEXT: pushq %rsi
43
+ ;AVX-NEXT: pushq %rdx
44
+ ;AVX-NEXT: pushq %rcx
45
+ ;AVX-NEXT: pushq %rax
46
+ ;AVX-NEXT: pushq %rbp
47
+ ;AVX-NEXT: pushq %r15
48
+ ;AVX-NEXT: pushq %r14
49
+ ;AVX-NEXT: pushq %r13
50
+ ;AVX-NEXT: pushq %r12
51
+ ;AVX-NEXT: pushq %rbx
52
+ ;AVX: vmovups %ymm15
53
+ ;AVX-NEXT: vmovups %ymm14
54
+ ;AVX-NEXT: vmovups %ymm13
55
+ ;AVX-NEXT: vmovups %ymm12
56
+ ;AVX-NEXT: vmovups %ymm11
57
+ ;AVX-NEXT: vmovups %ymm10
58
+ ;AVX-NEXT: vmovups %ymm9
59
+ ;AVX-NEXT: vmovups %ymm8
60
+ ;AVX-NEXT: vmovups %ymm7
61
+ ;AVX-NEXT: vmovups %ymm6
62
+ ;AVX-NEXT: vmovups %ymm5
63
+ ;AVX-NEXT: vmovups %ymm4
64
+ ;AVX-NEXT: vmovups %ymm3
65
+ ;AVX-NEXT: vmovups %ymm2
66
+ ;AVX-NEXT: vmovups %ymm1
67
+ ;AVX-NEXT: vmovups %ymm0
112
68
call void asm sideeffect "" , "~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{rbp},~{xmm0},~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15}" ()
113
- ret RETTYPE RETVAL
69
+ ret void
114
70
}
115
71
116
- ; Make sure R11 and return registers are saved before the call
117
- declare preserve_allcc RETTYPE @bar (i64 , i64 , double , double )
72
+ ; Make sure only R11 is saved before the call
73
+ declare preserve_allcc void @bar (i64 , i64 , double , double )
118
74
define void @preserve_allcc2 () nounwind {
119
75
entry:
120
- ;ALL-LABEL: preserve_allcc2
121
- ;VOID-NOT: movq %rax, [[REG1:%[a-z0-9]+]]
122
- ;INT: movq %rax, [[REG1:%[a-z0-9]+]]
123
- ;INT128: movq %rax, [[REG1:%[a-z0-9]+]]
124
- ;VOID-NOT: movq %rdx, [[REG2:%[a-z0-9]+]]
125
- ;INT-NOT: movq %rdx, [[REG2:%[a-z0-9]+]]
126
- ;INT128: movq %rdx, [[REG2:%[a-z0-9]+]]
127
- ;ALL: movq %r11, [[REG3:%[a-z0-9]+]]
128
- ;ALL-NOT: movaps %xmm
129
- ;VOID-NOT: movq {{.*}}, %rax
130
- ;INT: movq [[REG1]], %rax
131
- ;INT128: movq [[REG1]], %rax
132
- ;VOID-NOT: movq {{.*}}, %rdx
133
- ;INT-NOT: movq {{.*}}, %rdx
134
- ;INT128: movq [[REG2]], %rdx
135
- ;ALL: movq [[REG3]], %r11
76
+ ;SSE-LABEL: preserve_allcc2
77
+ ;SSE: movq %r11, [[REG:%[a-z0-9]+]]
78
+ ;SSE-NOT: movaps %xmm
79
+ ;SSE: movq [[REG]], %r11
136
80
%a0 = call i64 asm sideeffect "" , "={rax}" () nounwind
137
81
%a1 = call i64 asm sideeffect "" , "={rcx}" () nounwind
138
82
%a2 = call i64 asm sideeffect "" , "={rdx}" () nounwind
@@ -154,7 +98,7 @@ entry:
154
98
%a21 = call <2 x double > asm sideeffect "" , "={xmm13}" () nounwind
155
99
%a22 = call <2 x double > asm sideeffect "" , "={xmm14}" () nounwind
156
100
%a23 = call <2 x double > asm sideeffect "" , "={xmm15}" () nounwind
157
- call preserve_allcc RETTYPE @bar (i64 1 , i64 2 , double 3 .0 , double 4 .0 )
101
+ call preserve_allcc void @bar (i64 1 , i64 2 , double 3 .0 , double 4 .0 )
158
102
call void asm sideeffect "" , "{rax},{rcx},{rdx},{r8},{r9},{r10},{r11},{xmm2},{xmm3},{xmm4},{xmm5},{xmm6},{xmm7},{xmm8},{xmm9},{xmm10},{xmm11},{xmm12},{xmm13},{xmm14},{xmm15}" (i64 %a0 , i64 %a1 , i64 %a2 , i64 %a3 , i64 %a4 , i64 %a5 , i64 %a6 , <2 x double > %a10 , <2 x double > %a11 , <2 x double > %a12 , <2 x double > %a13 , <2 x double > %a14 , <2 x double > %a15 , <2 x double > %a16 , <2 x double > %a17 , <2 x double > %a18 , <2 x double > %a19 , <2 x double > %a20 , <2 x double > %a21 , <2 x double > %a22 , <2 x double > %a23 )
159
103
ret void
160
104
}
0 commit comments