blob: 42f215281a8b5dea37053674d5d094d785326b2e [file] [log] [blame]
Dan Gohmanfce288f2009-09-09 00:09:15 +00001; RUN: llc < %s -march=ppc32 | grep bl.*baz | count 2
2; RUN: llc < %s -march=ppc32 | grep bl.*quux | count 2
3; RUN: llc < %s -march=ppc32 -enable-tail-merge | grep bl.*baz | count 1
4; RUN: llc < %s -march=ppc32 -enable-tail-merge=1 | grep bl.*quux | count 1
Dale Johannesen7e07b302007-05-22 17:19:23 +00005; Check that tail merging is not the default on ppc, and that -enable-tail-merge works.
6
7; ModuleID = 'tail.c'
8target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
9target triple = "i686-apple-darwin8"
10
11define i32 @f(i32 %i, i32 %q) {
12entry:
13 %i_addr = alloca i32 ; <i32*> [#uses=2]
14 %q_addr = alloca i32 ; <i32*> [#uses=2]
15 %retval = alloca i32, align 4 ; <i32*> [#uses=1]
16 "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
17 store i32 %i, i32* %i_addr
18 store i32 %q, i32* %q_addr
19 %tmp = load i32* %i_addr ; <i32> [#uses=1]
20 %tmp1 = icmp ne i32 %tmp, 0 ; <i1> [#uses=1]
21 %tmp12 = zext i1 %tmp1 to i8 ; <i8> [#uses=1]
22 %toBool = icmp ne i8 %tmp12, 0 ; <i1> [#uses=1]
23 br i1 %toBool, label %cond_true, label %cond_false
24
25cond_true: ; preds = %entry
26 %tmp3 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
27 %tmp4 = call i32 (...)* @baz( i32 5, i32 6 ) ; <i32> [#uses=0]
28 %tmp7 = load i32* %q_addr ; <i32> [#uses=1]
29 %tmp8 = icmp ne i32 %tmp7, 0 ; <i1> [#uses=1]
30 %tmp89 = zext i1 %tmp8 to i8 ; <i8> [#uses=1]
31 %toBool10 = icmp ne i8 %tmp89, 0 ; <i1> [#uses=1]
32 br i1 %toBool10, label %cond_true11, label %cond_false15
33
34cond_false: ; preds = %entry
35 %tmp5 = call i32 (...)* @foo( ) ; <i32> [#uses=0]
36 %tmp6 = call i32 (...)* @baz( i32 5, i32 6 ) ; <i32> [#uses=0]
37 %tmp27 = load i32* %q_addr ; <i32> [#uses=1]
38 %tmp28 = icmp ne i32 %tmp27, 0 ; <i1> [#uses=1]
39 %tmp289 = zext i1 %tmp28 to i8 ; <i8> [#uses=1]
40 %toBool210 = icmp ne i8 %tmp289, 0 ; <i1> [#uses=1]
41 br i1 %toBool210, label %cond_true11, label %cond_false15
42
43cond_true11: ; preds = %cond_next
44 %tmp13 = call i32 (...)* @foo( ) ; <i32> [#uses=0]
45 %tmp14 = call i32 (...)* @quux( i32 3, i32 4 ) ; <i32> [#uses=0]
46 br label %cond_next18
47
48cond_false15: ; preds = %cond_next
49 %tmp16 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
50 %tmp17 = call i32 (...)* @quux( i32 3, i32 4 ) ; <i32> [#uses=0]
51 br label %cond_next18
52
53cond_next18: ; preds = %cond_false15, %cond_true11
54 %tmp19 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
55 br label %return
56
57return: ; preds = %cond_next18
58 %retval20 = load i32* %retval ; <i32> [#uses=1]
59 ret i32 %retval20
60}
61
62declare i32 @bar(...)
63
64declare i32 @baz(...)
65
66declare i32 @foo(...)
67
68declare i32 @quux(...)