blob: 999675b55af41d1425739870b8edf9243ad1aaff [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; This testcase contains a entire loop that should be removed. The only thing
2; left is the store instruction in BB0. The problem this testcase was running
3; into was that when the reg109 PHI was getting zero predecessors, it was
4; removed even though there were uses still around. Now the uses are filled
5; in with a dummy value before the PHI is deleted.
6;
7; RUN: llvm-upgrade < %s | llvm-as | opt -adce
8
9%node_t = type { double*, %node_t*, %node_t**, double**, double*, int, int }
10
11implementation ; Functions:
12
13void %localize_local(%node_t* %nodelist) {
14bb0: ;[#uses=0]
15 %nodelist = alloca %node_t* ; <%node_t**> [#uses=2]
16 store %node_t* %nodelist, %node_t** %nodelist
17 br label %bb1
18
19bb1: ;[#uses=2]
20 %reg107 = load %node_t** %nodelist ; <%node_t*> [#uses=2]
21 %cond211 = seteq %node_t* %reg107, null ; <bool> [#uses=1]
22 br bool %cond211, label %bb3, label %bb2
23
24bb2: ;[#uses=3]
25 %reg109 = phi %node_t* [ %reg110, %bb2 ], [ %reg107, %bb1 ] ; <%node_t*> [#uses=1]
26 %reg212 = getelementptr %node_t* %reg109, long 0, uint 1 ; <%node_t**> [#uses=1]
27 %reg110 = load %node_t** %reg212 ; <%node_t*> [#uses=2]
28 %cond213 = setne %node_t* %reg110, null ; <bool> [#uses=1]
29 br bool %cond213, label %bb2, label %bb3
30
31bb3: ;[#uses=2]
32 ret void
33}