1 ; RUN: opt %loadPolly -polly-delicm-max-ops=1000000 -polly-print-delicm -disable-output < %s | FileCheck %s
3 ; This causes an assertion to fail on out-of-quota after 1000000 operations.
4 ; (The error was specific to -polly-delicm-max-ops=1000000 and changes
5 ; in the implementation are likely to change the number of operations
6 ; up to the point where the error uses to occur)
8 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
10 define void @test(i32 %size, ptr %lhs, i32 %lhsStride, ptr %_rhs, ptr %res, double %alpha) {
14 if.end: ; preds = %entry
15 %sub = add nsw i32 %size, -8
16 %cmp.i.i.i = icmp sgt i32 %sub, 0
17 %.sroa.speculated = select i1 %cmp.i.i.i, i32 %sub, i32 0
18 %and36 = and i32 %.sroa.speculated, -2
19 %cmp38463 = icmp sgt i32 %and36, 0
20 br i1 %cmp38463, label %for.body40, label %for.cond177.preheader
22 for.cond177.preheader: ; preds = %for.cond.cleanup142, %if.end
25 for.body40: ; preds = %for.cond.cleanup142, %if.end
26 %j.0464 = phi i32 [ %add55, %for.cond.cleanup142 ], [ 0, %if.end ]
27 %mul41 = mul nsw i32 %j.0464, %lhsStride
28 %add.ptr42 = getelementptr inbounds double, ptr %lhs, i32 %mul41
29 %add43 = or i32 %j.0464, 1
30 %arrayidx46 = getelementptr inbounds double, ptr %_rhs, i32 %j.0464
31 %tmp = load double, ptr %arrayidx46, align 8
32 %mul47 = fmul double %tmp, %alpha
33 %add55 = add nuw nsw i32 %j.0464, 2
34 %arrayidx67 = getelementptr inbounds double, ptr %res, i32 %j.0464
35 %tmp1 = load double, ptr %arrayidx67, align 8
36 store double undef, ptr %arrayidx67, align 8
37 %arrayidx75 = getelementptr inbounds double, ptr %res, i32 %add43
38 %tmp2 = load double, ptr %arrayidx75, align 8
39 store double undef, ptr %arrayidx75, align 8
40 %arrayidx78 = getelementptr inbounds double, ptr %add.ptr42, i32 %add43
41 %tmp3 = load double, ptr %arrayidx78, align 8
42 %mul.i.i388 = fmul double %mul47, %tmp3
43 %add88 = fadd double undef, 0.000000e+00
44 %cmp120448 = icmp ult i32 %add55, %size
45 br i1 %cmp120448, label %for.body122.preheader, label %for.cond.cleanup142
47 for.body122.preheader: ; preds = %for.body40
48 %add.ptr117 = getelementptr inbounds double, ptr %res, i32 %add55
51 for.body122: ; preds = %for.body122, %for.body122.preheader
52 %i118.0455 = phi i32 [ %add137, %for.body122 ], [ %add55, %for.body122.preheader ]
53 %resIt.0454 = phi ptr [ %add.ptr135, %for.body122 ], [ %add.ptr117, %for.body122.preheader ]
54 %ptmp2.0450 = phi double [ undef, %for.body122 ], [ 0.000000e+00, %for.body122.preheader ]
55 %tmp4 = load double, ptr %resIt.0454, align 8
56 %add.i.i.i386 = fadd double undef, %tmp4
57 %add.i.i.i384 = fadd double undef, %add.i.i.i386
58 store double %add.i.i.i384, ptr %resIt.0454, align 8
59 %add.ptr135 = getelementptr inbounds double, ptr %resIt.0454, i32 1
60 %add137 = add nuw i32 %i118.0455, 1
61 %exitcond469 = icmp eq i32 %add137, %size
62 br i1 %exitcond469, label %for.cond.cleanup142.loopexit, label %for.body122
64 for.cond.cleanup142.loopexit: ; preds = %for.body122
65 %.pre = load double, ptr %arrayidx67, align 8
66 %.pre471 = load double, ptr %arrayidx75, align 8
67 br label %for.cond.cleanup142
69 for.cond.cleanup142: ; preds = %for.cond.cleanup142.loopexit, %for.body40
70 %tmp5 = phi double [ undef, %for.body40 ], [ %.pre471, %for.cond.cleanup142.loopexit ]
71 %tmp6 = phi double [ undef, %for.body40 ], [ %.pre, %for.cond.cleanup142.loopexit ]
72 %ptmp2.0.lcssa = phi double [ 0.000000e+00, %for.body40 ], [ undef, %for.cond.cleanup142.loopexit ]
73 %add163 = fadd double %add88, %ptmp2.0.lcssa
74 store double undef, ptr %arrayidx67, align 8
75 store double undef, ptr %arrayidx75, align 8
76 %cmp38 = icmp ult i32 %add55, %and36
77 br i1 %cmp38, label %for.body40, label %for.cond177.preheader
79 for.cond.cleanup179: ; preds = %for.cond.cleanup198
82 for.body180: ; preds = %for.cond.cleanup198, %for.cond177.preheader
83 %j176.0442 = phi i32 [ %add195, %for.cond.cleanup198 ], [ %and36, %for.cond177.preheader ]
84 %arrayidx185 = getelementptr inbounds double, ptr %_rhs, i32 %j176.0442
85 %tmp7 = load double, ptr %arrayidx185, align 8
86 %mul186 = fmul double %tmp7, %alpha
87 %arrayidx189 = getelementptr inbounds double, ptr %lhs, i32 %j176.0442
88 %tmp8 = load double, ptr %arrayidx189, align 8
89 %mul.i.i373 = fmul double %tmp8, %mul186
90 %arrayidx192 = getelementptr inbounds double, ptr %res, i32 %j176.0442
91 %tmp9 = load double, ptr %arrayidx192, align 8
92 %add193 = fadd double %tmp9, %mul.i.i373
93 store double %add193, ptr %arrayidx192, align 8
94 %add195 = add nuw nsw i32 %j176.0442, 1
95 %cmp197438 = icmp slt i32 %add195, %size
96 br i1 %cmp197438, label %for.body199, label %for.cond.cleanup198
98 for.cond.cleanup198.loopexit: ; preds = %for.body199
99 %.pre472 = load double, ptr %arrayidx192, align 8
100 br label %for.cond.cleanup198
102 for.cond.cleanup198: ; preds = %for.cond.cleanup198.loopexit, %for.body180
103 %tmp10 = phi double [ %add193, %for.body180 ], [ %.pre472, %for.cond.cleanup198.loopexit ]
104 %t2187.0.lcssa = phi double [ 0.000000e+00, %for.body180 ], [ %add207, %for.cond.cleanup198.loopexit ]
105 %add213 = fadd double %tmp10, undef
106 store double %add213, ptr %arrayidx192, align 8
107 %exitcond468 = icmp eq i32 %add195, %size
108 br i1 %exitcond468, label %for.cond.cleanup179, label %for.body180
110 for.body199: ; preds = %for.body199, %for.body180
111 %i194.0440 = phi i32 [ %inc209, %for.body199 ], [ %add195, %for.body180 ]
112 %arrayidx200 = getelementptr inbounds double, ptr %lhs, i32 %i194.0440
113 %tmp11 = load double, ptr %arrayidx200, align 8
114 %mul.i.i372 = fmul double %mul186, %tmp11
115 %arrayidx202 = getelementptr inbounds double, ptr %res, i32 %i194.0440
116 %tmp12 = load double, ptr %arrayidx202, align 8
117 %add203 = fadd double %tmp12, %mul.i.i372
118 store double %add203, ptr %arrayidx202, align 8
119 %arrayidx205 = getelementptr inbounds double, ptr %_rhs, i32 %i194.0440
120 %tmp13 = load double, ptr %arrayidx200, align 8
121 %tmp14 = load double, ptr %arrayidx205, align 8
122 %mul.i.i = fmul double %tmp13, %tmp14
123 %add207 = fadd double undef, %mul.i.i
124 %inc209 = add nuw nsw i32 %i194.0440, 1
125 %exitcond = icmp eq i32 %inc209, %size
126 br i1 %exitcond, label %for.cond.cleanup198.loopexit, label %for.body199
130 ; CHECK: Zone not computed