xref: /llvm-project/polly/test/ScopInfo/run-time-check-many-array-disjuncts.ll (revision e1f056f692d869708c1898d9d65a69ac5584a0ed)
1; RUN: opt %loadNPMPolly '-passes=print<polly-detect>' -disable-output < %s 2>&1 \
2; RUN: | FileCheck %s -check-prefix=DETECT
3; RUN: opt %loadNPMPolly '-passes=print<polly-detect>,print<polly-function-scops>' -disable-output < %s 2>&1 | FileCheck %s
4;
5; DETECT: Valid Region for Scop: bb124 => bb176
6;
7; A valid Scop would print the list of it's statements, we check that we do not
8; see that list.
9;
10; CHECK-NOT: Statements
11
12target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
13target triple = "aarch64--linux-android"
14
15%0 = type { ptr, i64, i64, i64, i64, i64, i64 }
16
17define void @_Z1fR1SS0_Ph(ptr nocapture readonly dereferenceable(56) %arg, ptr nocapture readonly dereferenceable(56) %arg1, ptr nocapture readonly %arg2) {
18bb:
19  %tmp = getelementptr inbounds %0, ptr %arg1, i64 0, i32 1
20  %tmp4 = load ptr, ptr %arg, align 8
21  %tmp5 = getelementptr inbounds %0, ptr %arg, i64 0, i32 4
22  %tmp6 = load i64, ptr %tmp5, align 8
23  %tmp7 = getelementptr inbounds %0, ptr %arg, i64 0, i32 1
24  %tmp8 = load i64, ptr %tmp7, align 8
25  %tmp9 = mul i64 %tmp8, %tmp6
26  %tmp10 = getelementptr inbounds i8, ptr %tmp4, i64 %tmp9
27  %tmp11 = getelementptr inbounds %0, ptr %arg, i64 0, i32 3
28  %tmp12 = load i64, ptr %tmp11, align 8
29  %tmp13 = getelementptr inbounds i8, ptr %tmp10, i64 %tmp12
30  %tmp14 = getelementptr inbounds %0, ptr %arg, i64 0, i32 6
31  %tmp15 = load i64, ptr %tmp14, align 8
32  %tmp16 = add i64 %tmp15, 1
33  %tmp17 = icmp eq i64 %tmp16, %tmp6
34  br i1 %tmp17, label %bb51, label %bb18
35
36bb18:                                             ; preds = %bb
37  %tmp19 = getelementptr inbounds %0, ptr %arg, i64 0, i32 2
38  %tmp20 = load i64, ptr %tmp19, align 8
39  %tmp21 = mul i64 %tmp20, %tmp8
40  %tmp22 = getelementptr inbounds i8, ptr %tmp13, i64 %tmp21
41  %tmp23 = getelementptr inbounds i8, ptr %tmp22, i64 %tmp9
42  %tmp24 = getelementptr inbounds i8, ptr %tmp23, i64 %tmp12
43  %tmp26 = load ptr, ptr %arg1, align 8
44  %tmp27 = load i64, ptr %tmp, align 8
45  %tmp28 = getelementptr inbounds %0, ptr %arg1, i64 0, i32 4
46  %tmp29 = load i64, ptr %tmp28, align 8
47  %tmp30 = mul i64 %tmp27, %tmp29
48  %tmp31 = getelementptr inbounds i16, ptr %tmp26, i64 %tmp30
49  %tmp32 = getelementptr inbounds %0, ptr %arg1, i64 0, i32 3
50  %tmp33 = load i64, ptr %tmp32, align 8
51  %tmp34 = getelementptr inbounds i16, ptr %tmp31, i64 %tmp33
52  %tmp35 = getelementptr inbounds %0, ptr %arg, i64 0, i32 5
53  %tmp36 = load i64, ptr %tmp35, align 8
54  br label %bb37
55
56bb37:                                             ; preds = %bb57, %bb18
57  %tmp38 = phi i64 [ %tmp6, %bb18 ], [ %tmp58, %bb57 ]
58  %tmp39 = phi i64 [ %tmp15, %bb18 ], [ %tmp59, %bb57 ]
59  %tmp40 = phi i64 [ %tmp27, %bb18 ], [ %tmp60, %bb57 ]
60  %tmp41 = phi i64 [ %tmp8, %bb18 ], [ %tmp61, %bb57 ]
61  %tmp42 = phi i64 [ %tmp12, %bb18 ], [ %tmp62, %bb57 ]
62  %tmp43 = phi i64 [ %tmp36, %bb18 ], [ %tmp63, %bb57 ]
63  %tmp44 = phi ptr [ %tmp34, %bb18 ], [ %tmp69, %bb57 ]
64  %tmp45 = phi ptr [ %tmp13, %bb18 ], [ %tmp64, %bb57 ]
65  %tmp46 = phi ptr [ %tmp24, %bb18 ], [ %tmp68, %bb57 ]
66  %tmp47 = phi i64 [ 0, %bb18 ], [ %tmp70, %bb57 ]
67  %tmp48 = add i64 %tmp43, 1
68  %tmp49 = sub i64 %tmp48, %tmp42
69  %tmp50 = icmp eq i64 %tmp49, 0
70  br i1 %tmp50, label %bb57, label %bb74
71
72bb51:                                             ; preds = %bb57, %bb
73  ret void
74
75bb52:                                             ; preds = %bb176
76  %tmp53 = load i64, ptr %tmp7, align 8
77  %tmp54 = load i64, ptr %tmp, align 8
78  %tmp55 = load i64, ptr %tmp14, align 8
79  %tmp56 = load i64, ptr %tmp5, align 8
80  br label %bb57
81
82bb57:                                             ; preds = %bb52, %bb37
83  %tmp58 = phi i64 [ %tmp56, %bb52 ], [ %tmp38, %bb37 ]
84  %tmp59 = phi i64 [ %tmp55, %bb52 ], [ %tmp39, %bb37 ]
85  %tmp60 = phi i64 [ %tmp54, %bb52 ], [ %tmp40, %bb37 ]
86  %tmp61 = phi i64 [ %tmp53, %bb52 ], [ %tmp41, %bb37 ]
87  %tmp62 = phi i64 [ %tmp179, %bb52 ], [ %tmp42, %bb37 ]
88  %tmp63 = phi i64 [ %tmp178, %bb52 ], [ %tmp43, %bb37 ]
89  %tmp64 = getelementptr inbounds i8, ptr %tmp45, i64 %tmp61
90  %tmp65 = and i64 %tmp47, 1
91  %tmp66 = icmp eq i64 %tmp65, 0
92  %tmp67 = getelementptr inbounds i8, ptr %tmp46, i64 %tmp61
93  %tmp68 = select i1 %tmp66, ptr %tmp46, ptr %tmp67
94  %tmp69 = getelementptr inbounds i16, ptr %tmp44, i64 %tmp60
95  %tmp70 = add i64 %tmp47, 1
96  %tmp71 = add i64 %tmp59, 1
97  %tmp72 = sub i64 %tmp71, %tmp58
98  %tmp73 = icmp ult i64 %tmp70, %tmp72
99  br i1 %tmp73, label %bb37, label %bb51
100
101bb74:                                             ; preds = %bb176, %bb37
102  %tmp75 = phi i64 [ %tmp181, %bb176 ], [ %tmp49, %bb37 ]
103  %tmp76 = phi i64 [ %tmp177, %bb176 ], [ 0, %bb37 ]
104  %tmp77 = getelementptr inbounds i8, ptr %tmp45, i64 %tmp76
105  %tmp78 = load i8, ptr %tmp77, align 1
106  %tmp79 = zext i8 %tmp78 to i32
107  %tmp80 = or i64 %tmp76, 1
108  %tmp81 = getelementptr inbounds i8, ptr %tmp45, i64 %tmp80
109  %tmp82 = load i8, ptr %tmp81, align 1
110  %tmp83 = zext i8 %tmp82 to i32
111  %tmp84 = getelementptr inbounds i8, ptr %tmp46, i64 %tmp76
112  %tmp85 = load i8, ptr %tmp84, align 1
113  %tmp86 = zext i8 %tmp85 to i32
114  %tmp87 = getelementptr inbounds i8, ptr %tmp46, i64 %tmp80
115  %tmp88 = load i8, ptr %tmp87, align 1
116  %tmp89 = zext i8 %tmp88 to i32
117  %tmp90 = mul nuw nsw i32 %tmp86, 517
118  %tmp91 = add nsw i32 %tmp90, -66176
119  %tmp92 = sub nsw i32 128, %tmp86
120  %tmp93 = mul nsw i32 %tmp92, 100
121  %tmp94 = sub nsw i32 128, %tmp89
122  %tmp95 = mul nsw i32 %tmp94, 208
123  %tmp96 = mul nuw nsw i32 %tmp89, 409
124  %tmp97 = add nsw i32 %tmp96, -52352
125  %tmp98 = mul nuw nsw i32 %tmp79, 298
126  %tmp99 = add nsw i32 %tmp98, -4768
127  %tmp100 = add nsw i32 %tmp91, %tmp99
128  %tmp101 = sdiv i32 %tmp100, 256
129  %tmp102 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %tmp99, i32 %tmp95)
130  %tmp103 = extractvalue { i32, i1 } %tmp102, 1
131  br i1 %tmp103, label %bb104, label %bb105
132
133bb104:                                            ; preds = %bb120, %bb109, %bb105, %bb74
134  tail call void @llvm.trap()
135  unreachable
136
137bb105:                                            ; preds = %bb74
138  %tmp106 = extractvalue { i32, i1 } %tmp102, 0
139  %tmp107 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %tmp106, i32 %tmp93)
140  %tmp108 = extractvalue { i32, i1 } %tmp107, 1
141  br i1 %tmp108, label %bb104, label %bb109
142
143bb109:                                            ; preds = %bb105
144  %tmp110 = extractvalue { i32, i1 } %tmp107, 0
145  %tmp111 = sdiv i32 %tmp110, 256
146  %tmp112 = add nsw i32 %tmp97, %tmp99
147  %tmp113 = sdiv i32 %tmp112, 256
148  %tmp114 = mul nuw nsw i32 %tmp83, 298
149  %tmp115 = add nsw i32 %tmp114, -4768
150  %tmp116 = add nsw i32 %tmp91, %tmp115
151  %tmp117 = sdiv i32 %tmp116, 256
152  %tmp118 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %tmp115, i32 %tmp95)
153  %tmp119 = extractvalue { i32, i1 } %tmp118, 1
154  br i1 %tmp119, label %bb104, label %bb120
155
156bb120:                                            ; preds = %bb109
157  %tmp121 = extractvalue { i32, i1 } %tmp118, 0
158  %tmp122 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %tmp121, i32 %tmp93)
159  %tmp123 = extractvalue { i32, i1 } %tmp122, 1
160  br i1 %tmp123, label %bb104, label %bb124
161
162bb124:                                            ; preds = %bb120
163  %tmp125 = sext i32 %tmp101 to i64
164  %tmp126 = getelementptr inbounds i8, ptr %arg2, i64 %tmp125
165  %tmp127 = load i8, ptr %tmp126, align 1
166  %tmp128 = zext i8 %tmp127 to i32
167  %tmp129 = lshr i32 %tmp128, 3
168  %tmp130 = shl nuw nsw i32 %tmp129, 11
169  %tmp131 = sext i32 %tmp111 to i64
170  %tmp132 = getelementptr inbounds i8, ptr %arg2, i64 %tmp131
171  %tmp133 = load i8, ptr %tmp132, align 1
172  %tmp134 = zext i8 %tmp133 to i32
173  %tmp135 = lshr i32 %tmp134, 2
174  %tmp136 = shl nuw nsw i32 %tmp135, 5
175  %tmp137 = or i32 %tmp136, %tmp130
176  %tmp138 = sext i32 %tmp113 to i64
177  %tmp139 = getelementptr inbounds i8, ptr %arg2, i64 %tmp138
178  %tmp140 = load i8, ptr %tmp139, align 1
179  %tmp141 = zext i8 %tmp140 to i32
180  %tmp142 = lshr i32 %tmp141, 3
181  %tmp143 = or i32 %tmp137, %tmp142
182  %tmp144 = icmp ult i64 %tmp80, %tmp75
183  br i1 %tmp144, label %bb145, label %bb173
184
185bb145:                                            ; preds = %bb124
186  %tmp146 = add nsw i32 %tmp97, %tmp115
187  %tmp147 = sdiv i32 %tmp146, 256
188  %tmp148 = sext i32 %tmp147 to i64
189  %tmp149 = getelementptr inbounds i8, ptr %arg2, i64 %tmp148
190  %tmp150 = load i8, ptr %tmp149, align 1
191  %tmp151 = extractvalue { i32, i1 } %tmp122, 0
192  %tmp152 = sdiv i32 %tmp151, 256
193  %tmp153 = sext i32 %tmp152 to i64
194  %tmp154 = getelementptr inbounds i8, ptr %arg2, i64 %tmp153
195  %tmp155 = load i8, ptr %tmp154, align 1
196  %tmp156 = sext i32 %tmp117 to i64
197  %tmp157 = getelementptr inbounds i8, ptr %arg2, i64 %tmp156
198  %tmp158 = load i8, ptr %tmp157, align 1
199  %tmp159 = zext i8 %tmp158 to i32
200  %tmp160 = lshr i32 %tmp159, 3
201  %tmp161 = shl nuw nsw i32 %tmp160, 11
202  %tmp162 = zext i8 %tmp155 to i32
203  %tmp163 = lshr i32 %tmp162, 2
204  %tmp164 = shl nuw nsw i32 %tmp163, 5
205  %tmp165 = zext i8 %tmp150 to i32
206  %tmp166 = lshr i32 %tmp165, 3
207  %tmp167 = or i32 %tmp164, %tmp166
208  %tmp168 = or i32 %tmp167, %tmp161
209  %tmp169 = shl nuw i32 %tmp168, 16
210  %tmp170 = or i32 %tmp169, %tmp143
211  %tmp171 = getelementptr inbounds i16, ptr %tmp44, i64 %tmp76
212  store i32 %tmp170, ptr %tmp171, align 4
213  br label %bb176
214
215bb173:                                            ; preds = %bb124
216  %tmp174 = trunc i32 %tmp143 to i16
217  %tmp175 = getelementptr inbounds i16, ptr %tmp44, i64 %tmp76
218  store i16 %tmp174, ptr %tmp175, align 2
219  br label %bb176
220
221bb176:                                            ; preds = %bb173, %bb145
222  %tmp177 = add i64 %tmp76, 2
223  %tmp178 = load i64, ptr %tmp35, align 8
224  %tmp179 = load i64, ptr %tmp11, align 8
225  %tmp180 = add i64 %tmp178, 1
226  %tmp181 = sub i64 %tmp180, %tmp179
227  %tmp182 = icmp ult i64 %tmp177, %tmp181
228  br i1 %tmp182, label %bb74, label %bb52
229}
230
231; Function Attrs: noreturn nounwind
232declare void @llvm.trap() #0
233
234; Function Attrs: nounwind readnone
235declare { i32, i1 } @llvm.sadd.with.overflow.i32(i32, i32) #1
236
237attributes #0 = { noreturn nounwind }
238attributes #1 = { nounwind readnone }
239