• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -polly-process-unprofitable=false -polly-detect \
2; RUN:   -analyze < %s | FileCheck %s
3;
4; CHECK-NOT: Valid
5;
6; Do not consider this a SCoP as we do not perform any optimizations for
7; loops with a small trip count.
8;
9;    void f(int *A) {
10;      for (int i = 0; i < 4; i++)
11;        for (int j = 0; j < 4; j++)
12;          for (int k = 0; k < 4; k++)
13;            for (int l = 0; l < 4; l++)
14;              A[i] += A[i] * A[i - 1] + A[i + 1];
15;    }
16;
17target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
18
19define void @f(i32* %A) {
20entry:
21  br label %for.cond
22
23for.cond:                                         ; preds = %for.inc.24, %entry
24  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc.24 ], [ 0, %entry ]
25  %exitcond5 = icmp ne i64 %indvars.iv, 4
26  br i1 %exitcond5, label %for.body, label %for.end.26
27
28for.body:                                         ; preds = %for.cond
29  br label %for.cond.1
30
31for.cond.1:                                       ; preds = %for.inc.21, %for.body
32  %j.0 = phi i32 [ 0, %for.body ], [ %inc22, %for.inc.21 ]
33  %exitcond2 = icmp ne i32 %j.0, 4
34  br i1 %exitcond2, label %for.body.3, label %for.end.23
35
36for.body.3:                                       ; preds = %for.cond.1
37  br label %for.cond.4
38
39for.cond.4:                                       ; preds = %for.inc.18, %for.body.3
40  %k.0 = phi i32 [ 0, %for.body.3 ], [ %inc19, %for.inc.18 ]
41  %exitcond1 = icmp ne i32 %k.0, 4
42  br i1 %exitcond1, label %for.body.6, label %for.end.20
43
44for.body.6:                                       ; preds = %for.cond.4
45  br label %for.cond.7
46
47for.cond.7:                                       ; preds = %for.inc, %for.body.6
48  %l.0 = phi i32 [ 0, %for.body.6 ], [ %inc, %for.inc ]
49  %exitcond = icmp ne i32 %l.0, 4
50  br i1 %exitcond, label %for.body.9, label %for.end
51
52for.body.9:                                       ; preds = %for.cond.7
53  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
54  %tmp = load i32, i32* %arrayidx, align 4
55  %tmp6 = add nsw i64 %indvars.iv, -1
56  %arrayidx11 = getelementptr inbounds i32, i32* %A, i64 %tmp6
57  %tmp7 = load i32, i32* %arrayidx11, align 4
58  %mul = mul nsw i32 %tmp, %tmp7
59  %tmp8 = add nuw nsw i64 %indvars.iv, 1
60  %arrayidx13 = getelementptr inbounds i32, i32* %A, i64 %tmp8
61  %tmp9 = load i32, i32* %arrayidx13, align 4
62  %add14 = add nsw i32 %mul, %tmp9
63  %arrayidx16 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
64  %tmp10 = load i32, i32* %arrayidx16, align 4
65  %add17 = add nsw i32 %tmp10, %add14
66  store i32 %add17, i32* %arrayidx16, align 4
67  br label %for.inc
68
69for.inc:                                          ; preds = %for.body.9
70  %inc = add nuw nsw i32 %l.0, 1
71  br label %for.cond.7
72
73for.end:                                          ; preds = %for.cond.7
74  br label %for.inc.18
75
76for.inc.18:                                       ; preds = %for.end
77  %inc19 = add nuw nsw i32 %k.0, 1
78  br label %for.cond.4
79
80for.end.20:                                       ; preds = %for.cond.4
81  br label %for.inc.21
82
83for.inc.21:                                       ; preds = %for.end.20
84  %inc22 = add nuw nsw i32 %j.0, 1
85  br label %for.cond.1
86
87for.end.23:                                       ; preds = %for.cond.1
88  br label %for.inc.24
89
90for.inc.24:                                       ; preds = %for.end.23
91  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
92  br label %for.cond
93
94for.end.26:                                       ; preds = %for.cond
95  ret void
96}
97