2003-08-17-BranchFoldOrdering.ll 640 B

123456789101112131415161718192021222324252627
  1. ; This test checks to make sure that 'br X, Dest, Dest' is folded into
  2. ; 'br Dest'. This can only happen after the 'Z' block is eliminated. This is
  3. ; due to the fact that the SimplifyCFG function does not use
  4. ; the ConstantFoldTerminator function.
  5. ; RUN: opt < %s -simplifycfg -S | FileCheck %s
  6. ; CHECK-NOT: br i1 %c2
  7. declare void @noop()
  8. define i32 @test(i1 %c1, i1 %c2) {
  9. call void @noop( )
  10. br i1 %c1, label %A, label %Y
  11. A: ; preds = %0
  12. call void @noop( )
  13. br i1 %c2, label %Z, label %X
  14. Z: ; preds = %A
  15. br label %X
  16. X: ; preds = %Y, %Z, %A
  17. call void @noop( )
  18. ret i32 0
  19. Y: ; preds = %0
  20. call void @noop( )
  21. br label %X
  22. }