Use REs to remove dependencies on the register allocation order.
[oota-llvm.git] / test / CodeGen / ARM / machine-cse-cmp.ll
1 ; RUN: llc < %s -march=arm | FileCheck %s
2 ;rdar://8003725
3
4 @G1 = external global i32
5 @G2 = external global i32
6
7 define i32 @f1(i32 %cond1, i32 %x1, i32 %x2, i32 %x3) {
8 entry:
9 ; CHECK: cmp
10 ; CHECK: moveq
11 ; CHECK-NOT: cmp
12 ; CHECK: moveq
13     %tmp1 = icmp eq i32 %cond1, 0
14     %tmp2 = select i1 %tmp1, i32 %x1, i32 %x2
15     %tmp3 = select i1 %tmp1, i32 %x2, i32 %x3
16     %tmp4 = add i32 %tmp2, %tmp3
17     ret i32 %tmp4
18 }