llvm.org GIT mirror llvm / 410b9a9
[X86] Add tests to show that the DAG combine for OR of shuffles with zero vectors doesn't handle undefs as well as it could. Fix coming in another commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274471 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 4 years ago
1 changed file(s) with 28 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
390390 %or = or <4 x i32> %shuf1, %shuf2
391391 ret <4 x i32> %or
392392 }
393
394 ; Make sure we can have an undef where an index pointing to the zero vector should be
395
396 define <4 x i32> @test2e(<4 x i32> %a, <4 x i32> %b) {
397 ; CHECK-LABEL: test2e:
398 ; CHECK: # BB#0:
399 ; CHECK-NEXT: pxor %xmm2, %xmm2
400 ; CHECK-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1],xmm2[2,3],xmm0[4,5,6,7]
401 ; CHECK-NEXT: movq {{.*#+}} xmm1 = xmm1[0],zero
402 ; CHECK-NEXT: por %xmm1, %xmm0
403 ; CHECK-NEXT: retq
404 %shuf1 = shufflevector <4 x i32> %a, <4 x i32> , <4 x i32>
405 %shuf2 = shufflevector <4 x i32> %b, <4 x i32> , <4 x i32>
406 %or = or <4 x i32> %shuf1, %shuf2
407 ret <4 x i32> %or
408 }
409
410 define <4 x i32> @test2f(<4 x i32> %a, <4 x i32> %b) {
411 ; CHECK-LABEL: test2f:
412 ; CHECK: # BB#0:
413 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[3,1,2,3]
414 ; CHECK-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1],xmm1[2,3],xmm0[4,5,6,7]
415 ; CHECK-NEXT: retq
416 %shuf1 = shufflevector <4 x i32> %a, <4 x i32> , <4 x i32>
417 %shuf2 = shufflevector <4 x i32> %b, <4 x i32> , <4 x i32>
418 %or = or <4 x i32> %shuf1, %shuf2
419 ret <4 x i32> %or
420 }