degenerate-phi.ll 550 B

123456789101112131415161718192021222324
  1. ; RUN: opt -jump-threading -disable-output < %s
  2. ; PR9112
  3. ; This is actually a test for value tracking. Jump threading produces
  4. ; "%phi = phi i16" when it removes all edges leading to %unreachable.
  5. ; The .ll parser won't let us write that directly since it's invalid code.
  6. define void @func() nounwind {
  7. entry:
  8. br label %bb
  9. bb:
  10. br label %bb
  11. unreachable:
  12. %phi = phi i16 [ %add, %unreachable ], [ 0, %next ]
  13. %add = add i16 0, %phi
  14. %cmp = icmp slt i16 %phi, 0
  15. br i1 %cmp, label %unreachable, label %next
  16. next:
  17. br label %unreachable
  18. }