File: isl_trip_count_03.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (58 lines) | stat: -rw-r--r-- 2,150 bytes parent folder | download | duplicates (5)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
;
; Test comes from a bug (15771) or better a feature request. It was not allowed
; in Polly in the old domain generation as ScalarEvolution cannot figure out the
; loop bounds. However, the new domain generation will detect the SCoP.

; CHECK:      Context:
; CHECK-NEXT: [n] -> {  : -2147483648 <= n <= 2147483647 }
;
; CHECK:      p0: %n
;
; CHECK:      Statements {
; CHECK-NEXT:     Stmt_for_next
; CHECK-NEXT:         Domain :=
; CHECK-NEXT:             [n] -> { Stmt_for_next[i0] : i0 >= 0 and 2i0 <= -3 + n };
; CHECK-NEXT:         Schedule :=
; CHECK-NEXT:             [n] -> { Stmt_for_next[i0] -> [i0] };
; CHECK-NEXT:         ReadAccess :=    [Reduction Type: +] [Scalar: 0]
; CHECK-NEXT:             [n] -> { Stmt_for_next[i0] -> MemRef_A[i0] };
; CHECK-NEXT:         MustWriteAccess :=    [Reduction Type: +] [Scalar: 0]
; CHECK-NEXT:             [n] -> { Stmt_for_next[i0] -> MemRef_A[i0] };
; CHECK-NEXT: }

@A = common global [100 x i32] zeroinitializer, align 16

define void @foo(i32 %n) #0 {
entry:
  br label %entry.split

entry.split:                                      ; preds = %entry
  %cmp2 = icmp sgt i32 %n, 0
  br i1 %cmp2, label %for.body.lr.ph, label %for.end

for.body.lr.ph:                                   ; preds = %entry.split
  br label %for.body

for.body:                                         ; preds = %for.body.lr.ph, %for.body
  %indvar = phi i64 [ 0, %for.body.lr.ph ], [ %indvar.next, %for.next ]
  %arrayidx = getelementptr [100 x i32], ptr @A, i64 0, i64 %indvar
  %0 = mul i64 %indvar, 2
  %1 = add i64 %0, 2
  %add1 = trunc i64 %1 to i32
  %cmp = icmp slt i32 %add1, %n
  %indvar.next = add i64 %indvar, 1
  br i1 %cmp, label %for.next, label %for.cond.for.end_crit_edge

for.next:
  %2 = load i32, ptr %arrayidx, align 4
  %add = add nsw i32 %2, 1
  store i32 %add, ptr %arrayidx, align 4
  br label %for.body

for.cond.for.end_crit_edge:                       ; preds = %for.body
  br label %for.end

for.end:                                          ; preds = %for.cond.for.end_crit_edge, %entry.split
  ret void
}