2003-04-25-PHIPostDominateProblem.ll 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. ; THis testcase caused an assertion failure because a PHI node did not have
  2. ; entries for it's postdominator. But I think this can only happen when the
  3. ; PHI node is dead, so we just avoid patching up dead PHI nodes.
  4. ; RUN: opt < %s -adce
  5. target datalayout = "e-p:32:32"
  6. define void @dead_test8() {
  7. entry:
  8. br label %loopentry
  9. loopentry: ; preds = %endif, %entry
  10. %k.1 = phi i32 [ %k.0, %endif ], [ 0, %entry ] ; <i32> [#uses=1]
  11. br i1 false, label %no_exit, label %return
  12. no_exit: ; preds = %loopentry
  13. br i1 false, label %then, label %else
  14. then: ; preds = %no_exit
  15. br label %endif
  16. else: ; preds = %no_exit
  17. %dec = add i32 %k.1, -1 ; <i32> [#uses=1]
  18. br label %endif
  19. endif: ; preds = %else, %then
  20. %k.0 = phi i32 [ %dec, %else ], [ 0, %then ] ; <i32> [#uses=1]
  21. store i32 2, i32* null
  22. br label %loopentry
  23. return: ; preds = %loopentry
  24. ret void
  25. }