1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _
2 // RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK1
3 // RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
4 // RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK1
5 // RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK3
6 // RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
7 // RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK3
9 // RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
10 // RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
11 // RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
12 // RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
13 // RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
14 // RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
16 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK9
17 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
18 // RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK9
19 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK11
20 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
21 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK11
23 // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
24 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
25 // RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
26 // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
27 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
28 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
29 // expected-no-diagnostics
38 operator T() { return T(); }
47 S
<T
> s_arr
[] = {1, 2};
51 #pragma omp distribute parallel for private(t_var, vec, s_arr, s_arr, var, var)
52 for (int i
= 0; i
< 2; ++i
) {
62 volatile double &g1
= g
;
70 #pragma omp distribute parallel for private(g, g1, svar, sfvar)
71 for (int i
= 0; i
< 2; ++i
) {
92 S
<float> s_arr
[] = {1, 2};
97 #pragma omp distribute parallel for private(t_var, vec, s_arr, s_arr, var, var, svar)
98 for (int i
= 0; i
< 2; ++i
) {
108 // this is the ctor loop
110 // call destructors: var..
115 // By OpenMP specifications, private applies to both distribute and parallel for.
116 // However, the support for 'private' of 'parallel' is only used when 'parallel'
117 // is found alone. Therefore we only have one 'private' support for 'parallel for'
119 // this is the ctor loop
121 // call destructors: var..
126 // template tmain with S_INT_TY
130 // this is the ctor loop
132 // call destructors: var..
138 // CHECK1-LABEL: define {{[^@]+}}@main
139 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
140 // CHECK1-NEXT: entry:
141 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
142 // CHECK1-NEXT: [[G:%.*]] = alloca double, align 8
143 // CHECK1-NEXT: [[G1:%.*]] = alloca ptr, align 8
144 // CHECK1-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON:%.*]], align 1
145 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
146 // CHECK1-NEXT: store ptr [[G]], ptr [[G1]], align 8
147 // CHECK1-NEXT: call void @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1) [[REF_TMP]])
148 // CHECK1-NEXT: ret i32 0
151 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68
152 // CHECK1-SAME: () #[[ATTR2:[0-9]+]] {
153 // CHECK1-NEXT: entry:
154 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3:[0-9]+]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68.omp_outlined)
155 // CHECK1-NEXT: ret void
158 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68.omp_outlined
159 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
160 // CHECK1-NEXT: entry:
161 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
162 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
163 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
164 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
165 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
166 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
167 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
168 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
169 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
170 // CHECK1-NEXT: [[G:%.*]] = alloca double, align 8
171 // CHECK1-NEXT: [[G1:%.*]] = alloca double, align 8
172 // CHECK1-NEXT: [[_TMP2:%.*]] = alloca ptr, align 8
173 // CHECK1-NEXT: [[SVAR:%.*]] = alloca i32, align 4
174 // CHECK1-NEXT: [[SFVAR:%.*]] = alloca float, align 4
175 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
176 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
177 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
178 // CHECK1-NEXT: store ptr undef, ptr [[_TMP1]], align 8
179 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
180 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_COMB_UB]], align 4
181 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
182 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
183 // CHECK1-NEXT: store ptr [[G1]], ptr [[_TMP2]], align 8
184 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
185 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
186 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
187 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
188 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 1
189 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
190 // CHECK1: cond.true:
191 // CHECK1-NEXT: br label [[COND_END:%.*]]
192 // CHECK1: cond.false:
193 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
194 // CHECK1-NEXT: br label [[COND_END]]
196 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
197 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
198 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
199 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
200 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
201 // CHECK1: omp.inner.for.cond:
202 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
203 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
204 // CHECK1-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
205 // CHECK1-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
206 // CHECK1: omp.inner.for.body:
207 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
208 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
209 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
210 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
211 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
212 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
213 // CHECK1: omp.inner.for.inc:
214 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
215 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
216 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
217 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
218 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
219 // CHECK1: omp.inner.for.end:
220 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
221 // CHECK1: omp.loop.exit:
222 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
223 // CHECK1-NEXT: ret void
226 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68.omp_outlined.omp_outlined
227 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
228 // CHECK1-NEXT: entry:
229 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
230 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
231 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
232 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
233 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
234 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
235 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
236 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
237 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
238 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
239 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
240 // CHECK1-NEXT: [[G:%.*]] = alloca double, align 8
241 // CHECK1-NEXT: [[G1:%.*]] = alloca double, align 8
242 // CHECK1-NEXT: [[_TMP3:%.*]] = alloca ptr, align 8
243 // CHECK1-NEXT: [[SVAR:%.*]] = alloca i32, align 4
244 // CHECK1-NEXT: [[SFVAR:%.*]] = alloca float, align 4
245 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
246 // CHECK1-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON_0:%.*]], align 8
247 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
248 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
249 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
250 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
251 // CHECK1-NEXT: store ptr undef, ptr [[_TMP1]], align 8
252 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
253 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
254 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
255 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
256 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
257 // CHECK1-NEXT: [[CONV2:%.*]] = trunc i64 [[TMP1]] to i32
258 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
259 // CHECK1-NEXT: store i32 [[CONV2]], ptr [[DOTOMP_UB]], align 4
260 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
261 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
262 // CHECK1-NEXT: store ptr [[G1]], ptr [[_TMP3]], align 8
263 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
264 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
265 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2:[0-9]+]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
266 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
267 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
268 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
269 // CHECK1: cond.true:
270 // CHECK1-NEXT: br label [[COND_END:%.*]]
271 // CHECK1: cond.false:
272 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
273 // CHECK1-NEXT: br label [[COND_END]]
275 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
276 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
277 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
278 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
279 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
280 // CHECK1: omp.inner.for.cond:
281 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
282 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
283 // CHECK1-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
284 // CHECK1-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
285 // CHECK1: omp.inner.for.body:
286 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
287 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
288 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
289 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
290 // CHECK1-NEXT: store double 1.000000e+00, ptr [[G]], align 8
291 // CHECK1-NEXT: [[TMP10:%.*]] = load ptr, ptr [[_TMP3]], align 8
292 // CHECK1-NEXT: store volatile double 1.000000e+00, ptr [[TMP10]], align 8
293 // CHECK1-NEXT: store i32 3, ptr [[SVAR]], align 4
294 // CHECK1-NEXT: store float 4.000000e+00, ptr [[SFVAR]], align 4
295 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 0
296 // CHECK1-NEXT: store ptr [[G]], ptr [[TMP11]], align 8
297 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 1
298 // CHECK1-NEXT: [[TMP13:%.*]] = load ptr, ptr [[_TMP3]], align 8
299 // CHECK1-NEXT: store ptr [[TMP13]], ptr [[TMP12]], align 8
300 // CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 2
301 // CHECK1-NEXT: store ptr [[SVAR]], ptr [[TMP14]], align 8
302 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 3
303 // CHECK1-NEXT: store ptr [[SFVAR]], ptr [[TMP15]], align 8
304 // CHECK1-NEXT: call void @"_ZZZ4mainENK3$_0clEvENKUlvE_clEv"(ptr noundef nonnull align 8 dereferenceable(32) [[REF_TMP]])
305 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
306 // CHECK1: omp.body.continue:
307 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
308 // CHECK1: omp.inner.for.inc:
309 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
310 // CHECK1-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP16]], 1
311 // CHECK1-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4
312 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
313 // CHECK1: omp.inner.for.end:
314 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
315 // CHECK1: omp.loop.exit:
316 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
317 // CHECK1-NEXT: ret void
320 // CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
321 // CHECK1-SAME: () #[[ATTR4:[0-9]+]] {
322 // CHECK1-NEXT: entry:
323 // CHECK1-NEXT: call void @__tgt_register_requires(i64 1)
324 // CHECK1-NEXT: ret void
327 // CHECK3-LABEL: define {{[^@]+}}@main
328 // CHECK3-SAME: () #[[ATTR0:[0-9]+]] {
329 // CHECK3-NEXT: entry:
330 // CHECK3-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
331 // CHECK3-NEXT: [[G:%.*]] = alloca double, align 8
332 // CHECK3-NEXT: [[G1:%.*]] = alloca ptr, align 4
333 // CHECK3-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON:%.*]], align 1
334 // CHECK3-NEXT: store i32 0, ptr [[RETVAL]], align 4
335 // CHECK3-NEXT: store ptr [[G]], ptr [[G1]], align 4
336 // CHECK3-NEXT: call void @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1) [[REF_TMP]])
337 // CHECK3-NEXT: ret i32 0
340 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68
341 // CHECK3-SAME: () #[[ATTR2:[0-9]+]] {
342 // CHECK3-NEXT: entry:
343 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3:[0-9]+]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68.omp_outlined)
344 // CHECK3-NEXT: ret void
347 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68.omp_outlined
348 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
349 // CHECK3-NEXT: entry:
350 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
351 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
352 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
353 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
354 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca ptr, align 4
355 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
356 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
357 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
358 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
359 // CHECK3-NEXT: [[G:%.*]] = alloca double, align 8
360 // CHECK3-NEXT: [[G1:%.*]] = alloca double, align 8
361 // CHECK3-NEXT: [[_TMP2:%.*]] = alloca ptr, align 4
362 // CHECK3-NEXT: [[SVAR:%.*]] = alloca i32, align 4
363 // CHECK3-NEXT: [[SFVAR:%.*]] = alloca float, align 4
364 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
365 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
366 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
367 // CHECK3-NEXT: store ptr undef, ptr [[_TMP1]], align 4
368 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
369 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_COMB_UB]], align 4
370 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
371 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
372 // CHECK3-NEXT: store ptr [[G1]], ptr [[_TMP2]], align 4
373 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
374 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
375 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
376 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
377 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 1
378 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
379 // CHECK3: cond.true:
380 // CHECK3-NEXT: br label [[COND_END:%.*]]
381 // CHECK3: cond.false:
382 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
383 // CHECK3-NEXT: br label [[COND_END]]
385 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
386 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
387 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
388 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
389 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
390 // CHECK3: omp.inner.for.cond:
391 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
392 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
393 // CHECK3-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
394 // CHECK3-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
395 // CHECK3: omp.inner.for.body:
396 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
397 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
398 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68.omp_outlined.omp_outlined, i32 [[TMP7]], i32 [[TMP8]])
399 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
400 // CHECK3: omp.inner.for.inc:
401 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
402 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
403 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP9]], [[TMP10]]
404 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
405 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
406 // CHECK3: omp.inner.for.end:
407 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
408 // CHECK3: omp.loop.exit:
409 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
410 // CHECK3-NEXT: ret void
413 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68.omp_outlined.omp_outlined
414 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[DOTPREVIOUS_LB_:%.*]], i32 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
415 // CHECK3-NEXT: entry:
416 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
417 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
418 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i32, align 4
419 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i32, align 4
420 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
421 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
422 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca ptr, align 4
423 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
424 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
425 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
426 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
427 // CHECK3-NEXT: [[G:%.*]] = alloca double, align 8
428 // CHECK3-NEXT: [[G1:%.*]] = alloca double, align 8
429 // CHECK3-NEXT: [[_TMP2:%.*]] = alloca ptr, align 4
430 // CHECK3-NEXT: [[SVAR:%.*]] = alloca i32, align 4
431 // CHECK3-NEXT: [[SFVAR:%.*]] = alloca float, align 4
432 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
433 // CHECK3-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON_0:%.*]], align 4
434 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
435 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
436 // CHECK3-NEXT: store i32 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 4
437 // CHECK3-NEXT: store i32 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 4
438 // CHECK3-NEXT: store ptr undef, ptr [[_TMP1]], align 4
439 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
440 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
441 // CHECK3-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTPREVIOUS_LB__ADDR]], align 4
442 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTPREVIOUS_UB__ADDR]], align 4
443 // CHECK3-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_LB]], align 4
444 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTOMP_UB]], align 4
445 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
446 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
447 // CHECK3-NEXT: store ptr [[G1]], ptr [[_TMP2]], align 4
448 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
449 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
450 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2:[0-9]+]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
451 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
452 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
453 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
454 // CHECK3: cond.true:
455 // CHECK3-NEXT: br label [[COND_END:%.*]]
456 // CHECK3: cond.false:
457 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
458 // CHECK3-NEXT: br label [[COND_END]]
460 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
461 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
462 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
463 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
464 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
465 // CHECK3: omp.inner.for.cond:
466 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
467 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
468 // CHECK3-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
469 // CHECK3-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
470 // CHECK3: omp.inner.for.body:
471 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
472 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
473 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
474 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4
475 // CHECK3-NEXT: store double 1.000000e+00, ptr [[G]], align 8
476 // CHECK3-NEXT: [[TMP10:%.*]] = load ptr, ptr [[_TMP2]], align 4
477 // CHECK3-NEXT: store volatile double 1.000000e+00, ptr [[TMP10]], align 4
478 // CHECK3-NEXT: store i32 3, ptr [[SVAR]], align 4
479 // CHECK3-NEXT: store float 4.000000e+00, ptr [[SFVAR]], align 4
480 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 0
481 // CHECK3-NEXT: store ptr [[G]], ptr [[TMP11]], align 4
482 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 1
483 // CHECK3-NEXT: [[TMP13:%.*]] = load ptr, ptr [[_TMP2]], align 4
484 // CHECK3-NEXT: store ptr [[TMP13]], ptr [[TMP12]], align 4
485 // CHECK3-NEXT: [[TMP14:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 2
486 // CHECK3-NEXT: store ptr [[SVAR]], ptr [[TMP14]], align 4
487 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 3
488 // CHECK3-NEXT: store ptr [[SFVAR]], ptr [[TMP15]], align 4
489 // CHECK3-NEXT: call void @"_ZZZ4mainENK3$_0clEvENKUlvE_clEv"(ptr noundef nonnull align 4 dereferenceable(16) [[REF_TMP]])
490 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
491 // CHECK3: omp.body.continue:
492 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
493 // CHECK3: omp.inner.for.inc:
494 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
495 // CHECK3-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP16]], 1
496 // CHECK3-NEXT: store i32 [[ADD4]], ptr [[DOTOMP_IV]], align 4
497 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
498 // CHECK3: omp.inner.for.end:
499 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
500 // CHECK3: omp.loop.exit:
501 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
502 // CHECK3-NEXT: ret void
505 // CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
506 // CHECK3-SAME: () #[[ATTR4:[0-9]+]] {
507 // CHECK3-NEXT: entry:
508 // CHECK3-NEXT: call void @__tgt_register_requires(i64 1)
509 // CHECK3-NEXT: ret void
512 // CHECK9-LABEL: define {{[^@]+}}@main
513 // CHECK9-SAME: () #[[ATTR0:[0-9]+]] {
514 // CHECK9-NEXT: entry:
515 // CHECK9-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
516 // CHECK9-NEXT: [[G:%.*]] = alloca double, align 8
517 // CHECK9-NEXT: [[G1:%.*]] = alloca ptr, align 8
518 // CHECK9-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S:%.*]], align 4
519 // CHECK9-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
520 // CHECK9-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
521 // CHECK9-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S], align 4
522 // CHECK9-NEXT: [[VAR:%.*]] = alloca ptr, align 8
523 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
524 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
525 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
526 // CHECK9-NEXT: store i32 0, ptr [[RETVAL]], align 4
527 // CHECK9-NEXT: store ptr [[G]], ptr [[G1]], align 8
528 // CHECK9-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
529 // CHECK9-NEXT: store i32 0, ptr [[T_VAR]], align 4
530 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VEC]], ptr align 4 @__const.main.vec, i64 8, i1 false)
531 // CHECK9-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i64 0, i64 0
532 // CHECK9-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], float noundef 1.000000e+00)
533 // CHECK9-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYINIT_BEGIN]], i64 1
534 // CHECK9-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], float noundef 2.000000e+00)
535 // CHECK9-NEXT: store ptr [[TEST]], ptr [[VAR]], align 8
536 // CHECK9-NEXT: store ptr undef, ptr [[_TMP1]], align 8
537 // CHECK9-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
538 // CHECK9-NEXT: store i32 2, ptr [[TMP0]], align 4
539 // CHECK9-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
540 // CHECK9-NEXT: store i32 0, ptr [[TMP1]], align 4
541 // CHECK9-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
542 // CHECK9-NEXT: store ptr null, ptr [[TMP2]], align 8
543 // CHECK9-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
544 // CHECK9-NEXT: store ptr null, ptr [[TMP3]], align 8
545 // CHECK9-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
546 // CHECK9-NEXT: store ptr null, ptr [[TMP4]], align 8
547 // CHECK9-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
548 // CHECK9-NEXT: store ptr null, ptr [[TMP5]], align 8
549 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
550 // CHECK9-NEXT: store ptr null, ptr [[TMP6]], align 8
551 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
552 // CHECK9-NEXT: store ptr null, ptr [[TMP7]], align 8
553 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
554 // CHECK9-NEXT: store i64 2, ptr [[TMP8]], align 8
555 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
556 // CHECK9-NEXT: store i64 0, ptr [[TMP9]], align 8
557 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
558 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
559 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
560 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
561 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
562 // CHECK9-NEXT: store i32 0, ptr [[TMP12]], align 4
563 // CHECK9-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95.region_id, ptr [[KERNEL_ARGS]])
564 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
565 // CHECK9-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
566 // CHECK9: omp_offload.failed:
567 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95() #[[ATTR4:[0-9]+]]
568 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
569 // CHECK9: omp_offload.cont:
570 // CHECK9-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiET_v()
571 // CHECK9-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
572 // CHECK9-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
573 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i64 2
574 // CHECK9-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
575 // CHECK9: arraydestroy.body:
576 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP15]], [[OMP_OFFLOAD_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
577 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
578 // CHECK9-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
579 // CHECK9-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
580 // CHECK9-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE2:%.*]], label [[ARRAYDESTROY_BODY]]
581 // CHECK9: arraydestroy.done2:
582 // CHECK9-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR4]]
583 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[RETVAL]], align 4
584 // CHECK9-NEXT: ret i32 [[TMP16]]
587 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ev
588 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat {
589 // CHECK9-NEXT: entry:
590 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
591 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
592 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
593 // CHECK9-NEXT: call void @_ZN1SIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
594 // CHECK9-NEXT: ret void
597 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ef
598 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
599 // CHECK9-NEXT: entry:
600 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
601 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
602 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
603 // CHECK9-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
604 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
605 // CHECK9-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
606 // CHECK9-NEXT: call void @_ZN1SIfEC2Ef(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], float noundef [[TMP0]])
607 // CHECK9-NEXT: ret void
610 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95
611 // CHECK9-SAME: () #[[ATTR3:[0-9]+]] {
612 // CHECK9-NEXT: entry:
613 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95.omp_outlined)
614 // CHECK9-NEXT: ret void
617 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95.omp_outlined
618 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] {
619 // CHECK9-NEXT: entry:
620 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
621 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
622 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
623 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
624 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
625 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
626 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
627 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
628 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
629 // CHECK9-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
630 // CHECK9-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
631 // CHECK9-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S], align 4
632 // CHECK9-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S:%.*]], align 4
633 // CHECK9-NEXT: [[_TMP2:%.*]] = alloca ptr, align 8
634 // CHECK9-NEXT: [[SVAR:%.*]] = alloca i32, align 4
635 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
636 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
637 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
638 // CHECK9-NEXT: store ptr undef, ptr [[_TMP1]], align 8
639 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
640 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_COMB_UB]], align 4
641 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
642 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
643 // CHECK9-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
644 // CHECK9-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i64 2
645 // CHECK9-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
646 // CHECK9: arrayctor.loop:
647 // CHECK9-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
648 // CHECK9-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
649 // CHECK9-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYCTOR_CUR]], i64 1
650 // CHECK9-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
651 // CHECK9-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
652 // CHECK9: arrayctor.cont:
653 // CHECK9-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
654 // CHECK9-NEXT: store ptr [[VAR]], ptr [[_TMP2]], align 8
655 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
656 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
657 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
658 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
659 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 1
660 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
661 // CHECK9: cond.true:
662 // CHECK9-NEXT: br label [[COND_END:%.*]]
663 // CHECK9: cond.false:
664 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
665 // CHECK9-NEXT: br label [[COND_END]]
667 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
668 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
669 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
670 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
671 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
672 // CHECK9: omp.inner.for.cond:
673 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
674 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
675 // CHECK9-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
676 // CHECK9-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
677 // CHECK9: omp.inner.for.cond.cleanup:
678 // CHECK9-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
679 // CHECK9: omp.inner.for.body:
680 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
681 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
682 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
683 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
684 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
685 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
686 // CHECK9: omp.inner.for.inc:
687 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
688 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
689 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
690 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
691 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
692 // CHECK9: omp.inner.for.end:
693 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
694 // CHECK9: omp.loop.exit:
695 // CHECK9-NEXT: [[TMP13:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
696 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP13]], align 4
697 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP14]])
698 // CHECK9-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR4]]
699 // CHECK9-NEXT: [[ARRAY_BEGIN4:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
700 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN4]], i64 2
701 // CHECK9-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
702 // CHECK9: arraydestroy.body:
703 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP15]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
704 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
705 // CHECK9-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
706 // CHECK9-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN4]]
707 // CHECK9-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE5:%.*]], label [[ARRAYDESTROY_BODY]]
708 // CHECK9: arraydestroy.done5:
709 // CHECK9-NEXT: ret void
712 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95.omp_outlined.omp_outlined
713 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR3]] {
714 // CHECK9-NEXT: entry:
715 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
716 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
717 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
718 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
719 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
720 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
721 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
722 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
723 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
724 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
725 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
726 // CHECK9-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
727 // CHECK9-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
728 // CHECK9-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S], align 4
729 // CHECK9-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S:%.*]], align 4
730 // CHECK9-NEXT: [[_TMP3:%.*]] = alloca ptr, align 8
731 // CHECK9-NEXT: [[SVAR:%.*]] = alloca i32, align 4
732 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
733 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
734 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
735 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
736 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
737 // CHECK9-NEXT: store ptr undef, ptr [[_TMP1]], align 8
738 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
739 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
740 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
741 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
742 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
743 // CHECK9-NEXT: [[CONV2:%.*]] = trunc i64 [[TMP1]] to i32
744 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
745 // CHECK9-NEXT: store i32 [[CONV2]], ptr [[DOTOMP_UB]], align 4
746 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
747 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
748 // CHECK9-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
749 // CHECK9-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i64 2
750 // CHECK9-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
751 // CHECK9: arrayctor.loop:
752 // CHECK9-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
753 // CHECK9-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
754 // CHECK9-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYCTOR_CUR]], i64 1
755 // CHECK9-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
756 // CHECK9-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
757 // CHECK9: arrayctor.cont:
758 // CHECK9-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
759 // CHECK9-NEXT: store ptr [[VAR]], ptr [[_TMP3]], align 8
760 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
761 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
762 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2:[0-9]+]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
763 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
764 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
765 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
766 // CHECK9: cond.true:
767 // CHECK9-NEXT: br label [[COND_END:%.*]]
768 // CHECK9: cond.false:
769 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
770 // CHECK9-NEXT: br label [[COND_END]]
772 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
773 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
774 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
775 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
776 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
777 // CHECK9: omp.inner.for.cond:
778 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
779 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
780 // CHECK9-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
781 // CHECK9-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
782 // CHECK9: omp.inner.for.cond.cleanup:
783 // CHECK9-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
784 // CHECK9: omp.inner.for.body:
785 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
786 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
787 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
788 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4
789 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[T_VAR]], align 4
790 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4
791 // CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP11]] to i64
792 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC]], i64 0, i64 [[IDXPROM]]
793 // CHECK9-NEXT: store i32 [[TMP10]], ptr [[ARRAYIDX]], align 4
794 // CHECK9-NEXT: [[TMP12:%.*]] = load ptr, ptr [[_TMP3]], align 8
795 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[I]], align 4
796 // CHECK9-NEXT: [[IDXPROM5:%.*]] = sext i32 [[TMP13]] to i64
797 // CHECK9-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i64 0, i64 [[IDXPROM5]]
798 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX6]], ptr align 4 [[TMP12]], i64 4, i1 false)
799 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
800 // CHECK9: omp.body.continue:
801 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
802 // CHECK9: omp.inner.for.inc:
803 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
804 // CHECK9-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP14]], 1
805 // CHECK9-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4
806 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
807 // CHECK9: omp.inner.for.end:
808 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
809 // CHECK9: omp.loop.exit:
810 // CHECK9-NEXT: [[TMP15:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
811 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[TMP15]], align 4
812 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP16]])
813 // CHECK9-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR4]]
814 // CHECK9-NEXT: [[ARRAY_BEGIN8:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
815 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN8]], i64 2
816 // CHECK9-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
817 // CHECK9: arraydestroy.body:
818 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP17]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
819 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
820 // CHECK9-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
821 // CHECK9-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN8]]
822 // CHECK9-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE9:%.*]], label [[ARRAYDESTROY_BODY]]
823 // CHECK9: arraydestroy.done9:
824 // CHECK9-NEXT: ret void
827 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfED1Ev
828 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
829 // CHECK9-NEXT: entry:
830 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
831 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
832 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
833 // CHECK9-NEXT: call void @_ZN1SIfED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR4]]
834 // CHECK9-NEXT: ret void
837 // CHECK9-LABEL: define {{[^@]+}}@_Z5tmainIiET_v
838 // CHECK9-SAME: () #[[ATTR5:[0-9]+]] comdat {
839 // CHECK9-NEXT: entry:
840 // CHECK9-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
841 // CHECK9-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
842 // CHECK9-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
843 // CHECK9-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
844 // CHECK9-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
845 // CHECK9-NEXT: [[VAR:%.*]] = alloca ptr, align 8
846 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
847 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
848 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
849 // CHECK9-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
850 // CHECK9-NEXT: store i32 0, ptr [[T_VAR]], align 4
851 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VEC]], ptr align 4 @__const._Z5tmainIiET_v.vec, i64 8, i1 false)
852 // CHECK9-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i64 0, i64 0
853 // CHECK9-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], i32 noundef signext 1)
854 // CHECK9-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYINIT_BEGIN]], i64 1
855 // CHECK9-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], i32 noundef signext 2)
856 // CHECK9-NEXT: store ptr [[TEST]], ptr [[VAR]], align 8
857 // CHECK9-NEXT: store ptr undef, ptr [[_TMP1]], align 8
858 // CHECK9-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
859 // CHECK9-NEXT: store i32 2, ptr [[TMP0]], align 4
860 // CHECK9-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
861 // CHECK9-NEXT: store i32 0, ptr [[TMP1]], align 4
862 // CHECK9-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
863 // CHECK9-NEXT: store ptr null, ptr [[TMP2]], align 8
864 // CHECK9-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
865 // CHECK9-NEXT: store ptr null, ptr [[TMP3]], align 8
866 // CHECK9-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
867 // CHECK9-NEXT: store ptr null, ptr [[TMP4]], align 8
868 // CHECK9-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
869 // CHECK9-NEXT: store ptr null, ptr [[TMP5]], align 8
870 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
871 // CHECK9-NEXT: store ptr null, ptr [[TMP6]], align 8
872 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
873 // CHECK9-NEXT: store ptr null, ptr [[TMP7]], align 8
874 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
875 // CHECK9-NEXT: store i64 2, ptr [[TMP8]], align 8
876 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
877 // CHECK9-NEXT: store i64 0, ptr [[TMP9]], align 8
878 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
879 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
880 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
881 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
882 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
883 // CHECK9-NEXT: store i32 0, ptr [[TMP12]], align 4
884 // CHECK9-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.region_id, ptr [[KERNEL_ARGS]])
885 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
886 // CHECK9-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
887 // CHECK9: omp_offload.failed:
888 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49() #[[ATTR4]]
889 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
890 // CHECK9: omp_offload.cont:
891 // CHECK9-NEXT: store i32 0, ptr [[RETVAL]], align 4
892 // CHECK9-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
893 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i64 2
894 // CHECK9-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
895 // CHECK9: arraydestroy.body:
896 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP15]], [[OMP_OFFLOAD_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
897 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
898 // CHECK9-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
899 // CHECK9-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
900 // CHECK9-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE2:%.*]], label [[ARRAYDESTROY_BODY]]
901 // CHECK9: arraydestroy.done2:
902 // CHECK9-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR4]]
903 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[RETVAL]], align 4
904 // CHECK9-NEXT: ret i32 [[TMP16]]
907 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ev
908 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
909 // CHECK9-NEXT: entry:
910 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
911 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
912 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
913 // CHECK9-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
914 // CHECK9-NEXT: store float 0.000000e+00, ptr [[F]], align 4
915 // CHECK9-NEXT: ret void
918 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ef
919 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
920 // CHECK9-NEXT: entry:
921 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
922 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
923 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
924 // CHECK9-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
925 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
926 // CHECK9-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
927 // CHECK9-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
928 // CHECK9-NEXT: store float [[TMP0]], ptr [[F]], align 4
929 // CHECK9-NEXT: ret void
932 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfED2Ev
933 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
934 // CHECK9-NEXT: entry:
935 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
936 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
937 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
938 // CHECK9-NEXT: ret void
941 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ev
942 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
943 // CHECK9-NEXT: entry:
944 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
945 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
946 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
947 // CHECK9-NEXT: call void @_ZN1SIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
948 // CHECK9-NEXT: ret void
951 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ei
952 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef signext [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
953 // CHECK9-NEXT: entry:
954 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
955 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
956 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
957 // CHECK9-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
958 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
959 // CHECK9-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
960 // CHECK9-NEXT: call void @_ZN1SIiEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], i32 noundef signext [[TMP0]])
961 // CHECK9-NEXT: ret void
964 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49
965 // CHECK9-SAME: () #[[ATTR3]] {
966 // CHECK9-NEXT: entry:
967 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.omp_outlined)
968 // CHECK9-NEXT: ret void
971 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.omp_outlined
972 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] {
973 // CHECK9-NEXT: entry:
974 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
975 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
976 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
977 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
978 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
979 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
980 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
981 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
982 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
983 // CHECK9-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
984 // CHECK9-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
985 // CHECK9-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
986 // CHECK9-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
987 // CHECK9-NEXT: [[_TMP2:%.*]] = alloca ptr, align 8
988 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
989 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
990 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
991 // CHECK9-NEXT: store ptr undef, ptr [[_TMP1]], align 8
992 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
993 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_COMB_UB]], align 4
994 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
995 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
996 // CHECK9-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
997 // CHECK9-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i64 2
998 // CHECK9-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
999 // CHECK9: arrayctor.loop:
1000 // CHECK9-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
1001 // CHECK9-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
1002 // CHECK9-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYCTOR_CUR]], i64 1
1003 // CHECK9-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
1004 // CHECK9-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
1005 // CHECK9: arrayctor.cont:
1006 // CHECK9-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
1007 // CHECK9-NEXT: store ptr [[VAR]], ptr [[_TMP2]], align 8
1008 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1009 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1010 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1011 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1012 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 1
1013 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1014 // CHECK9: cond.true:
1015 // CHECK9-NEXT: br label [[COND_END:%.*]]
1016 // CHECK9: cond.false:
1017 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1018 // CHECK9-NEXT: br label [[COND_END]]
1019 // CHECK9: cond.end:
1020 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1021 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1022 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1023 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1024 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1025 // CHECK9: omp.inner.for.cond:
1026 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1027 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1028 // CHECK9-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1029 // CHECK9-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1030 // CHECK9: omp.inner.for.cond.cleanup:
1031 // CHECK9-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1032 // CHECK9: omp.inner.for.body:
1033 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1034 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1035 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1036 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1037 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
1038 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1039 // CHECK9: omp.inner.for.inc:
1040 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1041 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1042 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
1043 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1044 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
1045 // CHECK9: omp.inner.for.end:
1046 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1047 // CHECK9: omp.loop.exit:
1048 // CHECK9-NEXT: [[TMP13:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1049 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP13]], align 4
1050 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP14]])
1051 // CHECK9-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR4]]
1052 // CHECK9-NEXT: [[ARRAY_BEGIN4:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1053 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN4]], i64 2
1054 // CHECK9-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1055 // CHECK9: arraydestroy.body:
1056 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP15]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1057 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
1058 // CHECK9-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
1059 // CHECK9-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN4]]
1060 // CHECK9-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE5:%.*]], label [[ARRAYDESTROY_BODY]]
1061 // CHECK9: arraydestroy.done5:
1062 // CHECK9-NEXT: ret void
1065 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.omp_outlined.omp_outlined
1066 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR3]] {
1067 // CHECK9-NEXT: entry:
1068 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1069 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1070 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1071 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1072 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1073 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1074 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
1075 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1076 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1077 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1078 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1079 // CHECK9-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
1080 // CHECK9-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
1081 // CHECK9-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
1082 // CHECK9-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
1083 // CHECK9-NEXT: [[_TMP3:%.*]] = alloca ptr, align 8
1084 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1085 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1086 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1087 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1088 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1089 // CHECK9-NEXT: store ptr undef, ptr [[_TMP1]], align 8
1090 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1091 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
1092 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1093 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1094 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1095 // CHECK9-NEXT: [[CONV2:%.*]] = trunc i64 [[TMP1]] to i32
1096 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1097 // CHECK9-NEXT: store i32 [[CONV2]], ptr [[DOTOMP_UB]], align 4
1098 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1099 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1100 // CHECK9-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1101 // CHECK9-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i64 2
1102 // CHECK9-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
1103 // CHECK9: arrayctor.loop:
1104 // CHECK9-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
1105 // CHECK9-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
1106 // CHECK9-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYCTOR_CUR]], i64 1
1107 // CHECK9-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
1108 // CHECK9-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
1109 // CHECK9: arrayctor.cont:
1110 // CHECK9-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
1111 // CHECK9-NEXT: store ptr [[VAR]], ptr [[_TMP3]], align 8
1112 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1113 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1114 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1115 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1116 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
1117 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1118 // CHECK9: cond.true:
1119 // CHECK9-NEXT: br label [[COND_END:%.*]]
1120 // CHECK9: cond.false:
1121 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1122 // CHECK9-NEXT: br label [[COND_END]]
1123 // CHECK9: cond.end:
1124 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1125 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1126 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1127 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1128 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1129 // CHECK9: omp.inner.for.cond:
1130 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1131 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1132 // CHECK9-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1133 // CHECK9-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1134 // CHECK9: omp.inner.for.cond.cleanup:
1135 // CHECK9-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1136 // CHECK9: omp.inner.for.body:
1137 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1138 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1139 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1140 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1141 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[T_VAR]], align 4
1142 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4
1143 // CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP11]] to i64
1144 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC]], i64 0, i64 [[IDXPROM]]
1145 // CHECK9-NEXT: store i32 [[TMP10]], ptr [[ARRAYIDX]], align 4
1146 // CHECK9-NEXT: [[TMP12:%.*]] = load ptr, ptr [[_TMP3]], align 8
1147 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[I]], align 4
1148 // CHECK9-NEXT: [[IDXPROM5:%.*]] = sext i32 [[TMP13]] to i64
1149 // CHECK9-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i64 0, i64 [[IDXPROM5]]
1150 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX6]], ptr align 4 [[TMP12]], i64 4, i1 false)
1151 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1152 // CHECK9: omp.body.continue:
1153 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1154 // CHECK9: omp.inner.for.inc:
1155 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1156 // CHECK9-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP14]], 1
1157 // CHECK9-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4
1158 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
1159 // CHECK9: omp.inner.for.end:
1160 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1161 // CHECK9: omp.loop.exit:
1162 // CHECK9-NEXT: [[TMP15:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1163 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[TMP15]], align 4
1164 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP16]])
1165 // CHECK9-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR4]]
1166 // CHECK9-NEXT: [[ARRAY_BEGIN8:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1167 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN8]], i64 2
1168 // CHECK9-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1169 // CHECK9: arraydestroy.body:
1170 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP17]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1171 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
1172 // CHECK9-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
1173 // CHECK9-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN8]]
1174 // CHECK9-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE9:%.*]], label [[ARRAYDESTROY_BODY]]
1175 // CHECK9: arraydestroy.done9:
1176 // CHECK9-NEXT: ret void
1179 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIiED1Ev
1180 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1181 // CHECK9-NEXT: entry:
1182 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1183 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1184 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1185 // CHECK9-NEXT: call void @_ZN1SIiED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR4]]
1186 // CHECK9-NEXT: ret void
1189 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ev
1190 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1191 // CHECK9-NEXT: entry:
1192 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1193 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1194 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1195 // CHECK9-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
1196 // CHECK9-NEXT: store i32 0, ptr [[F]], align 4
1197 // CHECK9-NEXT: ret void
1200 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ei
1201 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef signext [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1202 // CHECK9-NEXT: entry:
1203 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1204 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1205 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1206 // CHECK9-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1207 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1208 // CHECK9-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
1209 // CHECK9-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
1210 // CHECK9-NEXT: store i32 [[TMP0]], ptr [[F]], align 4
1211 // CHECK9-NEXT: ret void
1214 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIiED2Ev
1215 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1216 // CHECK9-NEXT: entry:
1217 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1218 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1219 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1220 // CHECK9-NEXT: ret void
1223 // CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1224 // CHECK9-SAME: () #[[ATTR6:[0-9]+]] {
1225 // CHECK9-NEXT: entry:
1226 // CHECK9-NEXT: call void @__tgt_register_requires(i64 1)
1227 // CHECK9-NEXT: ret void
1230 // CHECK11-LABEL: define {{[^@]+}}@main
1231 // CHECK11-SAME: () #[[ATTR0:[0-9]+]] {
1232 // CHECK11-NEXT: entry:
1233 // CHECK11-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
1234 // CHECK11-NEXT: [[G:%.*]] = alloca double, align 8
1235 // CHECK11-NEXT: [[G1:%.*]] = alloca ptr, align 4
1236 // CHECK11-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S:%.*]], align 4
1237 // CHECK11-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
1238 // CHECK11-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
1239 // CHECK11-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S], align 4
1240 // CHECK11-NEXT: [[VAR:%.*]] = alloca ptr, align 4
1241 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
1242 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca ptr, align 4
1243 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1244 // CHECK11-NEXT: store i32 0, ptr [[RETVAL]], align 4
1245 // CHECK11-NEXT: store ptr [[G]], ptr [[G1]], align 4
1246 // CHECK11-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
1247 // CHECK11-NEXT: store i32 0, ptr [[T_VAR]], align 4
1248 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[VEC]], ptr align 4 @__const.main.vec, i32 8, i1 false)
1249 // CHECK11-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
1250 // CHECK11-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], float noundef 1.000000e+00)
1251 // CHECK11-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYINIT_BEGIN]], i32 1
1252 // CHECK11-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], float noundef 2.000000e+00)
1253 // CHECK11-NEXT: store ptr [[TEST]], ptr [[VAR]], align 4
1254 // CHECK11-NEXT: store ptr undef, ptr [[_TMP1]], align 4
1255 // CHECK11-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1256 // CHECK11-NEXT: store i32 2, ptr [[TMP0]], align 4
1257 // CHECK11-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1258 // CHECK11-NEXT: store i32 0, ptr [[TMP1]], align 4
1259 // CHECK11-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1260 // CHECK11-NEXT: store ptr null, ptr [[TMP2]], align 4
1261 // CHECK11-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1262 // CHECK11-NEXT: store ptr null, ptr [[TMP3]], align 4
1263 // CHECK11-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1264 // CHECK11-NEXT: store ptr null, ptr [[TMP4]], align 4
1265 // CHECK11-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1266 // CHECK11-NEXT: store ptr null, ptr [[TMP5]], align 4
1267 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1268 // CHECK11-NEXT: store ptr null, ptr [[TMP6]], align 4
1269 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1270 // CHECK11-NEXT: store ptr null, ptr [[TMP7]], align 4
1271 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1272 // CHECK11-NEXT: store i64 2, ptr [[TMP8]], align 8
1273 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1274 // CHECK11-NEXT: store i64 0, ptr [[TMP9]], align 8
1275 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1276 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
1277 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1278 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
1279 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1280 // CHECK11-NEXT: store i32 0, ptr [[TMP12]], align 4
1281 // CHECK11-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95.region_id, ptr [[KERNEL_ARGS]])
1282 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1283 // CHECK11-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1284 // CHECK11: omp_offload.failed:
1285 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95() #[[ATTR4:[0-9]+]]
1286 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
1287 // CHECK11: omp_offload.cont:
1288 // CHECK11-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiET_v()
1289 // CHECK11-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
1290 // CHECK11-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
1291 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i32 2
1292 // CHECK11-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1293 // CHECK11: arraydestroy.body:
1294 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP15]], [[OMP_OFFLOAD_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1295 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1296 // CHECK11-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
1297 // CHECK11-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
1298 // CHECK11-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE2:%.*]], label [[ARRAYDESTROY_BODY]]
1299 // CHECK11: arraydestroy.done2:
1300 // CHECK11-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR4]]
1301 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[RETVAL]], align 4
1302 // CHECK11-NEXT: ret i32 [[TMP16]]
1305 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ev
1306 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat align 2 {
1307 // CHECK11-NEXT: entry:
1308 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1309 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1310 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1311 // CHECK11-NEXT: call void @_ZN1SIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
1312 // CHECK11-NEXT: ret void
1315 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ef
1316 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1317 // CHECK11-NEXT: entry:
1318 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1319 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
1320 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1321 // CHECK11-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
1322 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1323 // CHECK11-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
1324 // CHECK11-NEXT: call void @_ZN1SIfEC2Ef(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], float noundef [[TMP0]])
1325 // CHECK11-NEXT: ret void
1328 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95
1329 // CHECK11-SAME: () #[[ATTR3:[0-9]+]] {
1330 // CHECK11-NEXT: entry:
1331 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95.omp_outlined)
1332 // CHECK11-NEXT: ret void
1335 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95.omp_outlined
1336 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] {
1337 // CHECK11-NEXT: entry:
1338 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1339 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1340 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1341 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
1342 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca ptr, align 4
1343 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1344 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1345 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1346 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1347 // CHECK11-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
1348 // CHECK11-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
1349 // CHECK11-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S], align 4
1350 // CHECK11-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S:%.*]], align 4
1351 // CHECK11-NEXT: [[_TMP2:%.*]] = alloca ptr, align 4
1352 // CHECK11-NEXT: [[SVAR:%.*]] = alloca i32, align 4
1353 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
1354 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1355 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1356 // CHECK11-NEXT: store ptr undef, ptr [[_TMP1]], align 4
1357 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1358 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_COMB_UB]], align 4
1359 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1360 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1361 // CHECK11-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
1362 // CHECK11-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i32 2
1363 // CHECK11-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
1364 // CHECK11: arrayctor.loop:
1365 // CHECK11-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
1366 // CHECK11-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
1367 // CHECK11-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYCTOR_CUR]], i32 1
1368 // CHECK11-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
1369 // CHECK11-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
1370 // CHECK11: arrayctor.cont:
1371 // CHECK11-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
1372 // CHECK11-NEXT: store ptr [[VAR]], ptr [[_TMP2]], align 4
1373 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1374 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1375 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1376 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1377 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 1
1378 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1379 // CHECK11: cond.true:
1380 // CHECK11-NEXT: br label [[COND_END:%.*]]
1381 // CHECK11: cond.false:
1382 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1383 // CHECK11-NEXT: br label [[COND_END]]
1384 // CHECK11: cond.end:
1385 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1386 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1387 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1388 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1389 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1390 // CHECK11: omp.inner.for.cond:
1391 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1392 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1393 // CHECK11-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1394 // CHECK11-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1395 // CHECK11: omp.inner.for.cond.cleanup:
1396 // CHECK11-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1397 // CHECK11: omp.inner.for.body:
1398 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1399 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1400 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95.omp_outlined.omp_outlined, i32 [[TMP7]], i32 [[TMP8]])
1401 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1402 // CHECK11: omp.inner.for.inc:
1403 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1404 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1405 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP9]], [[TMP10]]
1406 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1407 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]]
1408 // CHECK11: omp.inner.for.end:
1409 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1410 // CHECK11: omp.loop.exit:
1411 // CHECK11-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1412 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP11]], align 4
1413 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP12]])
1414 // CHECK11-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR4]]
1415 // CHECK11-NEXT: [[ARRAY_BEGIN4:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
1416 // CHECK11-NEXT: [[TMP13:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN4]], i32 2
1417 // CHECK11-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1418 // CHECK11: arraydestroy.body:
1419 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP13]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1420 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1421 // CHECK11-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
1422 // CHECK11-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN4]]
1423 // CHECK11-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE5:%.*]], label [[ARRAYDESTROY_BODY]]
1424 // CHECK11: arraydestroy.done5:
1425 // CHECK11-NEXT: ret void
1428 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l95.omp_outlined.omp_outlined
1429 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[DOTPREVIOUS_LB_:%.*]], i32 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR3]] {
1430 // CHECK11-NEXT: entry:
1431 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1432 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1433 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i32, align 4
1434 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i32, align 4
1435 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1436 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
1437 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca ptr, align 4
1438 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1439 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1440 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1441 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1442 // CHECK11-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
1443 // CHECK11-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
1444 // CHECK11-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S], align 4
1445 // CHECK11-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S:%.*]], align 4
1446 // CHECK11-NEXT: [[_TMP2:%.*]] = alloca ptr, align 4
1447 // CHECK11-NEXT: [[SVAR:%.*]] = alloca i32, align 4
1448 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
1449 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1450 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1451 // CHECK11-NEXT: store i32 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 4
1452 // CHECK11-NEXT: store i32 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 4
1453 // CHECK11-NEXT: store ptr undef, ptr [[_TMP1]], align 4
1454 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1455 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
1456 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTPREVIOUS_LB__ADDR]], align 4
1457 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTPREVIOUS_UB__ADDR]], align 4
1458 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_LB]], align 4
1459 // CHECK11-NEXT: store i32 [[TMP1]], ptr [[DOTOMP_UB]], align 4
1460 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1461 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1462 // CHECK11-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
1463 // CHECK11-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i32 2
1464 // CHECK11-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
1465 // CHECK11: arrayctor.loop:
1466 // CHECK11-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
1467 // CHECK11-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
1468 // CHECK11-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYCTOR_CUR]], i32 1
1469 // CHECK11-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
1470 // CHECK11-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
1471 // CHECK11: arrayctor.cont:
1472 // CHECK11-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
1473 // CHECK11-NEXT: store ptr [[VAR]], ptr [[_TMP2]], align 4
1474 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1475 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1476 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2:[0-9]+]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1477 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1478 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
1479 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1480 // CHECK11: cond.true:
1481 // CHECK11-NEXT: br label [[COND_END:%.*]]
1482 // CHECK11: cond.false:
1483 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1484 // CHECK11-NEXT: br label [[COND_END]]
1485 // CHECK11: cond.end:
1486 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1487 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1488 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1489 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1490 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1491 // CHECK11: omp.inner.for.cond:
1492 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1493 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1494 // CHECK11-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1495 // CHECK11-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1496 // CHECK11: omp.inner.for.cond.cleanup:
1497 // CHECK11-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1498 // CHECK11: omp.inner.for.body:
1499 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1500 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1501 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1502 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1503 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[T_VAR]], align 4
1504 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4
1505 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC]], i32 0, i32 [[TMP11]]
1506 // CHECK11-NEXT: store i32 [[TMP10]], ptr [[ARRAYIDX]], align 4
1507 // CHECK11-NEXT: [[TMP12:%.*]] = load ptr, ptr [[_TMP2]], align 4
1508 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[I]], align 4
1509 // CHECK11-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 [[TMP13]]
1510 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[ARRAYIDX4]], ptr align 4 [[TMP12]], i32 4, i1 false)
1511 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1512 // CHECK11: omp.body.continue:
1513 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1514 // CHECK11: omp.inner.for.inc:
1515 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1516 // CHECK11-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP14]], 1
1517 // CHECK11-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4
1518 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]]
1519 // CHECK11: omp.inner.for.end:
1520 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1521 // CHECK11: omp.loop.exit:
1522 // CHECK11-NEXT: [[TMP15:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1523 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[TMP15]], align 4
1524 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP16]])
1525 // CHECK11-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR4]]
1526 // CHECK11-NEXT: [[ARRAY_BEGIN6:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
1527 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN6]], i32 2
1528 // CHECK11-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1529 // CHECK11: arraydestroy.body:
1530 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP17]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1531 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1532 // CHECK11-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
1533 // CHECK11-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN6]]
1534 // CHECK11-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE7:%.*]], label [[ARRAYDESTROY_BODY]]
1535 // CHECK11: arraydestroy.done7:
1536 // CHECK11-NEXT: ret void
1539 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIfED1Ev
1540 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1541 // CHECK11-NEXT: entry:
1542 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1543 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1544 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1545 // CHECK11-NEXT: call void @_ZN1SIfED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR4]]
1546 // CHECK11-NEXT: ret void
1549 // CHECK11-LABEL: define {{[^@]+}}@_Z5tmainIiET_v
1550 // CHECK11-SAME: () #[[ATTR5:[0-9]+]] comdat {
1551 // CHECK11-NEXT: entry:
1552 // CHECK11-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
1553 // CHECK11-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
1554 // CHECK11-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
1555 // CHECK11-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
1556 // CHECK11-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
1557 // CHECK11-NEXT: [[VAR:%.*]] = alloca ptr, align 4
1558 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
1559 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca ptr, align 4
1560 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1561 // CHECK11-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
1562 // CHECK11-NEXT: store i32 0, ptr [[T_VAR]], align 4
1563 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[VEC]], ptr align 4 @__const._Z5tmainIiET_v.vec, i32 8, i1 false)
1564 // CHECK11-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1565 // CHECK11-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], i32 noundef 1)
1566 // CHECK11-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYINIT_BEGIN]], i32 1
1567 // CHECK11-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], i32 noundef 2)
1568 // CHECK11-NEXT: store ptr [[TEST]], ptr [[VAR]], align 4
1569 // CHECK11-NEXT: store ptr undef, ptr [[_TMP1]], align 4
1570 // CHECK11-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1571 // CHECK11-NEXT: store i32 2, ptr [[TMP0]], align 4
1572 // CHECK11-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1573 // CHECK11-NEXT: store i32 0, ptr [[TMP1]], align 4
1574 // CHECK11-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1575 // CHECK11-NEXT: store ptr null, ptr [[TMP2]], align 4
1576 // CHECK11-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1577 // CHECK11-NEXT: store ptr null, ptr [[TMP3]], align 4
1578 // CHECK11-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1579 // CHECK11-NEXT: store ptr null, ptr [[TMP4]], align 4
1580 // CHECK11-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1581 // CHECK11-NEXT: store ptr null, ptr [[TMP5]], align 4
1582 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1583 // CHECK11-NEXT: store ptr null, ptr [[TMP6]], align 4
1584 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1585 // CHECK11-NEXT: store ptr null, ptr [[TMP7]], align 4
1586 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1587 // CHECK11-NEXT: store i64 2, ptr [[TMP8]], align 8
1588 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1589 // CHECK11-NEXT: store i64 0, ptr [[TMP9]], align 8
1590 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1591 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
1592 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1593 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
1594 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1595 // CHECK11-NEXT: store i32 0, ptr [[TMP12]], align 4
1596 // CHECK11-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.region_id, ptr [[KERNEL_ARGS]])
1597 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1598 // CHECK11-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1599 // CHECK11: omp_offload.failed:
1600 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49() #[[ATTR4]]
1601 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
1602 // CHECK11: omp_offload.cont:
1603 // CHECK11-NEXT: store i32 0, ptr [[RETVAL]], align 4
1604 // CHECK11-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1605 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i32 2
1606 // CHECK11-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1607 // CHECK11: arraydestroy.body:
1608 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP15]], [[OMP_OFFLOAD_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1609 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1610 // CHECK11-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
1611 // CHECK11-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
1612 // CHECK11-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE2:%.*]], label [[ARRAYDESTROY_BODY]]
1613 // CHECK11: arraydestroy.done2:
1614 // CHECK11-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR4]]
1615 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[RETVAL]], align 4
1616 // CHECK11-NEXT: ret i32 [[TMP16]]
1619 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ev
1620 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1621 // CHECK11-NEXT: entry:
1622 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1623 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1624 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1625 // CHECK11-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
1626 // CHECK11-NEXT: store float 0.000000e+00, ptr [[F]], align 4
1627 // CHECK11-NEXT: ret void
1630 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ef
1631 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1632 // CHECK11-NEXT: entry:
1633 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1634 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
1635 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1636 // CHECK11-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
1637 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1638 // CHECK11-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
1639 // CHECK11-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
1640 // CHECK11-NEXT: store float [[TMP0]], ptr [[F]], align 4
1641 // CHECK11-NEXT: ret void
1644 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIfED2Ev
1645 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1646 // CHECK11-NEXT: entry:
1647 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1648 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1649 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1650 // CHECK11-NEXT: ret void
1653 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ev
1654 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1655 // CHECK11-NEXT: entry:
1656 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1657 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1658 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1659 // CHECK11-NEXT: call void @_ZN1SIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
1660 // CHECK11-NEXT: ret void
1663 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ei
1664 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1665 // CHECK11-NEXT: entry:
1666 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1667 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1668 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1669 // CHECK11-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1670 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1671 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
1672 // CHECK11-NEXT: call void @_ZN1SIiEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], i32 noundef [[TMP0]])
1673 // CHECK11-NEXT: ret void
1676 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49
1677 // CHECK11-SAME: () #[[ATTR3]] {
1678 // CHECK11-NEXT: entry:
1679 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.omp_outlined)
1680 // CHECK11-NEXT: ret void
1683 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.omp_outlined
1684 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] {
1685 // CHECK11-NEXT: entry:
1686 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1687 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1688 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1689 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
1690 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca ptr, align 4
1691 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1692 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1693 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1694 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1695 // CHECK11-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
1696 // CHECK11-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
1697 // CHECK11-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
1698 // CHECK11-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
1699 // CHECK11-NEXT: [[_TMP2:%.*]] = alloca ptr, align 4
1700 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
1701 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1702 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1703 // CHECK11-NEXT: store ptr undef, ptr [[_TMP1]], align 4
1704 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1705 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_COMB_UB]], align 4
1706 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1707 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1708 // CHECK11-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1709 // CHECK11-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i32 2
1710 // CHECK11-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
1711 // CHECK11: arrayctor.loop:
1712 // CHECK11-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
1713 // CHECK11-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
1714 // CHECK11-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYCTOR_CUR]], i32 1
1715 // CHECK11-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
1716 // CHECK11-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
1717 // CHECK11: arrayctor.cont:
1718 // CHECK11-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
1719 // CHECK11-NEXT: store ptr [[VAR]], ptr [[_TMP2]], align 4
1720 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1721 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1722 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1723 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1724 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 1
1725 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1726 // CHECK11: cond.true:
1727 // CHECK11-NEXT: br label [[COND_END:%.*]]
1728 // CHECK11: cond.false:
1729 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1730 // CHECK11-NEXT: br label [[COND_END]]
1731 // CHECK11: cond.end:
1732 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1733 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1734 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1735 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1736 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1737 // CHECK11: omp.inner.for.cond:
1738 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1739 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1740 // CHECK11-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1741 // CHECK11-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1742 // CHECK11: omp.inner.for.cond.cleanup:
1743 // CHECK11-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1744 // CHECK11: omp.inner.for.body:
1745 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1746 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1747 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.omp_outlined.omp_outlined, i32 [[TMP7]], i32 [[TMP8]])
1748 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1749 // CHECK11: omp.inner.for.inc:
1750 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1751 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1752 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP9]], [[TMP10]]
1753 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1754 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]]
1755 // CHECK11: omp.inner.for.end:
1756 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1757 // CHECK11: omp.loop.exit:
1758 // CHECK11-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1759 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP11]], align 4
1760 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP12]])
1761 // CHECK11-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR4]]
1762 // CHECK11-NEXT: [[ARRAY_BEGIN4:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1763 // CHECK11-NEXT: [[TMP13:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN4]], i32 2
1764 // CHECK11-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1765 // CHECK11: arraydestroy.body:
1766 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP13]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1767 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1768 // CHECK11-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
1769 // CHECK11-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN4]]
1770 // CHECK11-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE5:%.*]], label [[ARRAYDESTROY_BODY]]
1771 // CHECK11: arraydestroy.done5:
1772 // CHECK11-NEXT: ret void
1775 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.omp_outlined.omp_outlined
1776 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[DOTPREVIOUS_LB_:%.*]], i32 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR3]] {
1777 // CHECK11-NEXT: entry:
1778 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1779 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1780 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i32, align 4
1781 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i32, align 4
1782 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1783 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
1784 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca ptr, align 4
1785 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1786 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1787 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1788 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1789 // CHECK11-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
1790 // CHECK11-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
1791 // CHECK11-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
1792 // CHECK11-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
1793 // CHECK11-NEXT: [[_TMP2:%.*]] = alloca ptr, align 4
1794 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
1795 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1796 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1797 // CHECK11-NEXT: store i32 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 4
1798 // CHECK11-NEXT: store i32 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 4
1799 // CHECK11-NEXT: store ptr undef, ptr [[_TMP1]], align 4
1800 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1801 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
1802 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTPREVIOUS_LB__ADDR]], align 4
1803 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTPREVIOUS_UB__ADDR]], align 4
1804 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_LB]], align 4
1805 // CHECK11-NEXT: store i32 [[TMP1]], ptr [[DOTOMP_UB]], align 4
1806 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1807 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1808 // CHECK11-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1809 // CHECK11-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i32 2
1810 // CHECK11-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
1811 // CHECK11: arrayctor.loop:
1812 // CHECK11-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
1813 // CHECK11-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
1814 // CHECK11-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYCTOR_CUR]], i32 1
1815 // CHECK11-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
1816 // CHECK11-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
1817 // CHECK11: arrayctor.cont:
1818 // CHECK11-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
1819 // CHECK11-NEXT: store ptr [[VAR]], ptr [[_TMP2]], align 4
1820 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1821 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1822 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1823 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1824 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
1825 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1826 // CHECK11: cond.true:
1827 // CHECK11-NEXT: br label [[COND_END:%.*]]
1828 // CHECK11: cond.false:
1829 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1830 // CHECK11-NEXT: br label [[COND_END]]
1831 // CHECK11: cond.end:
1832 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1833 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1834 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1835 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1836 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1837 // CHECK11: omp.inner.for.cond:
1838 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1839 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1840 // CHECK11-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1841 // CHECK11-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1842 // CHECK11: omp.inner.for.cond.cleanup:
1843 // CHECK11-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1844 // CHECK11: omp.inner.for.body:
1845 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1846 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1847 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1848 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1849 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[T_VAR]], align 4
1850 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4
1851 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC]], i32 0, i32 [[TMP11]]
1852 // CHECK11-NEXT: store i32 [[TMP10]], ptr [[ARRAYIDX]], align 4
1853 // CHECK11-NEXT: [[TMP12:%.*]] = load ptr, ptr [[_TMP2]], align 4
1854 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[I]], align 4
1855 // CHECK11-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 [[TMP13]]
1856 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[ARRAYIDX4]], ptr align 4 [[TMP12]], i32 4, i1 false)
1857 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1858 // CHECK11: omp.body.continue:
1859 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1860 // CHECK11: omp.inner.for.inc:
1861 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1862 // CHECK11-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP14]], 1
1863 // CHECK11-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4
1864 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]]
1865 // CHECK11: omp.inner.for.end:
1866 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1867 // CHECK11: omp.loop.exit:
1868 // CHECK11-NEXT: [[TMP15:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1869 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[TMP15]], align 4
1870 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP16]])
1871 // CHECK11-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR4]]
1872 // CHECK11-NEXT: [[ARRAY_BEGIN6:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1873 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN6]], i32 2
1874 // CHECK11-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1875 // CHECK11: arraydestroy.body:
1876 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP17]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1877 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1878 // CHECK11-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
1879 // CHECK11-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN6]]
1880 // CHECK11-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE7:%.*]], label [[ARRAYDESTROY_BODY]]
1881 // CHECK11: arraydestroy.done7:
1882 // CHECK11-NEXT: ret void
1885 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIiED1Ev
1886 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1887 // CHECK11-NEXT: entry:
1888 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1889 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1890 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1891 // CHECK11-NEXT: call void @_ZN1SIiED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR4]]
1892 // CHECK11-NEXT: ret void
1895 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ev
1896 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1897 // CHECK11-NEXT: entry:
1898 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1899 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1900 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1901 // CHECK11-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
1902 // CHECK11-NEXT: store i32 0, ptr [[F]], align 4
1903 // CHECK11-NEXT: ret void
1906 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ei
1907 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1908 // CHECK11-NEXT: entry:
1909 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1910 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1911 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1912 // CHECK11-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1913 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1914 // CHECK11-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
1915 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
1916 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[F]], align 4
1917 // CHECK11-NEXT: ret void
1920 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIiED2Ev
1921 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1922 // CHECK11-NEXT: entry:
1923 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1924 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1925 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1926 // CHECK11-NEXT: ret void
1929 // CHECK11-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1930 // CHECK11-SAME: () #[[ATTR6:[0-9]+]] {
1931 // CHECK11-NEXT: entry:
1932 // CHECK11-NEXT: call void @__tgt_register_requires(i64 1)
1933 // CHECK11-NEXT: ret void