PhiBlockMerge2.ll 568 B

123456789101112131415161718192021222324252627
  1. ; Test merging of blocks that only have PHI nodes in them. This tests the case
  2. ; where the mergedinto block doesn't have any PHI nodes, and is in fact
  3. ; dominated by the block-to-be-eliminated
  4. ;
  5. ; RUN: opt < %s -simplifycfg -S | not grep N:
  6. ;
  7. declare i1 @foo()
  8. define i32 @test(i1 %a, i1 %b) {
  9. %c = call i1 @foo()
  10. br i1 %c, label %N, label %P
  11. P:
  12. %d = call i1 @foo()
  13. br i1 %d, label %N, label %Q
  14. Q:
  15. br label %N
  16. N:
  17. %W = phi i32 [0, %0], [1, %Q], [2, %P]
  18. ; This block should be foldable into M
  19. br label %M
  20. M:
  21. %R = add i32 %W, 1
  22. ret i32 %R
  23. }