Disable machine copy propagation for now. It's known to be buggy (PR11940) and introd...
[oota-llvm.git] / test / CodeGen / X86 / machine-cp.ll
1 ; RUN: llc -mtriple=x86_64-apple-macosx -mcpu=nocona < %s -disable-copyprop=false | FileCheck %s
2
3 ; After tail duplication, two copies in an early exit BB can be cancelled out.
4 ; rdar://10640363
5 define i32 @t1(i32 %a, i32 %b) nounwind  {
6 entry:
7 ; CHECK: t1:
8 ; CHECK: jne
9   %cmp1 = icmp eq i32 %b, 0
10   br i1 %cmp1, label %while.end, label %while.body
11
12 ; CHECK: BB
13 ; CHECK-NOT: mov
14 ; CHECK: ret
15
16 while.body:                                       ; preds = %entry, %while.body
17   %a.addr.03 = phi i32 [ %b.addr.02, %while.body ], [ %a, %entry ]
18   %b.addr.02 = phi i32 [ %rem, %while.body ], [ %b, %entry ]
19   %rem = srem i32 %a.addr.03, %b.addr.02
20   %cmp = icmp eq i32 %rem, 0
21   br i1 %cmp, label %while.end, label %while.body
22
23 while.end:                                        ; preds = %while.body, %entry
24   %a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.02, %while.body ]
25   ret i32 %a.addr.0.lcssa
26 }
27
28 ; Two movdqa (from phi-elimination) in the entry BB cancels out.
29 ; rdar://10428165
30 define <8 x i16> @t2(<8 x i16> %T0, <8 x i16> %T1) nounwind readnone {
31 entry:
32 ; CHECK: t2:
33 ; CHECK-NOT: movdqa
34   %tmp8 = shufflevector <8 x i16> %T0, <8 x i16> %T1, <8 x i32> < i32 undef, i32 undef, i32 7, i32 2, i32 8, i32 undef, i32 undef , i32 undef >
35   ret <8 x i16> %tmp8
36 }