File: loop_evaluate_6.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 (31 lines) | stat: -rw-r--r-- 1,016 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
; RUN: llvm-as < %s | opt -indvars -loop-deletion | llvm-dis | grep phi | count 1
; XFAIL: *

; Indvars can't evaluate this loop, because ScalarEvolution can't compute
; an exact trip count, because it doesn't know if dividing by the stride will
; have a remainder. It could be done with more aggressive VRP though.

define i32 @test(i32 %x_offs) nounwind readnone {
entry:
	%0 = icmp sgt i32 %x_offs, 4		; <i1> [#uses=1]
	br i1 %0, label %bb.nph, label %bb2

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

bb:		; preds = %bb1, %bb.nph
	%x_offs_addr.01 = phi i32 [ %1, %bb1 ], [ %x_offs, %bb.nph ]		; <i32> [#uses=1]
	%1 = add i32 %x_offs_addr.01, -4		; <i32> [#uses=3]
	br label %bb1

bb1:		; preds = %bb
	%2 = icmp sgt i32 %1, 4		; <i1> [#uses=1]
	br i1 %2, label %bb, label %bb1.bb2_crit_edge

bb1.bb2_crit_edge:		; preds = %bb1
	br label %bb2

bb2:		; preds = %bb1.bb2_crit_edge, %entry
	%x_offs_addr.0.lcssa = phi i32 [ %1, %bb1.bb2_crit_edge ], [ %x_offs, %entry ]		; <i32> [#uses=1]
	ret i32 %x_offs_addr.0.lcssa
}