Add missing register forms of instructions to the ARM CMP-folding code. This
[oota-llvm.git] / test / CodeGen / ARM / 2011-04-15-RegisterCmpPeephole.ll
1 ; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 | FileCheck %s
2
3 ; CHECK: _f
4 ; CHECK: adds
5 ; CHECK-NOT: cmp
6 ; CHECK: blxeq _g
7
8 define i32 @f(i32 %a, i32 %b) nounwind ssp {
9 entry:
10   %add = add nsw i32 %b, %a
11   %cmp = icmp eq i32 %add, 0
12   br i1 %cmp, label %if.then, label %if.end
13
14 if.then:                                          ; preds = %entry
15   tail call void (...)* @g(i32 %a, i32 %b) nounwind
16   br label %if.end
17
18 if.end:                                           ; preds = %if.then, %entry
19   ret i32 %add
20 }
21
22 declare void @g(...)