PhiNoEliminate.ll 1.1 KB

123456789101112131415161718192021222324252627
  1. ; RUN: opt < %s -simplifycfg -S | \
  2. ; RUN: not grep select
  3. ;; The PHI node in this example should not be turned into a select, as we are
  4. ;; not able to ifcvt the entire block. As such, converting to a select just
  5. ;; introduces inefficiency without saving copies.
  6. define i32 @bar(i1 %C) {
  7. entry:
  8. br i1 %C, label %then, label %endif
  9. then: ; preds = %entry
  10. %tmp.3 = call i32 @qux( ) ; <i32> [#uses=0]
  11. br label %endif
  12. endif: ; preds = %then, %entry
  13. %R = phi i32 [ 123, %entry ], [ 12312, %then ] ; <i32> [#uses=1]
  14. ;; stuff to disable tail duplication
  15. call i32 @qux( ) ; <i32>:0 [#uses=0]
  16. call i32 @qux( ) ; <i32>:1 [#uses=0]
  17. call i32 @qux( ) ; <i32>:2 [#uses=0]
  18. call i32 @qux( ) ; <i32>:3 [#uses=0]
  19. call i32 @qux( ) ; <i32>:4 [#uses=0]
  20. call i32 @qux( ) ; <i32>:5 [#uses=0]
  21. call i32 @qux( ) ; <i32>:6 [#uses=0]
  22. ret i32 %R
  23. }
  24. declare i32 @qux()