X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FCodeGen%2FX86%2Fcoalescer-commute2.ll;h=e45437cc9484e844cc24e105ca273867d9acf7c3;hb=faf046c6c0a561e966f4ac671392c4b8e15c35a2;hp=f90ab9e3d5eef247778055eef7a9801bbb682f4c;hpb=b2e72b0febae8b58e752c96ae3b1ac38eb9559f6;p=oota-llvm.git diff --git a/test/CodeGen/X86/coalescer-commute2.ll b/test/CodeGen/X86/coalescer-commute2.ll index f90ab9e3d5e..e45437cc948 100644 --- a/test/CodeGen/X86/coalescer-commute2.ll +++ b/test/CodeGen/X86/coalescer-commute2.ll @@ -1,21 +1,28 @@ -; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -mattr=+sse2 -coalescer-commute-instrs | grep movsd | count 4 +; RUN: llc < %s -mtriple=x86_64-linux -mcpu=nehalem | FileCheck %s +; CHECK-NOT: mov +; CHECK: paddw +; CHECK-NOT: mov +; CHECK: paddw +; CHECK-NOT: paddw +; CHECK-NOT: mov -define i32 @main(i32 %argc, i8** %argv) nounwind { -entry: - br label %bb145.us.i.i +; The 2-addr pass should ensure that identical code is produced for these functions +; no extra copy should be generated. -bb145.us.i.i: ; preds = %bb145.us.i.i, %entry - %seed.3.reg2mem.0.us.i.i = phi double [ 0.000000e+00, %entry ], [ %tmp9.i.us.i.i, %bb145.us.i.i ] ; [#uses=1] - %tmp2.i13.us.i.i = mul double %seed.3.reg2mem.0.us.i.i, 1.680700e+04 ; [#uses=1] - %tmp3.i.us.i.i = add double %tmp2.i13.us.i.i, 1.000000e+00 ; [#uses=1] - %tmp6.i15.us.i.i = call double @floor( double 0.000000e+00 ) nounwind readnone ; [#uses=1] - %tmp7.i16.us.i.i = mul double %tmp6.i15.us.i.i, 0xC1DFFFFFFFC00000 ; [#uses=1] - %tmp9.i.us.i.i = add double %tmp7.i16.us.i.i, %tmp3.i.us.i.i ; [#uses=2] - %tmp5.i12.us.i.i = mul double %tmp9.i.us.i.i, 2.000000e+00 ; [#uses=1] - %tmp6.i.us.i.i = fdiv double %tmp5.i12.us.i.i, 0x41DFFFFFFFC00000 ; [#uses=1] - %tmp8.i.us.i.i = add double %tmp6.i.us.i.i, -1.000000e+00 ; [#uses=1] - store double %tmp8.i.us.i.i, double* null, align 8 - br label %bb145.us.i.i +define <2 x i64> @test1(<2 x i64> %x, <2 x i64> %y) nounwind { +entry: + %tmp6 = bitcast <2 x i64> %y to <8 x i16> ; <<8 x i16>> [#uses=1] + %tmp8 = bitcast <2 x i64> %x to <8 x i16> ; <<8 x i16>> [#uses=1] + %tmp9 = add <8 x i16> %tmp8, %tmp6 ; <<8 x i16>> [#uses=1] + %tmp10 = bitcast <8 x i16> %tmp9 to <2 x i64> ; <<2 x i64>> [#uses=1] + ret <2 x i64> %tmp10 } -declare double @floor(double) nounwind readnone +define <2 x i64> @test2(<2 x i64> %x, <2 x i64> %y) nounwind { +entry: + %tmp6 = bitcast <2 x i64> %x to <8 x i16> ; <<8 x i16>> [#uses=1] + %tmp8 = bitcast <2 x i64> %y to <8 x i16> ; <<8 x i16>> [#uses=1] + %tmp9 = add <8 x i16> %tmp8, %tmp6 ; <<8 x i16>> [#uses=1] + %tmp10 = bitcast <8 x i16> %tmp9 to <2 x i64> ; <<2 x i64>> [#uses=1] + ret <2 x i64> %tmp10 +}