From 62240d65fd9836a87a938bd4ab53d89fc69c3798 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 4 Mar 2008 00:47:45 +0000 Subject: [PATCH] Add PR1501 test case. llvm-svn: 47874 --- llvm/test/CodeGen/X86/coalescer-commute4.ll | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 llvm/test/CodeGen/X86/coalescer-commute4.ll diff --git a/llvm/test/CodeGen/X86/coalescer-commute4.ll b/llvm/test/CodeGen/X86/coalescer-commute4.ll new file mode 100644 index 000000000000..219c11c45e1b --- /dev/null +++ b/llvm/test/CodeGen/X86/coalescer-commute4.ll @@ -0,0 +1,30 @@ +d; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -mattr=+sse2 | not grep movaps +; PR1501 + +efine float @foo(i32* %x, float* %y, i32 %c) nounwind { +entry: + %tmp2132 = icmp eq i32 %c, 0 ; [#uses=2] + br i1 %tmp2132, label %bb23, label %bb.preheader + +bb.preheader: ; preds = %entry + %umax = select i1 %tmp2132, i32 1, i32 %c ; [#uses=1] + br label %bb + +bb: ; preds = %bb, %bb.preheader + %i.0.reg2mem.0 = phi i32 [ 0, %bb.preheader ], [ %indvar.next, %bb ] ; [#uses=3] + %res.0.reg2mem.0 = phi float [ 0.000000e+00, %bb.preheader ], [ %tmp14, %bb ] ; [#uses=1] + %tmp3 = getelementptr i32* %x, i32 %i.0.reg2mem.0 ; [#uses=1] + %tmp4 = load i32* %tmp3, align 4 ; [#uses=1] + %tmp45 = sitofp i32 %tmp4 to float ; [#uses=1] + %tmp8 = getelementptr float* %y, i32 %i.0.reg2mem.0 ; [#uses=1] + %tmp9 = load float* %tmp8, align 4 ; [#uses=1] + %tmp11 = mul float %tmp9, %tmp45 ; [#uses=1] + %tmp14 = add float %tmp11, %res.0.reg2mem.0 ; [#uses=2] + %indvar.next = add i32 %i.0.reg2mem.0, 1 ; [#uses=2] + %exitcond = icmp eq i32 %indvar.next, %umax ; [#uses=1] + br i1 %exitcond, label %bb23, label %bb + +bb23: ; preds = %bb, %entry + %res.0.reg2mem.1 = phi float [ 0.000000e+00, %entry ], [ %tmp14, %bb ] ; [#uses=1] + ret float %res.0.reg2mem.1 +}