summaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-16 22:35:06 +0000
committerChris Lattner <sabre@nondot.org>2010-02-16 22:35:06 +0000
commit92d3ada814f33e3e1d10f0e5e3a15333b0cca849 (patch)
treecdda73fc41184e35406bebc258a7cb2c3dff6f6c /test/CodeGen
parent55f9adf543156f918bebcab3924d4210099e20af (diff)
downloadexternal_llvm-92d3ada814f33e3e1d10f0e5e3a15333b0cca849.zip
external_llvm-92d3ada814f33e3e1d10f0e5e3a15333b0cca849.tar.gz
external_llvm-92d3ada814f33e3e1d10f0e5e3a15333b0cca849.tar.bz2
fix rdar://7653908, a crash on a case where we would fold a load
into a roundss intrinsic, producing a cyclic dag. The root cause of this is badness handling ComplexPattern nodes in the old dagisel that I noticed through inspection. Eliminate a copy of the of the code that handled ComplexPatterns by making EmitChildMatchCode call into EmitMatchCode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/vec_ss_load_fold.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGen/X86/vec_ss_load_fold.ll b/test/CodeGen/X86/vec_ss_load_fold.ll
index 42831f0..a44e08d 100644
--- a/test/CodeGen/X86/vec_ss_load_fold.ll
+++ b/test/CodeGen/X86/vec_ss_load_fold.ll
@@ -45,3 +45,28 @@ declare <4 x float> @llvm.x86.sse.min.ss(<4 x float>, <4 x float>)
declare <4 x float> @llvm.x86.sse.max.ss(<4 x float>, <4 x float>)
declare i32 @llvm.x86.sse.cvttss2si(<4 x float>)
+
+
+declare <4 x float> @llvm.x86.sse41.round.ss(<4 x float>, <4 x float>, i32)
+declare <4 x float> @f()
+
+define <4 x float> @test3(<4 x float> %A, float *%b, i32 %C) nounwind {
+ %a = load float *%b
+ %B = insertelement <4 x float> undef, float %a, i32 0
+ %X = call <4 x float> @llvm.x86.sse41.round.ss(<4 x float> %A, <4 x float> %B, i32 4)
+ ret <4 x float> %X
+; CHECK: test3:
+; CHECK: roundss $4, (%eax), %xmm0
+}
+
+define <4 x float> @test4(<4 x float> %A, float *%b, i32 %C) nounwind {
+ %a = load float *%b
+ %B = insertelement <4 x float> undef, float %a, i32 0
+ %q = call <4 x float> @f()
+ %X = call <4 x float> @llvm.x86.sse41.round.ss(<4 x float> %q, <4 x float> %B, i32 4)
+ ret <4 x float> %X
+; CHECK: test4:
+; CHECK: movss (%eax), %xmm
+; CHECK: call
+; CHECK: roundss $4, %xmm{{.*}}, %xmm0
+} \ No newline at end of file