From: Simon Pilgrim Date: Thu, 17 Jan 2019 11:20:23 +0000 (+0000) Subject: [X86][SSE] Add PR40340 test case X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f22ff9cc9364bc9f515a6c017935fab7b83080e0;p=llvm [X86][SSE] Add PR40340 test case git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351430 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/X86/insertps-combine.ll b/test/CodeGen/X86/insertps-combine.ll index ab3f10046d6..12773b61557 100644 --- a/test/CodeGen/X86/insertps-combine.ll +++ b/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