cf040.ll 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ; RUN: %opt-exe %s -simplifycfg -loop-simplify -reg2mem -scopenested -scopenestinfo -analyze -S | %FileCheck %s
  2. ; CHECK: ScopeNestInfo:
  3. ; CHECK: @TopLevel_Begin
  4. ; CHECK: entry
  5. ; CHECK: @If_Begin
  6. ; CHECK: entry.loop0.exit_crit_edge
  7. ; CHECK: @If_Else
  8. ; CHECK: loop0.latch.preheader
  9. ; CHECK: @Loop_Begin
  10. ; CHECK: loop0.latch
  11. ; CHECK: @If_Begin
  12. ; CHECK: dx.LoopExitHelper
  13. ; CHECK: @Loop_Break
  14. ; CHECK: @If_Else
  15. ; CHECK: dx.LoopContinue
  16. ; CHECK: @Loop_Continue
  17. ; CHECK: @If_End
  18. ; CHECK: loop0.latch.loop0.latch_crit_edge
  19. ; CHECK: @Loop_End
  20. ; CHECK: dx.LoopExit
  21. ; CHECK: loop0.exit.loopexit
  22. ; CHECK: @If_End
  23. ; CHECK: dx.EndIfScope
  24. ; CHECK: loop0.exit
  25. ; CHECK: @TopLevel_End
  26. define i32 @main(i1 %c1, i1 %c2, i1 %c3, i32 %i1, i32 %i2) {
  27. entry:
  28. %res = alloca i32
  29. store i32 %i1, i32 *%res
  30. br label %if0
  31. if0:
  32. br i1 %c1, label %loop0, label %loop0.exit
  33. loop0:
  34. %0 = load i32, i32 *%res
  35. %1 = icmp eq i32 %0, 20
  36. br i1 %1, label %loop0.exit, label %loop0.latch
  37. loop0.latch:
  38. store i32 %i2, i32 *%res
  39. br label %loop0
  40. loop0.exit:
  41. %2 = load i32, i32 *%res
  42. ret i32 %2
  43. }