1 ; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
3 ; A valid Scop would print the list of it's statements, we check that we do not
6 ; CHECK-NOT: Statements
8 ; FIXME: Handling this is an open problem, at the moment we just bail out.
10 ; void foo(float *A, float *B,
23 ; for (long i = 0; i < 100; i++) {
40 ; Computing the minimal and maximal element accessed in B is very expensive.
41 ; Expressing the minimal element itself yields a rather complex isl_pw_aff which
44 ; MemRef_B[(100 + p11)] : p2 <= -1 + p1 and p3 <= -1 + p1 and p4 <= -1 + p1
45 ; and p5 <= -1 + p1 and p6 <= -1 + p1 and
46 ; p7 <= -1 + p1 and p8 <= -1 + p1 and p9 <= -1 + p1
47 ; and p10 <= -1 + p1 and p11 >= p1 and
49 ; MemRef_B[(100 + p12)] : p2 <= -1 + p1 and p3 <= -1 + p1 and p4 <= -1 + p1
50 ; and p5 <= -1 + p1 and p6 <= -1 + p1 and
51 ; p7 <= -1 + p1 and p8 <= -1 + p1 and p9 <= -1 + p1
52 ; and p10 <= -1 + p1 and p11 <= -1 + p1 and p12 >= p1;
54 ; and this isl_pw_aff is then 1:1 translated into a isl ast expression.
56 ; In the best case, we would create a run-time check such as:
58 ; if (B[99 + max(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12)] < A[0]
59 ; || A[99] B[min(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9]))
62 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
64 ; Function Attrs: nounwind uwtable
65 define void @foo(float* %A, float* %B, i64 %p1, i64 %p2, i64 %p3, i64 %p4, i64 %p5, i64 %p6, i64 %p7, i64 %p8, i64 %p9, i64 %p10, i64 %p11, i64 %p12) #0 {
69 entry.split: ; preds = %entry
72 for.body: ; preds = %entry.split, %for.body
73 %i.01 = phi i64 [ 0, %entry.split ], [ %tmp25, %for.body ]
74 %tmp = add i64 %p1, %i.01
75 %arrayidx = getelementptr float, float* %B, i64 %tmp
76 %tmp2 = add i64 %p2, %i.01
77 %arrayidx2 = getelementptr float, float* %B, i64 %tmp2
78 %tmp3 = add i64 %p3, %i.01
79 %arrayidx5 = getelementptr float, float* %B, i64 %tmp3
80 %tmp4 = add i64 %p4, %i.01
81 %arrayidx8 = getelementptr float, float* %B, i64 %tmp4
82 %tmp5 = add i64 %p5, %i.01
83 %arrayidx11 = getelementptr float, float* %B, i64 %tmp5
84 %tmp6 = add i64 %p6, %i.01
85 %arrayidx14 = getelementptr float, float* %B, i64 %tmp6
86 %tmp7 = add i64 %p7, %i.01
87 %arrayidx17 = getelementptr float, float* %B, i64 %tmp7
88 %tmp8 = add i64 %p8, %i.01
89 %arrayidx20 = getelementptr float, float* %B, i64 %tmp8
90 %tmp9 = add i64 %p9, %i.01
91 %arrayidx23 = getelementptr float, float* %B, i64 %tmp9
92 %tmp10 = add i64 %p10, %i.01
93 %arrayidx26 = getelementptr float, float* %B, i64 %tmp10
94 %tmp11 = add i64 %p11, %i.01
95 %arrayidx29 = getelementptr float, float* %B, i64 %tmp11
96 %tmp12 = add i64 %p12, %i.01
97 %arrayidx32 = getelementptr float, float* %B, i64 %tmp12
98 %arrayidx34 = getelementptr float, float* %A, i64 %i.01
99 %tmp13 = load float, float* %arrayidx, align 4
100 %tmp14 = load float, float* %arrayidx2, align 4
101 %add3 = fadd float %tmp13, %tmp14
102 %tmp15 = load float, float* %arrayidx5, align 4
103 %add6 = fadd float %add3, %tmp15
104 %tmp16 = load float, float* %arrayidx8, align 4
105 %add9 = fadd float %add6, %tmp16
106 %tmp17 = load float, float* %arrayidx11, align 4
107 %add12 = fadd float %add9, %tmp17
108 %tmp18 = load float, float* %arrayidx14, align 4
109 %add15 = fadd float %add12, %tmp18
110 %tmp19 = load float, float* %arrayidx17, align 4
111 %add18 = fadd float %add15, %tmp19
112 %tmp20 = load float, float* %arrayidx20, align 4
113 %add21 = fadd float %add18, %tmp20
114 %tmp21 = load float, float* %arrayidx23, align 4
115 %add24 = fadd float %add21, %tmp21
116 %tmp22 = load float, float* %arrayidx26, align 4
117 %add27 = fadd float %add24, %tmp22
118 %tmp23 = load float, float* %arrayidx29, align 4
119 %add30 = fadd float %add27, %tmp23
120 %tmp24 = load float, float* %arrayidx32, align 4
121 %add33 = fadd float %add30, %tmp24
122 store float %add33, float* %arrayidx34, align 4
123 %tmp25 = add nsw i64 %i.01, 1
124 %exitcond = icmp ne i64 %tmp25, 100
125 br i1 %exitcond, label %for.body, label %for.end
127 for.end: ; preds = %for.body