llvm.org GIT mirror llvm / bb9fc2c
New testcase that is not actually handled yet, but should be in the future. This is here to remind me to get back to this after a while. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10336 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 15 years ago
1 changed file(s) with 31 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; This testcase is due to tail-duplication not wanting to copy the return
1 ; instruction into the terminating blocks because there was other code
2 ; optimized out of the function after the taildup happened.
3
4 ; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call
5
6 int %t4(int %a) {
7 entry:
8 %tmp.1 = and int %a, 1
9 %tmp.2 = cast int %tmp.1 to bool
10 br bool %tmp.2, label %then.0, label %else.0
11
12 then.0:
13 %tmp.5 = add int %a, -1
14 %tmp.3 = call int %t4( int %tmp.5 )
15 br label %return
16
17 else.0:
18 %tmp.7 = setne int %a, 0
19 br bool %tmp.7, label %then.1, label %return
20
21 then.1:
22 %tmp.11 = add int %a, -2
23 %tmp.9 = call int %t4( int %tmp.11 )
24 br label %return
25
26 return:
27 %result.0 = phi int [ 0, %else.0 ], [ %tmp.3, %then.0 ], [ %tmp.9, %then.1 ]
28 ret int %result.0
29 }
30