llvm.org GIT mirror llvm / ed7bef5
[X86][AVX] Added zero+blend vs vperm2f128 optsize tests cases (PR22984) We should be trying to use vperm2f128 instead of zero+blend (if we're only the user of zero?) when optsize is enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266632 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 4 years ago
1 changed file(s) with 69 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
265265 ;; Test zero mask generation.
266266 ;; PR22984: https://llvm.org/bugs/show_bug.cgi?id=22984
267267 ;; Prefer xor+vblendpd over vperm2f128 because that has better performance.
268 ;; TODO: When building for optsize we should use vperm2f128.
268269
269270 define <4 x double> @shuffle_v4f64_zz01(<4 x double> %a) {
270271 ; ALL-LABEL: shuffle_v4f64_zz01:
274275 %s = shufflevector <4 x double> %a, <4 x double> , <4 x i32>
275276 ret <4 x double> %s
276277 }
278 define <4 x double> @shuffle_v4f64_zz01_optsize(<4 x double> %a) optsize {
279 ; ALL-LABEL: shuffle_v4f64_zz01_optsize:
280 ; ALL: ## BB#0:
281 ; ALL-NEXT: vperm2f128 {{.*#+}} ymm0 = zero,zero,ymm0[0,1]
282 ; ALL-NEXT: retq
283 %s = shufflevector <4 x double> %a, <4 x double> , <4 x i32>
284 ret <4 x double> %s
285 }
277286
278287 define <4 x double> @shuffle_v4f64_zz23(<4 x double> %a) {
279288 ; ALL-LABEL: shuffle_v4f64_zz23:
284293 %s = shufflevector <4 x double> %a, <4 x double> , <4 x i32>
285294 ret <4 x double> %s
286295 }
296 define <4 x double> @shuffle_v4f64_zz23_optsize(<4 x double> %a) optsize {
297 ; ALL-LABEL: shuffle_v4f64_zz23_optsize:
298 ; ALL: ## BB#0:
299 ; ALL-NEXT: vxorpd %ymm1, %ymm1, %ymm1
300 ; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3]
301 ; ALL-NEXT: retq
302 %s = shufflevector <4 x double> %a, <4 x double> , <4 x i32>
303 ret <4 x double> %s
304 }
287305
288306 define <4 x double> @shuffle_v4f64_zz45(<4 x double> %a) {
289307 ; ALL-LABEL: shuffle_v4f64_zz45:
293311 %s = shufflevector <4 x double> , <4 x double> %a, <4 x i32>
294312 ret <4 x double> %s
295313 }
314 define <4 x double> @shuffle_v4f64_zz45_optsize(<4 x double> %a) optsize {
315 ; ALL-LABEL: shuffle_v4f64_zz45_optsize:
316 ; ALL: ## BB#0:
317 ; ALL-NEXT: vperm2f128 {{.*#+}} ymm0 = zero,zero,ymm0[0,1]
318 ; ALL-NEXT: retq
319 %s = shufflevector <4 x double> , <4 x double> %a, <4 x i32>
320 ret <4 x double> %s
321 }
296322
297323 define <4 x double> @shuffle_v4f64_zz67(<4 x double> %a) {
298324 ; ALL-LABEL: shuffle_v4f64_zz67:
303329 %s = shufflevector <4 x double> , <4 x double> %a, <4 x i32>
304330 ret <4 x double> %s
305331 }
332 define <4 x double> @shuffle_v4f64_zz67_optsize(<4 x double> %a) optsize {
333 ; ALL-LABEL: shuffle_v4f64_zz67_optsize:
334 ; ALL: ## BB#0:
335 ; ALL-NEXT: vxorpd %ymm1, %ymm1, %ymm1
336 ; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3]
337 ; ALL-NEXT: retq
338 %s = shufflevector <4 x double> , <4 x double> %a, <4 x i32>
339 ret <4 x double> %s
340 }
306341
307342 define <4 x double> @shuffle_v4f64_01zz(<4 x double> %a) {
308343 ; ALL-LABEL: shuffle_v4f64_01zz:
313348 %s = shufflevector <4 x double> %a, <4 x double> , <4 x i32>
314349 ret <4 x double> %s
315350 }
351 define <4 x double> @shuffle_v4f64_01zz_optsize(<4 x double> %a) optsize {
352 ; ALL-LABEL: shuffle_v4f64_01zz_optsize:
353 ; ALL: ## BB#0:
354 ; ALL-NEXT: vxorpd %ymm1, %ymm1, %ymm1
355 ; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3]
356 ; ALL-NEXT: retq
357 %s = shufflevector <4 x double> %a, <4 x double> , <4 x i32>
358 ret <4 x double> %s
359 }
316360
317361 define <4 x double> @shuffle_v4f64_23zz(<4 x double> %a) {
318362 ; ALL-LABEL: shuffle_v4f64_23zz:
322366 %s = shufflevector <4 x double> %a, <4 x double> , <4 x i32>
323367 ret <4 x double> %s
324368 }
369 define <4 x double> @shuffle_v4f64_23zz_optsize(<4 x double> %a) optsize {
370 ; ALL-LABEL: shuffle_v4f64_23zz_optsize:
371 ; ALL: ## BB#0:
372 ; ALL-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],zero,zero
373 ; ALL-NEXT: retq
374 %s = shufflevector <4 x double> %a, <4 x double> , <4 x i32>
375 ret <4 x double> %s
376 }
325377
326378 define <4 x double> @shuffle_v4f64_45zz(<4 x double> %a) {
327379 ; ALL-LABEL: shuffle_v4f64_45zz:
332384 %s = shufflevector <4 x double> , <4 x double> %a, <4 x i32>
333385 ret <4 x double> %s
334386 }
387 define <4 x double> @shuffle_v4f64_45zz_optsize(<4 x double> %a) optsize {
388 ; ALL-LABEL: shuffle_v4f64_45zz_optsize:
389 ; ALL: ## BB#0:
390 ; ALL-NEXT: vxorpd %ymm1, %ymm1, %ymm1
391 ; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3]
392 ; ALL-NEXT: retq
393 %s = shufflevector <4 x double> , <4 x double> %a, <4 x i32>
394 ret <4 x double> %s
395 }
335396
336397 define <4 x double> @shuffle_v4f64_67zz(<4 x double> %a) {
337398 ; ALL-LABEL: shuffle_v4f64_67zz:
399 ; ALL: ## BB#0:
400 ; ALL-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],zero,zero
401 ; ALL-NEXT: retq
402 %s = shufflevector <4 x double> , <4 x double> %a, <4 x i32>
403 ret <4 x double> %s
404 }
405 define <4 x double> @shuffle_v4f64_67zz_optsize(<4 x double> %a) optsize {
406 ; ALL-LABEL: shuffle_v4f64_67zz_optsize:
338407 ; ALL: ## BB#0:
339408 ; ALL-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],zero,zero
340409 ; ALL-NEXT: retq