2007-07-26-InterlockingLoops.ll 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. ; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
  2. @last = external global [65 x i32*]
  3. define i32 @NextRootMove(i32 %wtm, i32 %x, i32 %y, i32 %z) {
  4. entry:
  5. %A = alloca i32*
  6. %tmp17618 = load i32*, i32** getelementptr ([65 x i32*], [65 x i32*]* @last, i32 0, i32 1), align 4
  7. store i32* %tmp17618, i32** %A
  8. ; CHECK: entry:
  9. ; CHECK-NEXT: alloca i32
  10. ; CHECK-NEXT: %tmp17618 = load
  11. ; CHECK-NOT: load
  12. ; CHECK-NOT: phi
  13. br label %cond_true116
  14. cond_true116:
  15. %cmp = icmp eq i32 %x, %y
  16. br i1 %cmp, label %cond_true128, label %cond_true145
  17. cond_true128:
  18. %tmp17625 = load i32*, i32** getelementptr ([65 x i32*], [65 x i32*]* @last, i32 0, i32 1), align 4
  19. store i32* %tmp17625, i32** %A
  20. %cmp1 = icmp eq i32 %x, %z
  21. br i1 %cmp1 , label %bb98.backedge, label %return.loopexit
  22. bb98.backedge:
  23. br label %cond_true116
  24. cond_true145:
  25. %tmp17631 = load i32*, i32** getelementptr ([65 x i32*], [65 x i32*]* @last, i32 0, i32 1), align 4
  26. store i32* %tmp17631, i32** %A
  27. br i1 false, label %bb98.backedge, label %return.loopexit
  28. return.loopexit:
  29. br label %return
  30. return:
  31. ret i32 0
  32. }