[llvm] r280249 - [X86][SSE] Improve awareness of (v)cvtpd2ps implicit zeroing of upper 64-bits of xmm result
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 31 08:09:34 PDT 2016
Author: rksimon
Date: Wed Aug 31 10:09:34 2016
New Revision: 280249
URL: http://llvm.org/viewvc/llvm-project?rev=280249&view=rev
Log:
[X86][SSE] Improve awareness of (v)cvtpd2ps implicit zeroing of upper 64-bits of xmm result
Associate x86_sse2_cvtpd2ps with X86ISD::VFPROUND to avoid inserting unnecessary zeroing shuffles.
Differential Revision: https://reviews.llvm.org/D23797
Modified:
llvm/trunk/lib/Target/X86/X86IntrinsicsInfo.h
llvm/trunk/test/CodeGen/X86/sse2-intrinsics-x86.ll
Modified: llvm/trunk/lib/Target/X86/X86IntrinsicsInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86IntrinsicsInfo.h?rev=280249&r1=280248&r2=280249&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86IntrinsicsInfo.h (original)
+++ llvm/trunk/lib/Target/X86/X86IntrinsicsInfo.h Wed Aug 31 10:09:34 2016
@@ -1884,6 +1884,7 @@ static const IntrinsicData IntrinsicsWi
X86_INTRINSIC_DATA(sse2_comile_sd, COMI, X86ISD::COMI, ISD::SETLE),
X86_INTRINSIC_DATA(sse2_comilt_sd, COMI, X86ISD::COMI, ISD::SETLT),
X86_INTRINSIC_DATA(sse2_comineq_sd, COMI, X86ISD::COMI, ISD::SETNE),
+ X86_INTRINSIC_DATA(sse2_cvtpd2ps, INTR_TYPE_1OP, X86ISD::VFPROUND, 0),
X86_INTRINSIC_DATA(sse2_max_pd, INTR_TYPE_2OP, X86ISD::FMAX, 0),
X86_INTRINSIC_DATA(sse2_min_pd, INTR_TYPE_2OP, X86ISD::FMIN, 0),
X86_INTRINSIC_DATA(sse2_movmsk_pd, INTR_TYPE_1OP, X86ISD::MOVMSK, 0),
Modified: llvm/trunk/test/CodeGen/X86/sse2-intrinsics-x86.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sse2-intrinsics-x86.ll?rev=280249&r1=280248&r2=280249&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/sse2-intrinsics-x86.ll (original)
+++ llvm/trunk/test/CodeGen/X86/sse2-intrinsics-x86.ll Wed Aug 31 10:09:34 2016
@@ -245,19 +245,17 @@ define <4 x float> @test_x86_sse2_cvtpd2
declare <4 x float> @llvm.x86.sse2.cvtpd2ps(<2 x double>) nounwind readnone
define <4 x float> @test_x86_sse2_cvtpd2ps_zext(<2 x double> %a0) nounwind {
-; SSE-LABEL: test_x86_sse2_cvtpd2ps_zext:
-; SSE: ## BB#0:
-; SSE-NEXT: cvtpd2ps %xmm0, %xmm0
-; SSE-NEXT: movq {{.*#+}} xmm0 = xmm0[0],zero
-; SSE-NEXT: retl
-;
-; KNL-LABEL: test_x86_sse2_cvtpd2ps_zext:
-; KNL: ## BB#0:
-; KNL-NEXT: vcvtpd2ps %xmm0, %xmm0
-; KNL-NEXT: vmovq {{.*#+}} xmm0 = xmm0[0],zero
-; KNL-NEXT: retl
- %cvt = call <4 x float> @llvm.x86.sse2.cvtpd2ps(<2 x double> %a0)
- %res = shufflevector <4 x float> %cvt, <4 x float> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
+; SSE-LABEL: test_x86_sse2_cvtpd2ps_zext:
+; SSE: ## BB#0:
+; SSE-NEXT: cvtpd2ps %xmm0, %xmm0
+; SSE-NEXT: retl
+;
+; KNL-LABEL: test_x86_sse2_cvtpd2ps_zext:
+; KNL: ## BB#0:
+; KNL-NEXT: vcvtpd2ps %xmm0, %xmm0
+; KNL-NEXT: retl
+ %cvt = call <4 x float> @llvm.x86.sse2.cvtpd2ps(<2 x double> %a0)
+ %res = shufflevector <4 x float> %cvt, <4 x float> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
ret <4 x float> %res
}
More information about the llvm-commits
mailing list