File: signed-trip-count.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 (30 lines) | stat: -rw-r--r-- 854 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
; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t
; RUN: not grep sext %t
; RUN: grep phi %t | count 1

define void @foo(i64* nocapture %x, i32 %n) nounwind {
entry:
	%tmp102 = icmp sgt i32 %n, 0		; <i1> [#uses=1]
	br i1 %tmp102, label %bb.nph, label %return

bb.nph:		; preds = %entry
	br label %bb

bb:		; preds = %bb7, %bb.nph
	%i.01 = phi i32 [ %tmp6, %bb7 ], [ 0, %bb.nph ]		; <i32> [#uses=3]
	%tmp1 = sext i32 %i.01 to i64		; <i64> [#uses=1]
	%tmp4 = getelementptr i64* %x, i32 %i.01		; <i64*> [#uses=1]
	store i64 %tmp1, i64* %tmp4, align 8
	%tmp6 = add i32 %i.01, 1		; <i32> [#uses=2]
	br label %bb7

bb7:		; preds = %bb
	%tmp10 = icmp slt i32 %tmp6, %n		; <i1> [#uses=1]
	br i1 %tmp10, label %bb, label %bb7.return_crit_edge

bb7.return_crit_edge:		; preds = %bb7
	br label %return

return:		; preds = %bb7.return_crit_edge, %entry
	ret void
}