cf020.ll 755 B

12345678910111213141516171819202122232425262728293031323334353637
  1. ; RUN: %opt-exe %s -reg2mem -scopenested -scopenestinfo -analyze -S | %FileCheck %s
  2. ; CHECK: ScopeNestInfo:
  3. ; CHECK: @TopLevel_Begin
  4. ; CHECK: entry
  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: exit
  12. ; CHECK: @TopLevel_End
  13. define i32 @main(i1 %c1, i1 %c2, i1 %c3, i32 %i1, i32 %i2) {
  14. entry:
  15. %res = alloca i32
  16. store i32 1, i32 *%res
  17. br i1 %c1, label %if0.T, label %if0.F
  18. if0.T:
  19. %0 = load i32, i32 *%res
  20. store i32 2, i32 *%res
  21. br label %exit
  22. if0.F:
  23. %1 = load i32, i32 *%res
  24. store i32 3, i32 *%res
  25. br label %exit
  26. exit:
  27. %2 = phi i32 [%0, %if0.T], [%1, %if0.F]
  28. %3 = load i32, i32 *%res
  29. %4 = add i32 %2, %3
  30. ret i32 %4
  31. }