2003-06-26-IterativePromote.ll 496 B

12345678910111213141516
  1. ; Promoting some values allows promotion of other values.
  2. ; RUN: opt < %s -mem2reg -S | not grep alloca
  3. define i32 @test2() {
  4. %result = alloca i32 ; <i32*> [#uses=2]
  5. %a = alloca i32 ; <i32*> [#uses=2]
  6. %p = alloca i32* ; <i32**> [#uses=2]
  7. store i32 0, i32* %a
  8. store i32* %a, i32** %p
  9. %tmp.0 = load i32*, i32** %p ; <i32*> [#uses=1]
  10. %tmp.1 = load i32, i32* %tmp.0 ; <i32> [#uses=1]
  11. store i32 %tmp.1, i32* %result
  12. %tmp.2 = load i32, i32* %result ; <i32> [#uses=1]
  13. ret i32 %tmp.2
  14. }