diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-01-17 11:20:23 +0000 | 
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-01-17 11:20:23 +0000 | 
| commit | 6cc9c3cd754080caf05121ac39f7c98d4a4be57b (patch) | |
| tree | 230400a1cf251238b20fc5a4aa82c5aeaea1f33b | |
| parent | 8260bf9db24d6c4b3cafabad4eab9e330a6a4b2f (diff) | |
| download | bcm5719-llvm-6cc9c3cd754080caf05121ac39f7c98d4a4be57b.tar.gz bcm5719-llvm-6cc9c3cd754080caf05121ac39f7c98d4a4be57b.zip  | |
[X86][SSE] Add PR40340 test case
llvm-svn: 351430
| -rw-r--r-- | llvm/test/CodeGen/X86/insertps-combine.ll | 19 | 
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/insertps-combine.ll b/llvm/test/CodeGen/X86/insertps-combine.ll index ab3f10046d6..12773b61557 100644 --- a/llvm/test/CodeGen/X86/insertps-combine.ll +++ b/llvm/test/CodeGen/X86/insertps-combine.ll @@ -298,4 +298,23 @@ define float @extract_lane_insertps_6123(<4 x float> %a0, <4 x float> *%p1) {    ret float %ext  } +; PR40340 +define <4 x float> @commute_load_insertps(<4 x float>, <4 x float>* nocapture readonly) { +; SSE-LABEL: commute_load_insertps: +; SSE:       # %bb.0: +; SSE-NEXT:    movaps (%rdi), %xmm1 +; SSE-NEXT:    insertps {{.*#+}} xmm1 = zero,xmm0[1],zero,xmm1[3] +; SSE-NEXT:    movaps %xmm1, %xmm0 +; SSE-NEXT:    retq +; +; AVX-LABEL: commute_load_insertps: +; AVX:       # %bb.0: +; AVX-NEXT:    vmovaps (%rdi), %xmm1 +; AVX-NEXT:    vinsertps {{.*#+}} xmm0 = zero,xmm0[1],zero,xmm1[3] +; AVX-NEXT:    retq +  %3 = load <4 x float>, <4 x float>* %1 +  %4 = tail call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %3, <4 x float> %0, i8 85) +  ret <4 x float> %4 +} +  declare <4 x float> @llvm.x86.sse41.insertps(<4 x float>, <4 x float>, i8) nounwind readnone  | 

