2002-05-23-ZeroArgPHITest.ll 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. ; 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: opt < %s -adce
  8. %node_t = type { double*, %node_t*, %node_t**, double**, double*, i32, i32 }
  9. define void @localize_local(%node_t* %nodelist) {
  10. bb0:
  11. %nodelist.upgrd.1 = alloca %node_t* ; <%node_t**> [#uses=2]
  12. store %node_t* %nodelist, %node_t** %nodelist.upgrd.1
  13. br label %bb1
  14. bb1: ; preds = %bb0
  15. %reg107 = load %node_t*, %node_t** %nodelist.upgrd.1 ; <%node_t*> [#uses=2]
  16. %cond211 = icmp eq %node_t* %reg107, null ; <i1> [#uses=1]
  17. br i1 %cond211, label %bb3, label %bb2
  18. bb2: ; preds = %bb2, %bb1
  19. %reg109 = phi %node_t* [ %reg110, %bb2 ], [ %reg107, %bb1 ] ; <%node_t*> [#uses=1]
  20. %reg212 = getelementptr %node_t, %node_t* %reg109, i64 0, i32 1 ; <%node_t**> [#uses=1]
  21. %reg110 = load %node_t*, %node_t** %reg212 ; <%node_t*> [#uses=2]
  22. %cond213 = icmp ne %node_t* %reg110, null ; <i1> [#uses=1]
  23. br i1 %cond213, label %bb2, label %bb3
  24. bb3: ; preds = %bb2, %bb1
  25. ret void
  26. }