cf042.ll 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ; RUN: %opt-exe %s -scopenested -scopenestinfo -analyze -S | %FileCheck %s
  2. ; CHECK: ScopeNestInfo:
  3. ; CHECK: @TopLevel_Begin
  4. ; CHECK: if0
  5. ; CHECK: @If_Begin
  6. ; CHECK: if0.T
  7. ; CHECK: @If_Else
  8. ; CHECK: if0.F
  9. ; CHECK: @If_End
  10. ; CHECK: dx.EndIfScope
  11. ; CHECK: if0.end
  12. ; CHECK: @Loop_Begin
  13. ; CHECK: loop0
  14. ; CHECK: @If_Begin
  15. ; CHECK: dx.LoopExitHelper.3
  16. ; CHECK: @Loop_Break
  17. ; CHECK: @If_Else
  18. ; CHECK: loop0.latch
  19. ; CHECK: dx.LoopContinue.4
  20. ; CHECK: @Loop_Continue
  21. ; CHECK: @If_End
  22. ; CHECK: dx.LoopLatch.1
  23. ; CHECK: @Loop_End
  24. ; CHECK: dx.LoopExit.2
  25. ; CHECK: loop0.exit
  26. ; CHECK: @Loop_Begin
  27. ; CHECK: loop1
  28. ; CHECK: @If_Begin
  29. ; CHECK: dx.LoopExitHelper
  30. ; CHECK: @Loop_Break
  31. ; CHECK: @If_Else
  32. ; CHECK: loop1.latch
  33. ; CHECK: dx.LoopContinue
  34. ; CHECK: @Loop_Continue
  35. ; CHECK: @If_End
  36. ; CHECK: dx.LoopLatch
  37. ; CHECK: @Loop_End
  38. ; CHECK: dx.LoopExit
  39. ; CHECK: loop1.exit
  40. ; CHECK: @TopLevel_End
  41. define i32 @main(i1 %c1, i1 %c2, i1 %c3, i32 %i1, i32 %i2) {
  42. if0:
  43. %res = alloca i32
  44. store i32 %i1, i32 *%res
  45. br i1 %c1, label %if0.T, label %if0.F
  46. if0.T:
  47. store i32 2, i32 *%res
  48. br label %if0.end
  49. if0.F:
  50. store i32 7, i32 *%res
  51. br label %if0.end
  52. if0.end:
  53. %if.0 = load i32, i32 *%res
  54. %if.1 = mul i32 %if.0, 3
  55. store i32 %if.1, i32 *%res
  56. br label %loop0
  57. loop0:
  58. %0 = load i32, i32 *%res
  59. %1 = icmp eq i32 %0, 20
  60. br i1 %1, label %loop0.exit, label %loop0.latch
  61. loop0.latch:
  62. store i32 %i2, i32 *%res
  63. br label %loop0
  64. loop0.exit:
  65. %2 = load i32, i32 *%res
  66. %3 = add i32 %2, 33
  67. store i32 %3, i32 *%res
  68. br label %loop1
  69. loop1:
  70. %l1.0 = load i32, i32 *%res
  71. %l1.1 = icmp eq i32 %l1.0, 20
  72. br i1 %l1.1, label %loop1.exit, label %loop1.latch
  73. loop1.latch:
  74. store i32 %i2, i32 *%res
  75. br label %loop1
  76. loop1.exit:
  77. %l1.2 = load i32, i32 *%res
  78. ret i32 %l1.2
  79. }