236
|
1 ; RUN: opt %loadPolly -polly-print-delicm -pass-remarks-missed=polly-delicm -disable-output < %s 2>&1 | FileCheck %s
|
150
|
2 ;
|
|
3 ; void func(double *A) {
|
|
4 ; for (int j = 0; j < 2; j += 1) { /* outer */
|
|
5 ; memset(A[j], 0, sizeof(double));
|
|
6 ; double phi = 0.0;
|
|
7 ; for (int i = 0; i < 4; i += 1) /* reduction */
|
|
8 ; phi += 4.2;
|
|
9 ; if (phi >= 0.0)
|
|
10 ; A[j] = phi;
|
|
11 ; }
|
|
12 ; }
|
|
13 ;
|
|
14
|
252
|
15 define void @func(ptr noalias nonnull %A) {
|
150
|
16 entry:
|
|
17 br label %outer.preheader
|
|
18
|
|
19 outer.preheader:
|
|
20 br label %outer.for
|
|
21
|
|
22 outer.for:
|
|
23 %j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
|
|
24 %j.cmp = icmp slt i32 %j, 2
|
|
25 br i1 %j.cmp, label %reduction.preheader, label %outer.exit
|
|
26
|
|
27
|
|
28 reduction.preheader:
|
|
29 br label %reduction.for
|
|
30
|
|
31 reduction.for:
|
|
32 %i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
|
|
33 %phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
|
|
34 %i.cmp = icmp slt i32 %i, 4
|
|
35 br i1 %i.cmp, label %body, label %reduction.exit
|
|
36
|
|
37
|
|
38
|
|
39 body:
|
|
40 %add = fadd double %phi, 4.2
|
|
41 br label %reduction.inc
|
|
42
|
|
43
|
|
44
|
|
45 reduction.inc:
|
|
46 %i.inc = add nuw nsw i32 %i, 1
|
|
47 br label %reduction.for
|
|
48
|
|
49 reduction.exit:
|
|
50 %phi.cmp = fcmp ogt double %phi, 0.0
|
|
51 br i1 %phi.cmp , label %reduction.exit_true, label %reduction.exit_false
|
|
52
|
|
53 reduction.exit_true:
|
252
|
54 %A_idx = getelementptr inbounds double, ptr %A, i32 %j
|
|
55 store double %phi, ptr %A_idx
|
150
|
56 br label %outer.inc
|
|
57
|
|
58 reduction.exit_false:
|
|
59 br label %outer.inc
|
|
60
|
|
61
|
|
62 outer.inc:
|
|
63 %j.inc = add nuw nsw i32 %j, 1
|
|
64 br label %outer.for
|
|
65
|
|
66 outer.exit:
|
|
67 br label %return
|
|
68
|
|
69 return:
|
|
70 ret void
|
|
71 }
|
|
72
|
|
73
|
|
74 ; CHECK: Skipped possible mapping target because it is not an unconditional overwrite
|