split-store.ll
7.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=x86_64-unknown-unknown -force-split-store < %s | FileCheck %s
define void @int32_float_pair(i32 %tmp1, float %tmp2, i64* %ref.tmp) {
; CHECK-LABEL: int32_float_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: movl %edi, (%rsi)
; CHECK-NEXT: movss %xmm0, 4(%rsi)
; CHECK-NEXT: retq
%t0 = bitcast float %tmp2 to i32
%t1 = zext i32 %t0 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i32 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, i64* %ref.tmp, align 8
ret void
}
define void @float_int32_pair(float %tmp1, i32 %tmp2, i64* %ref.tmp) {
; CHECK-LABEL: float_int32_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: movss %xmm0, (%rsi)
; CHECK-NEXT: movl %edi, 4(%rsi)
; CHECK-NEXT: retq
%t0 = bitcast float %tmp1 to i32
%t1 = zext i32 %tmp2 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i32 %t0 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, i64* %ref.tmp, align 8
ret void
}
define void @int16_float_pair(i16 signext %tmp1, float %tmp2, i64* %ref.tmp) {
; CHECK-LABEL: int16_float_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: movzwl %di, %eax
; CHECK-NEXT: movl %eax, (%rsi)
; CHECK-NEXT: movss %xmm0, 4(%rsi)
; CHECK-NEXT: retq
%t0 = bitcast float %tmp2 to i32
%t1 = zext i32 %t0 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i16 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, i64* %ref.tmp, align 8
ret void
}
define void @int8_float_pair(i8 signext %tmp1, float %tmp2, i64* %ref.tmp) {
; CHECK-LABEL: int8_float_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: movzbl %dil, %eax
; CHECK-NEXT: movl %eax, (%rsi)
; CHECK-NEXT: movss %xmm0, 4(%rsi)
; CHECK-NEXT: retq
%t0 = bitcast float %tmp2 to i32
%t1 = zext i32 %t0 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i8 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, i64* %ref.tmp, align 8
ret void
}
define void @int32_int32_pair(i32 %tmp1, i32 %tmp2, i64* %ref.tmp) {
; CHECK-LABEL: int32_int32_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: movl %edi, (%rdx)
; CHECK-NEXT: movl %esi, 4(%rdx)
; CHECK-NEXT: retq
%t1 = zext i32 %tmp2 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i32 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, i64* %ref.tmp, align 8
ret void
}
define void @int16_int16_pair(i16 signext %tmp1, i16 signext %tmp2, i32* %ref.tmp) {
; CHECK-LABEL: int16_int16_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: movw %di, (%rdx)
; CHECK-NEXT: movw %si, 2(%rdx)
; CHECK-NEXT: retq
%t1 = zext i16 %tmp2 to i32
%t2 = shl nuw i32 %t1, 16
%t3 = zext i16 %tmp1 to i32
%t4 = or i32 %t2, %t3
store i32 %t4, i32* %ref.tmp, align 4
ret void
}
define void @int8_int8_pair(i8 signext %tmp1, i8 signext %tmp2, i16* %ref.tmp) {
; CHECK-LABEL: int8_int8_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: movb %dil, (%rdx)
; CHECK-NEXT: movb %sil, 1(%rdx)
; CHECK-NEXT: retq
%t1 = zext i8 %tmp2 to i16
%t2 = shl nuw i16 %t1, 8
%t3 = zext i8 %tmp1 to i16
%t4 = or i16 %t2, %t3
store i16 %t4, i16* %ref.tmp, align 2
ret void
}
define void @int31_int31_pair(i31 %tmp1, i31 %tmp2, i64* %ref.tmp) {
; CHECK-LABEL: int31_int31_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: andl $2147483647, %edi # imm = 0x7FFFFFFF
; CHECK-NEXT: movl %edi, (%rdx)
; CHECK-NEXT: andl $2147483647, %esi # imm = 0x7FFFFFFF
; CHECK-NEXT: movl %esi, 4(%rdx)
; CHECK-NEXT: retq
%t1 = zext i31 %tmp2 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i31 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, i64* %ref.tmp, align 8
ret void
}
define void @int31_int17_pair(i31 %tmp1, i17 %tmp2, i64* %ref.tmp) {
; CHECK-LABEL: int31_int17_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: andl $2147483647, %edi # imm = 0x7FFFFFFF
; CHECK-NEXT: movl %edi, (%rdx)
; CHECK-NEXT: andl $131071, %esi # imm = 0x1FFFF
; CHECK-NEXT: movl %esi, 4(%rdx)
; CHECK-NEXT: retq
%t1 = zext i17 %tmp2 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i31 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, i64* %ref.tmp, align 8
ret void
}
define void @int7_int3_pair(i7 signext %tmp1, i3 signext %tmp2, i16* %ref.tmp) {
; CHECK-LABEL: int7_int3_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: andb $127, %dil
; CHECK-NEXT: movb %dil, (%rdx)
; CHECK-NEXT: andb $7, %sil
; CHECK-NEXT: movb %sil, 1(%rdx)
; CHECK-NEXT: retq
%t1 = zext i3 %tmp2 to i16
%t2 = shl nuw i16 %t1, 8
%t3 = zext i7 %tmp1 to i16
%t4 = or i16 %t2, %t3
store i16 %t4, i16* %ref.tmp, align 2
ret void
}
define void @int24_int24_pair(i24 signext %tmp1, i24 signext %tmp2, i48* %ref.tmp) {
; CHECK-LABEL: int24_int24_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: movw %di, (%rdx)
; CHECK-NEXT: shrl $16, %edi
; CHECK-NEXT: movb %dil, 2(%rdx)
; CHECK-NEXT: movw %si, 4(%rdx)
; CHECK-NEXT: shrl $16, %esi
; CHECK-NEXT: movb %sil, 6(%rdx)
; CHECK-NEXT: retq
%t1 = zext i24 %tmp2 to i48
%t2 = shl nuw i48 %t1, 24
%t3 = zext i24 %tmp1 to i48
%t4 = or i48 %t2, %t3
store i48 %t4, i48* %ref.tmp, align 2
ret void
}
; getTypeSizeInBits(i12) != getTypeStoreSizeInBits(i12), so store split doesn't kick in.
define void @int12_int12_pair(i12 signext %tmp1, i12 signext %tmp2, i24* %ref.tmp) {
; CHECK-LABEL: int12_int12_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: movl %esi, %eax
; CHECK-NEXT: shll $12, %eax
; CHECK-NEXT: andl $4095, %edi # imm = 0xFFF
; CHECK-NEXT: orl %eax, %edi
; CHECK-NEXT: shrl $4, %esi
; CHECK-NEXT: movb %sil, 2(%rdx)
; CHECK-NEXT: movw %di, (%rdx)
; CHECK-NEXT: retq
%t1 = zext i12 %tmp2 to i24
%t2 = shl nuw i24 %t1, 12
%t3 = zext i12 %tmp1 to i24
%t4 = or i24 %t2, %t3
store i24 %t4, i24* %ref.tmp, align 2
ret void
}
; getTypeSizeInBits(i14) != getTypeStoreSizeInBits(i14), so store split doesn't kick in.
define void @int7_int7_pair(i7 signext %tmp1, i7 signext %tmp2, i14* %ref.tmp) {
; CHECK-LABEL: int7_int7_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: shll $7, %esi
; CHECK-NEXT: andl $127, %edi
; CHECK-NEXT: orl %esi, %edi
; CHECK-NEXT: andl $16383, %edi # imm = 0x3FFF
; CHECK-NEXT: movw %di, (%rdx)
; CHECK-NEXT: retq
%t1 = zext i7 %tmp2 to i14
%t2 = shl nuw i14 %t1, 7
%t3 = zext i7 %tmp1 to i14
%t4 = or i14 %t2, %t3
store i14 %t4, i14* %ref.tmp, align 2
ret void
}
; getTypeSizeInBits(i2) != getTypeStoreSizeInBits(i2), so store split doesn't kick in.
define void @int1_int1_pair(i1 signext %tmp1, i1 signext %tmp2, i2* %ref.tmp) {
; CHECK-LABEL: int1_int1_pair:
; CHECK: # %bb.0:
; CHECK-NEXT: addb %sil, %sil
; CHECK-NEXT: subb %dil, %sil
; CHECK-NEXT: andb $3, %sil
; CHECK-NEXT: movb %sil, (%rdx)
; CHECK-NEXT: retq
%t1 = zext i1 %tmp2 to i2
%t2 = shl nuw i2 %t1, 1
%t3 = zext i1 %tmp1 to i2
%t4 = or i2 %t2, %t3
store i2 %t4, i2* %ref.tmp, align 1
ret void
}
define void @mbb_int32_float_pair(i32 %tmp1, float %tmp2, i64* %ref.tmp) {
; CHECK-LABEL: mbb_int32_float_pair:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %edi, (%rsi)
; CHECK-NEXT: movss %xmm0, 4(%rsi)
; CHECK-NEXT: retq
entry:
%t0 = bitcast float %tmp2 to i32
br label %next
next:
%t1 = zext i32 %t0 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i32 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, i64* %ref.tmp, align 8
ret void
}
define void @mbb_int32_float_multi_stores(i32 %tmp1, float %tmp2, i64* %ref.tmp, i64* %ref.tmp1, i1 %cmp) {
; CHECK-LABEL: mbb_int32_float_multi_stores:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %edi, (%rsi)
; CHECK-NEXT: movss %xmm0, 4(%rsi)
; CHECK-NEXT: testb $1, %cl
; CHECK-NEXT: je .LBB15_2
; CHECK-NEXT: # %bb.1: # %bb2
; CHECK-NEXT: movl %edi, (%rdx)
; CHECK-NEXT: movss %xmm0, 4(%rdx)
; CHECK-NEXT: .LBB15_2: # %exitbb
; CHECK-NEXT: retq
entry:
%t0 = bitcast float %tmp2 to i32
br label %bb1
bb1:
%t1 = zext i32 %t0 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i32 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, i64* %ref.tmp, align 8
br i1 %cmp, label %bb2, label %exitbb
bb2:
store i64 %t4, i64* %ref.tmp1, align 8
br label %exitbb
exitbb:
ret void
}