• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-delicm -analyze< %s | FileCheck %s
2; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-delicm -disable-output -stats < %s 2>&1 | FileCheck %s --check-prefix=STATS
3; REQUIRES: asserts
4;
5;    void func(double *A) {
6;      for (int j = 0; j < 2; j += 1) { /* outer */
7;        A[j] = 21.0;
8;        A[j] = 42.0;
9;        double phi = 0.0;
10;        for (int i = 0; i < 4; i += 1) /* reduction */
11;          phi += 4.2;
12;        A[j] = phi;
13;      }
14;    }
15;
16
17define void @func(double* noalias nonnull %A) {
18entry:
19  br label %outer.preheader
20
21outer.preheader:
22  br label %outer.for
23
24outer.for:
25  %j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
26  %j.cmp = icmp slt i32 %j, 2
27  br i1 %j.cmp, label %reduction.preheader, label %outer.exit
28
29
30    reduction.preheader:
31      %A_idx = getelementptr inbounds double, double* %A, i32 %j
32      store double 21.0, double* %A_idx
33      store double 42.0, double* %A_idx
34      br label %reduction.for
35
36    reduction.for:
37      %i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
38      %phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
39      %i.cmp = icmp slt i32 %i, 4
40      br i1 %i.cmp, label %body, label %reduction.exit
41
42
43
44        body:
45          %add = fadd double %phi, 4.2
46          br label %reduction.inc
47
48
49
50    reduction.inc:
51      %i.inc = add nuw nsw i32 %i, 1
52      br label %reduction.for
53
54    reduction.exit:
55      store double %phi, double* %A_idx
56      br label %outer.inc
57
58
59
60outer.inc:
61  %j.inc = add nuw nsw i32 %j, 1
62  br label %outer.for
63
64outer.exit:
65  br label %return
66
67return:
68  ret void
69}
70
71
72; CHECK: No modification has been made
73; STATS: 1 polly-zone       - Number of not zone-analyzable arrays
74