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

« back to all changes in this revision

Viewing changes to test/Transforms/LoopStrengthReduce/dead-phi.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
; RUN: opt < %s -loop-reduce -S | grep phi | count 1
 
2
 
 
3
define void @foo(i32 %n) {
 
4
entry:
 
5
  br label %loop
 
6
 
 
7
loop:
 
8
  %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
 
9
 
 
10
  ; These three instructions form an isolated cycle and can be deleted.
 
11
  %j = phi i32 [ 0, %entry ], [ %j.y, %loop ]
 
12
  %j.x = add i32 %j, 1
 
13
  %j.y = mul i32 %j.x, 2
 
14
 
 
15
  %i.next = add i32 %i, 1
 
16
  %c = icmp ne i32 %i.next, %n
 
17
  br i1 %c, label %loop, label %exit
 
18
 
 
19
exit:
 
20
  ret void
 
21
}