[llvm] r244498 - [x86, SSE]]add missing tests for load folding with partial register update

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 13:34:35 PDT 2015


Author: spatel
Date: Mon Aug 10 15:34:34 2015
New Revision: 244498

URL: http://llvm.org/viewvc/llvm-project?rev=244498&view=rev
Log:
[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.

Modified:
    llvm/trunk/test/CodeGen/X86/sse_partial_update.ll

Modified: llvm/trunk/test/CodeGen/X86/sse_partial_update.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sse_partial_update.ll?rev=244498&r1=244497&r2=244498&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/sse_partial_update.ll (original)
+++ llvm/trunk/test/CodeGen/X86/sse_partial_update.ll Mon Aug 10 15:34:34 2015
@@ -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> <double 0x0, double 0x0>, <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> <double 0x0, double 0x0>, <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> <double 0x0, double 0x0>, <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
+




More information about the llvm-commits mailing list