• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -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[0] = phi;
9;      }
10;    }
11;
12define void @func(double* noalias nonnull %A) {
13entry:
14  br label %outer.preheader
15
16outer.preheader:
17  br label %outer.for
18
19outer.for:
20  %j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
21  %j.cmp = icmp slt i32 %j, 2
22  br i1 %j.cmp, label %reduction.preheader, label %outer.exit
23
24
25    reduction.preheader:
26      br label %reduction.for
27
28    reduction.for:
29      %i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
30      %phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
31      %i.cmp = icmp slt i32 %i, 4
32      br i1 %i.cmp, label %body, label %reduction.exit
33
34
35
36        body:
37          %add = fadd double %phi, 4.2
38          br label %reduction.inc
39
40
41
42    reduction.inc:
43      %i.inc = add nuw nsw i32 %i, 1
44      br label %reduction.for
45
46    reduction.exit:
47      store double %phi, double* %A
48      br label %outer.inc
49
50
51
52outer.inc:
53  %j.inc = add nuw nsw i32 %j, 1
54  br label %outer.for
55
56outer.exit:
57  br label %return
58
59return:
60  ret void
61}
62
63
64; CHECK: skipped possible mapping target because the memory location written to does not depend on its outer loop
65