llvm.org GIT mirror llvm / e420056
New testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8617 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 16 years ago
1 changed file(s) with 29 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; This function contains two tail calls, which should be eliminated
1 ; RUN: llvm-as < %s | opt -tailcallelim -stats -disable-output 2>&1 | grep '2 tailcallelim'
2
3 int %Ack(int %M.1, int %N.1) {
4 entry:
5 %tmp.1 = seteq int %M.1, 0 ; [#uses=1]
6 br bool %tmp.1, label %then.0, label %endif.0
7
8 then.0:
9 %tmp.4 = add int %N.1, 1 ; [#uses=1]
10 ret int %tmp.4
11
12 endif.0:
13 %tmp.6 = seteq int %N.1, 0 ; [#uses=1]
14 br bool %tmp.6, label %then.1, label %endif.1
15
16 then.1:
17 %tmp.10 = add int %M.1, -1 ; [#uses=1]
18 %tmp.8 = call int %Ack( int %tmp.10, int 1 ) ; [#uses=1]
19 ret int %tmp.8
20
21 endif.1:
22 %tmp.13 = add int %M.1, -1 ; [#uses=1]
23 %tmp.17 = add int %N.1, -1 ; [#uses=1]
24 %tmp.14 = call int %Ack( int %M.1, int %tmp.17 ) ; [#uses=1]
25 %tmp.11 = call int %Ack( int %tmp.13, int %tmp.14 ) ; [#uses=1]
26 ret int %tmp.11
27 }
28