From 178f8cba51062330afa626a459c8f58c30848b33 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Mon, 10 Aug 2015 20:34:34 +0000 Subject: [PATCH] [x86, SSE]]add missing tests for load folding with partial register update The minsize case is wrong; that will be fixed in the next commit. llvm-svn: 244498 --- llvm/test/CodeGen/X86/sse_partial_update.ll | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/llvm/test/CodeGen/X86/sse_partial_update.ll b/llvm/test/CodeGen/X86/sse_partial_update.ll index 377c3b7..8bc44e2 100644 --- a/llvm/test/CodeGen/X86/sse_partial_update.ll +++ b/llvm/test/CodeGen/X86/sse_partial_update.ll @@ -90,3 +90,37 @@ entry: declare void @callee2(float, float) declare <2 x double> @llvm.x86.sse2.sqrt.sd(<2 x double>) nounwind readnone +define <2 x double> @load_fold_cvtss2sd_int(<4 x float> *%a) { +; CHECK-LABEL: load_fold_cvtss2sd_int: +; CHECK: movaps (%rdi), %xmm1 +; CHECK-NEXT: xorps %xmm0, %xmm0 +; CHECK-NEXT: cvtss2sd %xmm1, %xmm0 +; CHECK-NEXT: retq + %ld = load <4 x float>, <4 x float> *%a + %x = call <2 x double> @llvm.x86.sse2.cvtss2sd(<2 x double> , <4 x float> %ld) + ret <2 x double> %x +} + +define <2 x double> @load_fold_cvtss2sd_int_optsize(<4 x float> *%a) optsize { +; CHECK-LABEL: load_fold_cvtss2sd_int_optsize: +; CHECK: xorps %xmm0, %xmm0 +; CHECK-NEXT: cvtss2sd (%rdi), %xmm0 +; CHECK-NEXT: retq + %ld = load <4 x float>, <4 x float> *%a + %x = call <2 x double> @llvm.x86.sse2.cvtss2sd(<2 x double> , <4 x float> %ld) + ret <2 x double> %x +} + +define <2 x double> @load_fold_cvtss2sd_int_minsize(<4 x float> *%a) minsize { +; CHECK-LABEL: load_fold_cvtss2sd_int_minsize: +; CHECK: movaps (%rdi), %xmm1 +; CHECK-NEXT: xorps %xmm0, %xmm0 +; CHECK-NEXT: cvtss2sd %xmm1, %xmm0 +; CHECK-NEXT: retq + %ld = load <4 x float>, <4 x float> *%a + %x = call <2 x double> @llvm.x86.sse2.cvtss2sd(<2 x double> , <4 x float> %ld) + ret <2 x double> %x +} + +declare <2 x double> @llvm.x86.sse2.cvtss2sd(<2 x double>, <4 x float>) nounwind readnone + -- 2.7.4