blob: 5b28804f380fbc736e5e5e0c145d355ca05451b1 [file] [log] [blame]
Dale Johannesenc66cdf72010-06-18 19:00:18 +00001; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \
2; RUN: grep cmpne | count 1
3; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \
4; RUN: grep bhi | count 1
5; Here, tail call wins over eliminating branches. It is 1 fewer instruction
6; and removes all stack accesses, so seems like a win.
7
8define void @foo(i32 %X, i32 %Y) {
9entry:
10 %tmp1 = icmp ult i32 %X, 4 ; <i1> [#uses=1]
11 %tmp4 = icmp eq i32 %Y, 0 ; <i1> [#uses=1]
12 %tmp7 = or i1 %tmp4, %tmp1 ; <i1> [#uses=1]
13 br i1 %tmp7, label %cond_true, label %UnifiedReturnBlock
14
15cond_true: ; preds = %entry
16 %tmp10 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
17 ret void
18
19UnifiedReturnBlock: ; preds = %entry
20 ret void
21}
22
23declare i32 @bar(...)