2002-05-23 18:51:25 +02:00
|
|
|
; This testcase contains a entire loop that should be removed. The only thing
|
|
|
|
; left is the store instruction in BB0. The problem this testcase was running
|
|
|
|
; into was that when the reg109 PHI was getting zero predecessors, it was
|
|
|
|
; removed even though there were uses still around. Now the uses are filled
|
|
|
|
; in with a dummy value before the PHI is deleted.
|
|
|
|
;
|
2006-12-02 05:23:10 +01:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -adce
|
2002-05-23 18:51:25 +02:00
|
|
|
|
|
|
|
%node_t = type { double*, %node_t*, %node_t**, double**, double*, int, int }
|
|
|
|
|
|
|
|
implementation ; Functions:
|
|
|
|
|
|
|
|
void %localize_local(%node_t* %nodelist) {
|
|
|
|
bb0: ;[#uses=0]
|
|
|
|
%nodelist = alloca %node_t* ; <%node_t**> [#uses=2]
|
|
|
|
store %node_t* %nodelist, %node_t** %nodelist
|
|
|
|
br label %bb1
|
|
|
|
|
|
|
|
bb1: ;[#uses=2]
|
2002-08-22 18:39:04 +02:00
|
|
|
%reg107 = load %node_t** %nodelist ; <%node_t*> [#uses=2]
|
2002-05-23 18:51:25 +02:00
|
|
|
%cond211 = seteq %node_t* %reg107, null ; <bool> [#uses=1]
|
|
|
|
br bool %cond211, label %bb3, label %bb2
|
|
|
|
|
|
|
|
bb2: ;[#uses=3]
|
|
|
|
%reg109 = phi %node_t* [ %reg110, %bb2 ], [ %reg107, %bb1 ] ; <%node_t*> [#uses=1]
|
2006-11-23 16:14:52 +01:00
|
|
|
%reg212 = getelementptr %node_t* %reg109, long 0, uint 1 ; <%node_t**> [#uses=1]
|
2002-05-23 18:51:25 +02:00
|
|
|
%reg110 = load %node_t** %reg212 ; <%node_t*> [#uses=2]
|
|
|
|
%cond213 = setne %node_t* %reg110, null ; <bool> [#uses=1]
|
|
|
|
br bool %cond213, label %bb2, label %bb3
|
|
|
|
|
|
|
|
bb3: ;[#uses=2]
|
|
|
|
ret void
|
|
|
|
}
|