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
59
60
61
| ; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine -analyze < %s | FileCheck %s
;
; void f(int *A) {
; for (int i = 0; i < 128; i++)
; for (int j = 0; j < 16; j++)
; A[i * j]++;
; }
;
; CHECK: Statements {
; CHECK-NEXT: Stmt_bb7
; CHECK-NEXT: Domain :=
; CHECK-NEXT: { Stmt_bb7[i0, i1] : 0 <= i0 <= 127 and 0 <= i1 <= 15 };
; CHECK-NEXT: Schedule :=
; CHECK-NEXT: { Stmt_bb7[i0, i1] -> [i0, i1] };
; CHECK-NEXT: ReadAccess := [Reduction Type: +] [Scalar: 0]
; CHECK-NEXT: { Stmt_bb7[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 2048 };
; CHECK-NEXT: MayWriteAccess := [Reduction Type: +] [Scalar: 0]
; CHECK-NEXT: { Stmt_bb7[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 2048 };
; CHECK-NEXT: }
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @f(i32* %A) {
bb:
br label %bb4
bb4: ; preds = %bb13, %bb
%indvars.iv1 = phi i64 [ %indvars.iv.next2, %bb13 ], [ 0, %bb ]
%exitcond3 = icmp ne i64 %indvars.iv1, 128
br i1 %exitcond3, label %bb5, label %bb14
bb5: ; preds = %bb4
br label %bb6
bb6: ; preds = %bb11, %bb5
%indvars.iv = phi i64 [ %indvars.iv.next, %bb11 ], [ 0, %bb5 ]
%exitcond = icmp ne i64 %indvars.iv, 16
br i1 %exitcond, label %bb7, label %bb12
bb7: ; preds = %bb6
%tmp = mul nsw i64 %indvars.iv1, %indvars.iv
%tmp8 = getelementptr inbounds i32, i32* %A, i64 %tmp
%tmp9 = load i32, i32* %tmp8, align 4
%tmp10 = add nsw i32 %tmp9, 1
store i32 %tmp10, i32* %tmp8, align 4
br label %bb11
bb11: ; preds = %bb7
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
br label %bb6
bb12: ; preds = %bb6
br label %bb13
bb13: ; preds = %bb12
%indvars.iv.next2 = add nuw nsw i64 %indvars.iv1, 1
br label %bb4
bb14: ; preds = %bb4
ret void
}
|