diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-16 22:35:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-16 22:35:06 +0000 |
commit | afac7dad216d38676ca0e9909d5a4e7588410b64 (patch) | |
tree | e6dc46988cd3cba40fa4cd091fe5ace2a59822d2 /llvm/test/CodeGen/X86/vec_ss_load_fold.ll | |
parent | 0062f7bf599993d5766c70d6cf56476a4e8166b1 (diff) | |
download | bcm5719-llvm-afac7dad216d38676ca0e9909d5a4e7588410b64.tar.gz bcm5719-llvm-afac7dad216d38676ca0e9909d5a4e7588410b64.zip |
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.
llvm-svn: 96408
Diffstat (limited to 'llvm/test/CodeGen/X86/vec_ss_load_fold.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/vec_ss_load_fold.ll | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/vec_ss_load_fold.ll b/llvm/test/CodeGen/X86/vec_ss_load_fold.ll index 42831f00225..a44e08dc84a 100644 --- a/llvm/test/CodeGen/X86/vec_ss_load_fold.ll +++ b/llvm/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 |