File: OneIterLoop3-2007-08-17.ll

package info (click to toggle)
llvm 2.6-9.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 57,604 kB
  • ctags: 44,336
  • sloc: cpp: 344,766; sh: 12,407; ansic: 10,617; ada: 3,070; ml: 2,505; perl: 2,496; makefile: 1,426; pascal: 1,163; exp: 389; asm: 307; python: 298; objc: 260; lisp: 182; csh: 117; xml: 38; f90: 36; tcl: 20
file content (34 lines) | stat: -rw-r--r-- 1,260 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
; Loop is elimianted. Save last value assignments, including induction variable.
; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats | not grep "loop-index-split"

declare i32 @foo(i32)
declare i32 @bar(i32, i32)

define void @foobar(i32 %a, i32 %b) {
entry:
	br label %bb

bb:		; preds = %cond_next, %entry
	%i.01.0 = phi i32 [ 0, %entry ], [ %tmp8, %cond_next ]		; <i32> [#uses=3]
	%tsum.16.0 = phi i32 [ 42, %entry ], [ %tsum.0, %cond_next ]		; <i32> [#uses=2]
	%tmp1 = icmp eq i32 %i.01.0, 50		; <i1> [#uses=1]
	br i1 %tmp1, label %cond_true, label %cond_next

cond_true:		; preds = %bb
	%tmp4 = tail call i32 @foo( i32 %i.01.0 )		; <i32> [#uses=1]
	%tmp6 = add i32 %tmp4, %tsum.16.0		; <i32> [#uses=1]
	br label %cond_next

cond_next:		; preds = %bb, %cond_true
	%tsum.0 = phi i32 [ %tmp6, %cond_true ], [ %tsum.16.0, %bb ]		; <i32> [#uses=2]
	%tmp8 = add i32 %i.01.0, 1		; <i32> [#uses=3]
	%tmp11 = icmp slt i32 %tmp8, 100		; <i1> [#uses=1]
	br i1 %tmp11, label %bb, label %bb14

bb14:		; preds = %cond_next
	%tmp8.lcssa = phi i32 [ %tmp8, %cond_next ]		; <i32> [#uses=1]
	%tsum.0.lcssa = phi i32 [ %tsum.0, %cond_next ]		; <i32> [#uses=1]
	%tmp17 = tail call i32 @bar( i32 %tmp8.lcssa, i32 %tsum.0.lcssa )		; <i32> [#uses=0]
	ret void
}