1 ; Test that the inliner doesn't leave around dead allocas, and that it folds
2 ; uncond branches away after it is done specializing.
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \
5 ; RUN: not grep {alloca.*uses=0}
6 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \
7 ; RUN: not grep {br label}
9 %A = weak global int 0 ; <int*> [#uses=1]
10 %B = weak global int 0 ; <int*> [#uses=1]
11 %C = weak global int 0 ; <int*> [#uses=1]
13 implementation ; Functions:
15 internal fastcc void %foo(int %X) {
17 %ALL = alloca int, align 4 ; <int*> [#uses=1]
18 %tmp1 = and int %X, 1 ; <int> [#uses=1]
19 %tmp1 = seteq int %tmp1, 0 ; <bool> [#uses=1]
20 br bool %tmp1, label %cond_next, label %cond_true
22 cond_true: ; preds = %entry
26 cond_next: ; preds = %entry, %cond_true
27 %tmp4 = and int %X, 2 ; <int> [#uses=1]
28 %tmp4 = seteq int %tmp4, 0 ; <bool> [#uses=1]
29 br bool %tmp4, label %cond_next7, label %cond_true5
31 cond_true5: ; preds = %cond_next
35 cond_next7: ; preds = %cond_next, %cond_true5
36 %tmp10 = and int %X, 4 ; <int> [#uses=1]
37 %tmp10 = seteq int %tmp10, 0 ; <bool> [#uses=1]
38 br bool %tmp10, label %cond_next13, label %cond_true11
40 cond_true11: ; preds = %cond_next7
44 cond_next13: ; preds = %cond_next7, %cond_true11
45 %tmp16 = and int %X, 8 ; <int> [#uses=1]
46 %tmp16 = seteq int %tmp16, 0 ; <bool> [#uses=1]
47 br bool %tmp16, label %UnifiedReturnBlock, label %cond_true17
49 cond_true17: ; preds = %cond_next13
50 call void %ext( int* %ALL )
53 UnifiedReturnBlock: ; preds = %cond_next13
57 declare void %ext(int*)
61 tail call fastcc void %foo( int 1 )
62 tail call fastcc void %foo( int 2 )
63 tail call fastcc void %foo( int 3 )
64 tail call fastcc void %foo( int 8 )