2006-10-19-UncondDiv.ll 976 B

1234567891011121314151617181920212223242526272829
  1. ; PR957
  2. ; RUN: opt < %s -simplifycfg -S | FileCheck %s
  3. ; CHECK-NOT: select
  4. @G = extern_weak global i32
  5. define i32 @test(i32 %tmp) {
  6. cond_false179:
  7. %tmp181 = icmp eq i32 %tmp, 0 ; <i1> [#uses=1]
  8. br i1 %tmp181, label %cond_true182, label %cond_next185
  9. cond_true182: ; preds = %cond_false179
  10. br label %cond_next185
  11. cond_next185: ; preds = %cond_true182, %cond_false179
  12. %d0.3 = phi i32 [ udiv (i32 1, i32 ptrtoint (i32* @G to i32)), %cond_true182 ], [ %tmp, %cond_false179 ] ; <i32> [#uses=1]
  13. ret i32 %d0.3
  14. }
  15. define i32 @test2(i32 %tmp) {
  16. cond_false179:
  17. %tmp181 = icmp eq i32 %tmp, 0 ; <i1> [#uses=1]
  18. br i1 %tmp181, label %cond_true182, label %cond_next185
  19. cond_true182: ; preds = %cond_false179
  20. br label %cond_next185
  21. cond_next185: ; preds = %cond_true182, %cond_false179
  22. %d0.3 = phi i32 [ udiv (i32 1, i32 ptrtoint (i32* @G to i32)), %cond_true182 ], [ %tmp, %cond_false179 ] ; <i32> [#uses=1]
  23. call i32 @test( i32 4 ) ; <i32>:0 [#uses=0]
  24. ret i32 %d0.3
  25. }