summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-10-04 17:59:30 +0000
committerSanjay Patel <spatel@rotateright.com>2018-10-04 17:59:30 +0000
commitf0215d0b2c25a63677a63ffa26df8865d03bc9be (patch)
treeb606a0543945098393106b1511cfc82e98e5906a
parent0e8be67565b960096ea0fbc5d08460a7e54df5d9 (diff)
[x86] add test for SSE sqrtss register dep (PR22206)
-rw-r--r--llvm/test/CodeGen/X86/sse_partial_update.ll61
1 files changed, 33 insertions, 28 deletions
diff --git a/llvm/test/CodeGen/X86/sse_partial_update.ll b/llvm/test/CodeGen/X86/sse_partial_update.ll
index aa4bc99b763..117f81c29f4 100644
--- a/llvm/test/CodeGen/X86/sse_partial_update.ll
+++ b/llvm/test/CodeGen/X86/sse_partial_update.ll
@@ -10,19 +10,17 @@
define void @rsqrtss(<4 x float> %a) nounwind uwtable ssp {
; CHECK-LABEL: rsqrtss:
-; CHECK: ## %bb.0: ## %entry
+; CHECK: ## %bb.0:
; CHECK-NEXT: rsqrtss %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd %xmm0, %xmm2
; CHECK-NEXT: movshdup {{.*#+}} xmm0 = xmm0[1,1,3,3]
; CHECK-NEXT: cvtss2sd %xmm0, %xmm1
; CHECK-NEXT: movaps %xmm2, %xmm0
; CHECK-NEXT: jmp _callee ## TAILCALL
-entry:
-
- %0 = tail call <4 x float> @llvm.x86.sse.rsqrt.ss(<4 x float> %a) nounwind
- %a.addr.0.extract = extractelement <4 x float> %0, i32 0
+ %t0 = tail call <4 x float> @llvm.x86.sse.rsqrt.ss(<4 x float> %a) nounwind
+ %a.addr.0.extract = extractelement <4 x float> %t0, i32 0
%conv = fpext float %a.addr.0.extract to double
- %a.addr.4.extract = extractelement <4 x float> %0, i32 1
+ %a.addr.4.extract = extractelement <4 x float> %t0, i32 1
%conv3 = fpext float %a.addr.4.extract to double
tail call void @callee(double %conv, double %conv3) nounwind
ret void
@@ -32,19 +30,17 @@ declare <4 x float> @llvm.x86.sse.rsqrt.ss(<4 x float>) nounwind readnone
define void @rcpss(<4 x float> %a) nounwind uwtable ssp {
; CHECK-LABEL: rcpss:
-; CHECK: ## %bb.0: ## %entry
+; CHECK: ## %bb.0:
; CHECK-NEXT: rcpss %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd %xmm0, %xmm2
; CHECK-NEXT: movshdup {{.*#+}} xmm0 = xmm0[1,1,3,3]
; CHECK-NEXT: cvtss2sd %xmm0, %xmm1
; CHECK-NEXT: movaps %xmm2, %xmm0
; CHECK-NEXT: jmp _callee ## TAILCALL
-entry:
-
- %0 = tail call <4 x float> @llvm.x86.sse.rcp.ss(<4 x float> %a) nounwind
- %a.addr.0.extract = extractelement <4 x float> %0, i32 0
+ %t0 = tail call <4 x float> @llvm.x86.sse.rcp.ss(<4 x float> %a) nounwind
+ %a.addr.0.extract = extractelement <4 x float> %t0, i32 0
%conv = fpext float %a.addr.0.extract to double
- %a.addr.4.extract = extractelement <4 x float> %0, i32 1
+ %a.addr.4.extract = extractelement <4 x float> %t0, i32 1
%conv3 = fpext float %a.addr.4.extract to double
tail call void @callee(double %conv, double %conv3) nounwind
ret void
@@ -53,7 +49,7 @@ declare <4 x float> @llvm.x86.sse.rcp.ss(<4 x float>) nounwind readnone
define void @sqrtss(<4 x float> %a) nounwind uwtable ssp {
; CHECK-LABEL: sqrtss:
-; CHECK: ## %bb.0: ## %entry
+; CHECK: ## %bb.0:
; CHECK-NEXT: sqrtss %xmm0, %xmm1
; CHECK-NEXT: cvtss2sd %xmm1, %xmm2
; CHECK-NEXT: movshdup {{.*#+}} xmm0 = xmm0[1,1,3,3]
@@ -61,12 +57,10 @@ define void @sqrtss(<4 x float> %a) nounwind uwtable ssp {
; CHECK-NEXT: cvtss2sd %xmm0, %xmm1
; CHECK-NEXT: movaps %xmm2, %xmm0
; CHECK-NEXT: jmp _callee ## TAILCALL
-entry:
-
- %0 = tail call <4 x float> @llvm.x86.sse.sqrt.ss(<4 x float> %a) nounwind
- %a.addr.0.extract = extractelement <4 x float> %0, i32 0
+ %t0 = tail call <4 x float> @llvm.x86.sse.sqrt.ss(<4 x float> %a) nounwind
+ %a.addr.0.extract = extractelement <4 x float> %t0, i32 0
%conv = fpext float %a.addr.0.extract to double
- %a.addr.4.extract = extractelement <4 x float> %0, i32 1
+ %a.addr.4.extract = extractelement <4 x float> %t0, i32 1
%conv3 = fpext float %a.addr.4.extract to double
tail call void @callee(double %conv, double %conv3) nounwind
ret void
@@ -75,7 +69,7 @@ declare <4 x float> @llvm.x86.sse.sqrt.ss(<4 x float>) nounwind readnone
define void @sqrtsd(<2 x double> %a) nounwind uwtable ssp {
; CHECK-LABEL: sqrtsd:
-; CHECK: ## %bb.0: ## %entry
+; CHECK: ## %bb.0:
; CHECK-NEXT: sqrtsd %xmm0, %xmm1
; CHECK-NEXT: cvtsd2ss %xmm1, %xmm2
; CHECK-NEXT: unpckhpd {{.*#+}} xmm0 = xmm0[1,1]
@@ -83,15 +77,13 @@ define void @sqrtsd(<2 x double> %a) nounwind uwtable ssp {
; CHECK-NEXT: cvtsd2ss %xmm0, %xmm1
; CHECK-NEXT: movaps %xmm2, %xmm0
; CHECK-NEXT: jmp _callee2 ## TAILCALL
-entry:
-
- %0 = tail call <2 x double> @llvm.x86.sse2.sqrt.sd(<2 x double> %a) nounwind
- %a0 = extractelement <2 x double> %0, i32 0
- %conv = fptrunc double %a0 to float
- %a1 = extractelement <2 x double> %0, i32 1
- %conv3 = fptrunc double %a1 to float
- tail call void @callee2(float %conv, float %conv3) nounwind
- ret void
+ %t0 = tail call <2 x double> @llvm.x86.sse2.sqrt.sd(<2 x double> %a) nounwind
+ %a0 = extractelement <2 x double> %t0, i32 0
+ %conv = fptrunc double %a0 to float
+ %a1 = extractelement <2 x double> %t0, i32 1
+ %conv3 = fptrunc double %a1 to float
+ tail call void @callee2(float %conv, float %conv3) nounwind
+ ret void
}
declare void @callee2(float, float)
@@ -133,3 +125,16 @@ define <2 x double> @load_fold_cvtss2sd_int_minsize(<4 x float> *%a) minsize {
declare <2 x double> @llvm.x86.sse2.cvtss2sd(<2 x double>, <4 x float>) nounwind readnone
+define float @PR22206(<4 x float> %a) {
+; CHECK-LABEL: PR22206:
+; CHECK: ## %bb.0:
+; CHECK-NEXT: sqrtss %xmm0, %xmm1
+; CHECK-NEXT: addss %xmm1, %xmm0
+; CHECK-NEXT: retq
+ %res = tail call <4 x float> @llvm.x86.sse.sqrt.ss(<4 x float> %a) nounwind
+ %new = extractelement <4 x float> %res, i32 0
+ %orig = extractelement <4 x float> %a, i32 0
+ %add = fadd float %new, %orig
+ ret float %add
+}
+