2011-06-02-CritSwitch.ll 832 B

12345678910111213141516171819202122232425262728
  1. ; RUN: opt -loop-unswitch -disable-output < %s
  2. ; PR10031
  3. define i32 @test(i32 %command) {
  4. entry:
  5. br label %tailrecurse
  6. tailrecurse: ; preds = %if.then14, %tailrecurse, %entry
  7. br i1 undef, label %if.then, label %tailrecurse
  8. if.then: ; preds = %tailrecurse
  9. switch i32 %command, label %sw.bb [
  10. i32 2, label %land.lhs.true
  11. i32 0, label %land.lhs.true
  12. ]
  13. land.lhs.true: ; preds = %if.then, %if.then
  14. br i1 undef, label %sw.bb, label %if.then14
  15. if.then14: ; preds = %land.lhs.true
  16. switch i32 %command, label %tailrecurse [
  17. i32 0, label %sw.bb
  18. i32 1, label %sw.bb
  19. ]
  20. sw.bb: ; preds = %if.then14
  21. unreachable
  22. }