llvm.org GIT mirror llvm / fe386c4
When tail duplicating these functions, the add instruction should not be duplicated, even though the block it is in is duplicated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16757 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 ; RUN: llvm-as < %s | opt -tailduplicate | llvm-dis | grep add | not grep uses=1
1
2 int %test1(bool %C, int %A, int* %P) {
3 entry:
4 br bool %C, label %L1, label %L2
5
6 L1:
7 store int 1, int* %P
8 br label %L2
9
10 L2:
11 %X = add int %A, 17
12 ret int %X
13 }
14
15 int %test2(bool %C, int %A, int* %P) {
16 entry:
17 br bool %C, label %L1, label %L2
18
19 L1:
20 store int 1, int* %P
21 br label %L3
22
23 L2:
24 store int 7, int* %P
25 br label %L3
26 L3:
27 %X = add int %A, 17
28 ret int %X
29 }
30