~ubuntu-branches/ubuntu/quantal/llvm-3.1/quantal

« back to all changes in this revision

Viewing changes to test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-03-29 19:09:51 UTC
  • Revision ID: package-import@ubuntu.com-20120329190951-aq83ivog4cg8bxun
Tags: upstream-3.1~svn153643
ImportĀ upstreamĀ versionĀ 3.1~svn153643

Show diffs side-by-side

added added

removed removed

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