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