2002-05-24 00:51:25 +08: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.
|
|
|
|
;
|
2009-09-12 02:01:28 +08:00
|
|
|
; RUN: opt < %s -adce
|
2002-05-24 00:51:25 +08:00
|
|
|
|
2008-03-01 17:15:35 +08:00
|
|
|
%node_t = type { double*, %node_t*, %node_t**, double**, double*, i32, i32 }
|
2002-05-24 00:51:25 +08:00
|
|
|
|
2008-03-01 17:15:35 +08:00
|
|
|
define void @localize_local(%node_t* %nodelist) {
|
|
|
|
bb0:
|
|
|
|
%nodelist.upgrd.1 = alloca %node_t* ; <%node_t**> [#uses=2]
|
|
|
|
store %node_t* %nodelist, %node_t** %nodelist.upgrd.1
|
|
|
|
br label %bb1
|
2002-05-24 00:51:25 +08:00
|
|
|
|
2008-03-01 17:15:35 +08:00
|
|
|
bb1: ; preds = %bb0
|
|
|
|
%reg107 = load %node_t** %nodelist.upgrd.1 ; <%node_t*> [#uses=2]
|
|
|
|
%cond211 = icmp eq %node_t* %reg107, null ; <i1> [#uses=1]
|
|
|
|
br i1 %cond211, label %bb3, label %bb2
|
2002-05-24 00:51:25 +08:00
|
|
|
|
2008-03-01 17:15:35 +08:00
|
|
|
bb2: ; preds = %bb2, %bb1
|
|
|
|
%reg109 = phi %node_t* [ %reg110, %bb2 ], [ %reg107, %bb1 ] ; <%node_t*> [#uses=1]
|
|
|
|
%reg212 = getelementptr %node_t* %reg109, i64 0, i32 1 ; <%node_t**> [#uses=1]
|
|
|
|
%reg110 = load %node_t** %reg212 ; <%node_t*> [#uses=2]
|
|
|
|
%cond213 = icmp ne %node_t* %reg110, null ; <i1> [#uses=1]
|
|
|
|
br i1 %cond213, label %bb2, label %bb3
|
2002-05-24 00:51:25 +08:00
|
|
|
|
2008-03-01 17:15:35 +08:00
|
|
|
bb3: ; preds = %bb2, %bb1
|
|
|
|
ret void
|
2002-05-24 00:51:25 +08:00
|
|
|
}
|
2008-03-01 17:15:35 +08:00
|
|
|
|