compare.ll 455 B

123456789101112131415161718192021222324252627282930
  1. ; There should be no phi nodes left.
  2. ; RUN: opt < %s -jump-threading -S | not grep "phi i32"
  3. declare i32 @f1()
  4. declare i32 @f2()
  5. declare void @f3()
  6. define i32 @test(i1 %cond) {
  7. br i1 %cond, label %T1, label %F1
  8. T1:
  9. %v1 = call i32 @f1()
  10. br label %Merge
  11. F1:
  12. %v2 = call i32 @f2()
  13. br label %Merge
  14. Merge:
  15. %B = phi i32 [%v1, %T1], [12, %F1]
  16. %A = icmp ne i32 %B, 42
  17. br i1 %A, label %T2, label %F2
  18. T2:
  19. call void @f3()
  20. ret i32 1
  21. F2:
  22. ret i32 0
  23. }