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 -DCHECK -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK1
3 // RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
4 // RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK1
5 // RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK3
6 // RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
7 // RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK3
9 // RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
10 // RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
11 // RUN: %clang_cc1 -DCHECK -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 - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
12 // RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
13 // RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
14 // RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
16 // 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 - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK9
17 // 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 -Wno-openmp-mapping
18 // RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK9
20 // 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 - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
21 // 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 -Wno-openmp-mapping
22 // RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
24 // expected-no-diagnostics
31 St(const St
&st
) : a(st
.a
+ st
.b
), b(0) {}
35 volatile int g
= 1212;
43 S(const S
&s
, St t
= St()) : f(s
.f
+ t
.a
) {}
44 operator T() { return T(); }
54 S
<T
> s_arr
[] = {1, 2};
57 #pragma omp teams distribute firstprivate(t_var, vec, s_arr, var)
58 for (int i
= 0; i
< 2; ++i
) {
68 S
<float> s_arr
[] = {1, 2};
76 #pragma omp teams distribute firstprivate(g, g1, sivar)
77 for (int i
= 0; i
< 2; ++i
) {
79 // Skip global and bound tid vars
95 #pragma omp teams distribute firstprivate(t_var, vec, s_arr, var, sivar)
96 for (int i
= 0; i
< 2; ++i
) {
109 // Skip global and bound tid vars
110 // Skip temp vars for loop
118 // firstprivate vec(vec): copy from *_addr into priv1 and then from priv1 into priv2
120 // firstprivate(s_arr)
129 // Skip global and bound tid vars
130 // Skip temp vars for loop
135 // T_VAR and preparation variables
137 // firstprivate vec(vec): copy from *_addr into priv1 and then from priv1 into priv2
139 // firstprivate(s_arr)
145 // CHECK1-LABEL: define {{[^@]+}}@__cxx_global_var_init
146 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
147 // CHECK1-NEXT: entry:
148 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) @test)
149 // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @_ZN1SIfED1Ev, ptr @test, ptr @__dso_handle) #[[ATTR2:[0-9]+]]
150 // CHECK1-NEXT: ret void
153 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ev
154 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat {
155 // CHECK1-NEXT: entry:
156 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
157 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
158 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
159 // CHECK1-NEXT: call void @_ZN1SIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
160 // CHECK1-NEXT: ret void
163 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfED1Ev
164 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
165 // CHECK1-NEXT: entry:
166 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
167 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
168 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
169 // CHECK1-NEXT: call void @_ZN1SIfED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR2]]
170 // CHECK1-NEXT: ret void
173 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ev
174 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
175 // CHECK1-NEXT: entry:
176 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
177 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
178 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
179 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
180 // CHECK1-NEXT: [[TMP0:%.*]] = load volatile i32, ptr @g, align 4
181 // CHECK1-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP0]] to float
182 // CHECK1-NEXT: store float [[CONV]], ptr [[F]], align 4
183 // CHECK1-NEXT: ret void
186 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfED2Ev
187 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
188 // CHECK1-NEXT: entry:
189 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
190 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
191 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
192 // CHECK1-NEXT: ret void
195 // CHECK1-LABEL: define {{[^@]+}}@__cxx_global_var_init.1
196 // CHECK1-SAME: () #[[ATTR0]] {
197 // CHECK1-NEXT: entry:
198 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) @s_arr, float noundef 1.000000e+00)
199 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds ([[STRUCT_S:%.*]], ptr @s_arr, i64 1), float noundef 2.000000e+00)
200 // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @__cxx_global_array_dtor, ptr null, ptr @__dso_handle) #[[ATTR2]]
201 // CHECK1-NEXT: ret void
204 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ef
205 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
206 // CHECK1-NEXT: entry:
207 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
208 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
209 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
210 // CHECK1-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
211 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
212 // CHECK1-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
213 // CHECK1-NEXT: call void @_ZN1SIfEC2Ef(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], float noundef [[TMP0]])
214 // CHECK1-NEXT: ret void
217 // CHECK1-LABEL: define {{[^@]+}}@__cxx_global_array_dtor
218 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]]) #[[ATTR0]] {
219 // CHECK1-NEXT: entry:
220 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
221 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
222 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
223 // CHECK1: arraydestroy.body:
224 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ getelementptr inbounds ([[STRUCT_S:%.*]], ptr @s_arr, i64 2), [[ENTRY:%.*]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
225 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
226 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
227 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], @s_arr
228 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE1:%.*]], label [[ARRAYDESTROY_BODY]]
229 // CHECK1: arraydestroy.done1:
230 // CHECK1-NEXT: ret void
233 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ef
234 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
235 // CHECK1-NEXT: entry:
236 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
237 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
238 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
239 // CHECK1-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
240 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
241 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
242 // CHECK1-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
243 // CHECK1-NEXT: [[TMP1:%.*]] = load volatile i32, ptr @g, align 4
244 // CHECK1-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to float
245 // CHECK1-NEXT: [[ADD:%.*]] = fadd float [[TMP0]], [[CONV]]
246 // CHECK1-NEXT: store float [[ADD]], ptr [[F]], align 4
247 // CHECK1-NEXT: ret void
250 // CHECK1-LABEL: define {{[^@]+}}@__cxx_global_var_init.2
251 // CHECK1-SAME: () #[[ATTR0]] {
252 // CHECK1-NEXT: entry:
253 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) @var, float noundef 3.000000e+00)
254 // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @_ZN1SIfED1Ev, ptr @var, ptr @__dso_handle) #[[ATTR2]]
255 // CHECK1-NEXT: ret void
258 // CHECK1-LABEL: define {{[^@]+}}@main
259 // CHECK1-SAME: () #[[ATTR3:[0-9]+]] {
260 // CHECK1-NEXT: entry:
261 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
262 // CHECK1-NEXT: [[T_VAR_CASTED:%.*]] = alloca i64, align 8
263 // CHECK1-NEXT: [[SIVAR_CASTED:%.*]] = alloca i64, align 8
264 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [5 x ptr], align 8
265 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [5 x ptr], align 8
266 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [5 x ptr], align 8
267 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
268 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
269 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
270 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr @t_var, align 4
271 // CHECK1-NEXT: store i32 [[TMP0]], ptr [[T_VAR_CASTED]], align 4
272 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[T_VAR_CASTED]], align 8
273 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr @_ZZ4mainE5sivar, align 4
274 // CHECK1-NEXT: store i32 [[TMP2]], ptr [[SIVAR_CASTED]], align 4
275 // CHECK1-NEXT: [[TMP3:%.*]] = load i64, ptr [[SIVAR_CASTED]], align 8
276 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
277 // CHECK1-NEXT: store i64 [[TMP1]], ptr [[TMP4]], align 8
278 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
279 // CHECK1-NEXT: store i64 [[TMP1]], ptr [[TMP5]], align 8
280 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
281 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
282 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
283 // CHECK1-NEXT: store ptr @vec, ptr [[TMP7]], align 8
284 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
285 // CHECK1-NEXT: store ptr @vec, ptr [[TMP8]], align 8
286 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
287 // CHECK1-NEXT: store ptr null, ptr [[TMP9]], align 8
288 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
289 // CHECK1-NEXT: store ptr @s_arr, ptr [[TMP10]], align 8
290 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
291 // CHECK1-NEXT: store ptr @s_arr, ptr [[TMP11]], align 8
292 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
293 // CHECK1-NEXT: store ptr null, ptr [[TMP12]], align 8
294 // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
295 // CHECK1-NEXT: store ptr @var, ptr [[TMP13]], align 8
296 // CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
297 // CHECK1-NEXT: store ptr @var, ptr [[TMP14]], align 8
298 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 3
299 // CHECK1-NEXT: store ptr null, ptr [[TMP15]], align 8
300 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 4
301 // CHECK1-NEXT: store i64 [[TMP3]], ptr [[TMP16]], align 8
302 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 4
303 // CHECK1-NEXT: store i64 [[TMP3]], ptr [[TMP17]], align 8
304 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 4
305 // CHECK1-NEXT: store ptr null, ptr [[TMP18]], align 8
306 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
307 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
308 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
309 // CHECK1-NEXT: store i32 2, ptr [[TMP21]], align 4
310 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
311 // CHECK1-NEXT: store i32 5, ptr [[TMP22]], align 4
312 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
313 // CHECK1-NEXT: store ptr [[TMP19]], ptr [[TMP23]], align 8
314 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
315 // CHECK1-NEXT: store ptr [[TMP20]], ptr [[TMP24]], align 8
316 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
317 // CHECK1-NEXT: store ptr @.offload_sizes, ptr [[TMP25]], align 8
318 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
319 // CHECK1-NEXT: store ptr @.offload_maptypes, ptr [[TMP26]], align 8
320 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
321 // CHECK1-NEXT: store ptr null, ptr [[TMP27]], align 8
322 // CHECK1-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
323 // CHECK1-NEXT: store ptr null, ptr [[TMP28]], align 8
324 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
325 // CHECK1-NEXT: store i64 2, ptr [[TMP29]], align 8
326 // CHECK1-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
327 // CHECK1-NEXT: store i64 0, ptr [[TMP30]], align 8
328 // CHECK1-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
329 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP31]], align 4
330 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
331 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP32]], align 4
332 // CHECK1-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
333 // CHECK1-NEXT: store i32 0, ptr [[TMP33]], align 4
334 // CHECK1-NEXT: [[TMP34:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l94.region_id, ptr [[KERNEL_ARGS]])
335 // CHECK1-NEXT: [[TMP35:%.*]] = icmp ne i32 [[TMP34]], 0
336 // CHECK1-NEXT: br i1 [[TMP35]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
337 // CHECK1: omp_offload.failed:
338 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l94(i64 [[TMP1]], ptr @vec, ptr @s_arr, ptr @var, i64 [[TMP3]]) #[[ATTR2]]
339 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
340 // CHECK1: omp_offload.cont:
341 // CHECK1-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiET_v()
342 // CHECK1-NEXT: ret i32 [[CALL]]
345 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l94
346 // CHECK1-SAME: (i64 noundef [[T_VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[VEC:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[S_ARR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR:%.*]], i64 noundef [[SIVAR:%.*]]) #[[ATTR4:[0-9]+]] {
347 // CHECK1-NEXT: entry:
348 // CHECK1-NEXT: [[T_VAR_ADDR:%.*]] = alloca i64, align 8
349 // CHECK1-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 8
350 // CHECK1-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 8
351 // CHECK1-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 8
352 // CHECK1-NEXT: [[SIVAR_ADDR:%.*]] = alloca i64, align 8
353 // CHECK1-NEXT: [[T_VAR_CASTED:%.*]] = alloca i64, align 8
354 // CHECK1-NEXT: [[SIVAR_CASTED:%.*]] = alloca i64, align 8
355 // CHECK1-NEXT: store i64 [[T_VAR]], ptr [[T_VAR_ADDR]], align 8
356 // CHECK1-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 8
357 // CHECK1-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 8
358 // CHECK1-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 8
359 // CHECK1-NEXT: store i64 [[SIVAR]], ptr [[SIVAR_ADDR]], align 8
360 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VEC_ADDR]], align 8
361 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 8
362 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR_ADDR]], align 8
363 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[T_VAR_ADDR]], align 4
364 // CHECK1-NEXT: store i32 [[TMP3]], ptr [[T_VAR_CASTED]], align 4
365 // CHECK1-NEXT: [[TMP4:%.*]] = load i64, ptr [[T_VAR_CASTED]], align 8
366 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[SIVAR_ADDR]], align 4
367 // CHECK1-NEXT: store i32 [[TMP5]], ptr [[SIVAR_CASTED]], align 4
368 // CHECK1-NEXT: [[TMP6:%.*]] = load i64, ptr [[SIVAR_CASTED]], align 8
369 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 5, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l94.omp_outlined, ptr [[TMP0]], i64 [[TMP4]], ptr [[TMP1]], ptr [[TMP2]], i64 [[TMP6]])
370 // CHECK1-NEXT: ret void
373 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l94.omp_outlined
374 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[VEC:%.*]], i64 noundef [[T_VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[S_ARR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR:%.*]], i64 noundef [[SIVAR:%.*]]) #[[ATTR5:[0-9]+]] {
375 // CHECK1-NEXT: entry:
376 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
377 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
378 // CHECK1-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 8
379 // CHECK1-NEXT: [[T_VAR_ADDR:%.*]] = alloca i64, align 8
380 // CHECK1-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 8
381 // CHECK1-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 8
382 // CHECK1-NEXT: [[SIVAR_ADDR:%.*]] = alloca i64, align 8
383 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
384 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
385 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
386 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
387 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
388 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
389 // CHECK1-NEXT: [[VEC1:%.*]] = alloca [2 x i32], align 4
390 // CHECK1-NEXT: [[S_ARR2:%.*]] = alloca [2 x %struct.S], align 4
391 // CHECK1-NEXT: [[AGG_TMP:%.*]] = alloca [[STRUCT_ST:%.*]], align 4
392 // CHECK1-NEXT: [[VAR4:%.*]] = alloca [[STRUCT_S:%.*]], align 4
393 // CHECK1-NEXT: [[AGG_TMP5:%.*]] = alloca [[STRUCT_ST]], align 4
394 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
395 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
396 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
397 // CHECK1-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 8
398 // CHECK1-NEXT: store i64 [[T_VAR]], ptr [[T_VAR_ADDR]], align 8
399 // CHECK1-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 8
400 // CHECK1-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 8
401 // CHECK1-NEXT: store i64 [[SIVAR]], ptr [[SIVAR_ADDR]], align 8
402 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VEC_ADDR]], align 8
403 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 8
404 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR_ADDR]], align 8
405 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
406 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
407 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
408 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
409 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VEC1]], ptr align 4 [[TMP0]], i64 8, i1 false)
410 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR2]], i32 0, i32 0
411 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i64 2
412 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP3]]
413 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE3:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
414 // CHECK1: omp.arraycpy.body:
415 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP1]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
416 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
417 // CHECK1-NEXT: call void @_ZN2StC1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP]])
418 // CHECK1-NEXT: call void @_ZN1SIfEC1ERKS0_2St(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]], ptr noundef [[AGG_TMP]])
419 // CHECK1-NEXT: call void @_ZN2StD1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP]]) #[[ATTR2]]
420 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
421 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
422 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP3]]
423 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE3]], label [[OMP_ARRAYCPY_BODY]]
424 // CHECK1: omp.arraycpy.done3:
425 // CHECK1-NEXT: call void @_ZN2StC1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP5]])
426 // CHECK1-NEXT: call void @_ZN1SIfEC1ERKS0_2St(ptr noundef nonnull align 4 dereferenceable(4) [[VAR4]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP2]], ptr noundef [[AGG_TMP5]])
427 // CHECK1-NEXT: call void @_ZN2StD1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP5]]) #[[ATTR2]]
428 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
429 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP4]], align 4
430 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP5]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
431 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
432 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP6]], 1
433 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
434 // CHECK1: cond.true:
435 // CHECK1-NEXT: br label [[COND_END:%.*]]
436 // CHECK1: cond.false:
437 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
438 // CHECK1-NEXT: br label [[COND_END]]
440 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
441 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
442 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
443 // CHECK1-NEXT: store i32 [[TMP8]], ptr [[DOTOMP_IV]], align 4
444 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
445 // CHECK1: omp.inner.for.cond:
446 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
447 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
448 // CHECK1-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
449 // CHECK1-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
450 // CHECK1: omp.inner.for.cond.cleanup:
451 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
452 // CHECK1: omp.inner.for.body:
453 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
454 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
455 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
456 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
457 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[T_VAR_ADDR]], align 4
458 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[I]], align 4
459 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP13]] to i64
460 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC1]], i64 0, i64 [[IDXPROM]]
461 // CHECK1-NEXT: store i32 [[TMP12]], ptr [[ARRAYIDX]], align 4
462 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[I]], align 4
463 // CHECK1-NEXT: [[IDXPROM7:%.*]] = sext i32 [[TMP14]] to i64
464 // CHECK1-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR2]], i64 0, i64 [[IDXPROM7]]
465 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX8]], ptr align 4 [[VAR4]], i64 4, i1 false)
466 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[I]], align 4
467 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[SIVAR_ADDR]], align 4
468 // CHECK1-NEXT: [[ADD9:%.*]] = add nsw i32 [[TMP16]], [[TMP15]]
469 // CHECK1-NEXT: store i32 [[ADD9]], ptr [[SIVAR_ADDR]], align 4
470 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
471 // CHECK1: omp.body.continue:
472 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
473 // CHECK1: omp.inner.for.inc:
474 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
475 // CHECK1-NEXT: [[ADD10:%.*]] = add nsw i32 [[TMP17]], 1
476 // CHECK1-NEXT: store i32 [[ADD10]], ptr [[DOTOMP_IV]], align 4
477 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
478 // CHECK1: omp.inner.for.end:
479 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
480 // CHECK1: omp.loop.exit:
481 // CHECK1-NEXT: [[TMP18:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
482 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP18]], align 4
483 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP19]])
484 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR4]]) #[[ATTR2]]
485 // CHECK1-NEXT: [[ARRAY_BEGIN11:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR2]], i32 0, i32 0
486 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN11]], i64 2
487 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
488 // CHECK1: arraydestroy.body:
489 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP20]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
490 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
491 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
492 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN11]]
493 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE12:%.*]], label [[ARRAYDESTROY_BODY]]
494 // CHECK1: arraydestroy.done12:
495 // CHECK1-NEXT: ret void
498 // CHECK1-LABEL: define {{[^@]+}}@_ZN2StC1Ev
499 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(8) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
500 // CHECK1-NEXT: entry:
501 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
502 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
503 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
504 // CHECK1-NEXT: call void @_ZN2StC2Ev(ptr noundef nonnull align 4 dereferenceable(8) [[THIS1]])
505 // CHECK1-NEXT: ret void
508 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC1ERKS0_2St
509 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[S:%.*]], ptr noundef [[T:%.*]]) unnamed_addr #[[ATTR1]] comdat {
510 // CHECK1-NEXT: entry:
511 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
512 // CHECK1-NEXT: [[S_ADDR:%.*]] = alloca ptr, align 8
513 // CHECK1-NEXT: [[T_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
514 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
515 // CHECK1-NEXT: store ptr [[S]], ptr [[S_ADDR]], align 8
516 // CHECK1-NEXT: store ptr [[T]], ptr [[T_INDIRECT_ADDR]], align 8
517 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
518 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[S_ADDR]], align 8
519 // CHECK1-NEXT: call void @_ZN1SIfEC2ERKS0_2St(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP0]], ptr noundef [[T]])
520 // CHECK1-NEXT: ret void
523 // CHECK1-LABEL: define {{[^@]+}}@_ZN2StD1Ev
524 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(8) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
525 // CHECK1-NEXT: entry:
526 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
527 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
528 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
529 // CHECK1-NEXT: call void @_ZN2StD2Ev(ptr noundef nonnull align 4 dereferenceable(8) [[THIS1]]) #[[ATTR2]]
530 // CHECK1-NEXT: ret void
533 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiET_v
534 // CHECK1-SAME: () #[[ATTR7:[0-9]+]] comdat {
535 // CHECK1-NEXT: entry:
536 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
537 // CHECK1-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
538 // CHECK1-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
539 // CHECK1-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
540 // CHECK1-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
541 // CHECK1-NEXT: [[VAR:%.*]] = alloca ptr, align 8
542 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
543 // CHECK1-NEXT: [[T_VAR_CASTED:%.*]] = alloca i64, align 8
544 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [4 x ptr], align 8
545 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [4 x ptr], align 8
546 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [4 x ptr], align 8
547 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
548 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
549 // CHECK1-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
550 // CHECK1-NEXT: store i32 0, ptr [[T_VAR]], align 4
551 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VEC]], ptr align 4 @__const._Z5tmainIiET_v.vec, i64 8, i1 false)
552 // CHECK1-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i64 0, i64 0
553 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], i32 noundef signext 1)
554 // CHECK1-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYINIT_BEGIN]], i64 1
555 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], i32 noundef signext 2)
556 // CHECK1-NEXT: store ptr [[TEST]], ptr [[VAR]], align 8
557 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR]], align 8
558 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[TMP]], align 8
559 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[T_VAR]], align 4
560 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[T_VAR_CASTED]], align 4
561 // CHECK1-NEXT: [[TMP2:%.*]] = load i64, ptr [[T_VAR_CASTED]], align 8
562 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 8
563 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[TMP]], align 8
564 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP]], align 8
565 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
566 // CHECK1-NEXT: store i64 [[TMP2]], ptr [[TMP6]], align 8
567 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
568 // CHECK1-NEXT: store i64 [[TMP2]], ptr [[TMP7]], align 8
569 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
570 // CHECK1-NEXT: store ptr null, ptr [[TMP8]], align 8
571 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
572 // CHECK1-NEXT: store ptr [[VEC]], ptr [[TMP9]], align 8
573 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
574 // CHECK1-NEXT: store ptr [[VEC]], ptr [[TMP10]], align 8
575 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
576 // CHECK1-NEXT: store ptr null, ptr [[TMP11]], align 8
577 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
578 // CHECK1-NEXT: store ptr [[S_ARR]], ptr [[TMP12]], align 8
579 // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
580 // CHECK1-NEXT: store ptr [[S_ARR]], ptr [[TMP13]], align 8
581 // CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
582 // CHECK1-NEXT: store ptr null, ptr [[TMP14]], align 8
583 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
584 // CHECK1-NEXT: store ptr [[TMP4]], ptr [[TMP15]], align 8
585 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
586 // CHECK1-NEXT: store ptr [[TMP5]], ptr [[TMP16]], align 8
587 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 3
588 // CHECK1-NEXT: store ptr null, ptr [[TMP17]], align 8
589 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
590 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
591 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
592 // CHECK1-NEXT: store i32 2, ptr [[TMP20]], align 4
593 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
594 // CHECK1-NEXT: store i32 4, ptr [[TMP21]], align 4
595 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
596 // CHECK1-NEXT: store ptr [[TMP18]], ptr [[TMP22]], align 8
597 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
598 // CHECK1-NEXT: store ptr [[TMP19]], ptr [[TMP23]], align 8
599 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
600 // CHECK1-NEXT: store ptr @.offload_sizes.3, ptr [[TMP24]], align 8
601 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
602 // CHECK1-NEXT: store ptr @.offload_maptypes.4, ptr [[TMP25]], align 8
603 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
604 // CHECK1-NEXT: store ptr null, ptr [[TMP26]], align 8
605 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
606 // CHECK1-NEXT: store ptr null, ptr [[TMP27]], align 8
607 // CHECK1-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
608 // CHECK1-NEXT: store i64 2, ptr [[TMP28]], align 8
609 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
610 // CHECK1-NEXT: store i64 0, ptr [[TMP29]], align 8
611 // CHECK1-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
612 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP30]], align 4
613 // CHECK1-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
614 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP31]], align 4
615 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
616 // CHECK1-NEXT: store i32 0, ptr [[TMP32]], align 4
617 // CHECK1-NEXT: [[TMP33:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56.region_id, ptr [[KERNEL_ARGS]])
618 // CHECK1-NEXT: [[TMP34:%.*]] = icmp ne i32 [[TMP33]], 0
619 // CHECK1-NEXT: br i1 [[TMP34]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
620 // CHECK1: omp_offload.failed:
621 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56(i64 [[TMP2]], ptr [[VEC]], ptr [[S_ARR]], ptr [[TMP3]]) #[[ATTR2]]
622 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
623 // CHECK1: omp_offload.cont:
624 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
625 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
626 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i64 2
627 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
628 // CHECK1: arraydestroy.body:
629 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP35]], [[OMP_OFFLOAD_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
630 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
631 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
632 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
633 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE2:%.*]], label [[ARRAYDESTROY_BODY]]
634 // CHECK1: arraydestroy.done2:
635 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR2]]
636 // CHECK1-NEXT: [[TMP36:%.*]] = load i32, ptr [[RETVAL]], align 4
637 // CHECK1-NEXT: ret i32 [[TMP36]]
640 // CHECK1-LABEL: define {{[^@]+}}@_ZN2StC2Ev
641 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(8) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
642 // CHECK1-NEXT: entry:
643 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
644 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
645 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
646 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], ptr [[THIS1]], i32 0, i32 0
647 // CHECK1-NEXT: store i32 0, ptr [[A]], align 4
648 // CHECK1-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_ST]], ptr [[THIS1]], i32 0, i32 1
649 // CHECK1-NEXT: store i32 0, ptr [[B]], align 4
650 // CHECK1-NEXT: ret void
653 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC2ERKS0_2St
654 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[S:%.*]], ptr noundef [[T:%.*]]) unnamed_addr #[[ATTR1]] comdat {
655 // CHECK1-NEXT: entry:
656 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
657 // CHECK1-NEXT: [[S_ADDR:%.*]] = alloca ptr, align 8
658 // CHECK1-NEXT: [[T_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
659 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
660 // CHECK1-NEXT: store ptr [[S]], ptr [[S_ADDR]], align 8
661 // CHECK1-NEXT: store ptr [[T]], ptr [[T_INDIRECT_ADDR]], align 8
662 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
663 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
664 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[S_ADDR]], align 8
665 // CHECK1-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[TMP0]], i32 0, i32 0
666 // CHECK1-NEXT: [[TMP1:%.*]] = load float, ptr [[F2]], align 4
667 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], ptr [[T]], i32 0, i32 0
668 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[A]], align 4
669 // CHECK1-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP2]] to float
670 // CHECK1-NEXT: [[ADD:%.*]] = fadd float [[TMP1]], [[CONV]]
671 // CHECK1-NEXT: store float [[ADD]], ptr [[F]], align 4
672 // CHECK1-NEXT: ret void
675 // CHECK1-LABEL: define {{[^@]+}}@_ZN2StD2Ev
676 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(8) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
677 // CHECK1-NEXT: entry:
678 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
679 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
680 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
681 // CHECK1-NEXT: ret void
684 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ev
685 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
686 // CHECK1-NEXT: entry:
687 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
688 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
689 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
690 // CHECK1-NEXT: call void @_ZN1SIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
691 // CHECK1-NEXT: ret void
694 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ei
695 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef signext [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
696 // CHECK1-NEXT: entry:
697 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
698 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
699 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
700 // CHECK1-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
701 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
702 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
703 // CHECK1-NEXT: call void @_ZN1SIiEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], i32 noundef signext [[TMP0]])
704 // CHECK1-NEXT: ret void
707 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56
708 // CHECK1-SAME: (i64 noundef [[T_VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[VEC:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[S_ARR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR:%.*]]) #[[ATTR4]] {
709 // CHECK1-NEXT: entry:
710 // CHECK1-NEXT: [[T_VAR_ADDR:%.*]] = alloca i64, align 8
711 // CHECK1-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 8
712 // CHECK1-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 8
713 // CHECK1-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 8
714 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
715 // CHECK1-NEXT: [[T_VAR_CASTED:%.*]] = alloca i64, align 8
716 // CHECK1-NEXT: store i64 [[T_VAR]], ptr [[T_VAR_ADDR]], align 8
717 // CHECK1-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 8
718 // CHECK1-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 8
719 // CHECK1-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 8
720 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VEC_ADDR]], align 8
721 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 8
722 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR_ADDR]], align 8
723 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[TMP]], align 8
724 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[T_VAR_ADDR]], align 4
725 // CHECK1-NEXT: store i32 [[TMP3]], ptr [[T_VAR_CASTED]], align 4
726 // CHECK1-NEXT: [[TMP4:%.*]] = load i64, ptr [[T_VAR_CASTED]], align 8
727 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP]], align 8
728 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56.omp_outlined, ptr [[TMP0]], i64 [[TMP4]], ptr [[TMP1]], ptr [[TMP5]])
729 // CHECK1-NEXT: ret void
732 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56.omp_outlined
733 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[VEC:%.*]], i64 noundef [[T_VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[S_ARR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR:%.*]]) #[[ATTR5]] {
734 // CHECK1-NEXT: entry:
735 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
736 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
737 // CHECK1-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 8
738 // CHECK1-NEXT: [[T_VAR_ADDR:%.*]] = alloca i64, align 8
739 // CHECK1-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 8
740 // CHECK1-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 8
741 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
742 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
743 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
744 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
745 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
746 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
747 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
748 // CHECK1-NEXT: [[VEC2:%.*]] = alloca [2 x i32], align 4
749 // CHECK1-NEXT: [[S_ARR3:%.*]] = alloca [2 x %struct.S.0], align 4
750 // CHECK1-NEXT: [[AGG_TMP:%.*]] = alloca [[STRUCT_ST:%.*]], align 4
751 // CHECK1-NEXT: [[VAR5:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
752 // CHECK1-NEXT: [[AGG_TMP6:%.*]] = alloca [[STRUCT_ST]], align 4
753 // CHECK1-NEXT: [[_TMP7:%.*]] = alloca ptr, align 8
754 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
755 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
756 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
757 // CHECK1-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 8
758 // CHECK1-NEXT: store i64 [[T_VAR]], ptr [[T_VAR_ADDR]], align 8
759 // CHECK1-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 8
760 // CHECK1-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 8
761 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VEC_ADDR]], align 8
762 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 8
763 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR_ADDR]], align 8
764 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[TMP]], align 8
765 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
766 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
767 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
768 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
769 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VEC2]], ptr align 4 [[TMP0]], i64 8, i1 false)
770 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR3]], i32 0, i32 0
771 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i64 2
772 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP3]]
773 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE4:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
774 // CHECK1: omp.arraycpy.body:
775 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP1]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
776 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
777 // CHECK1-NEXT: call void @_ZN2StC1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP]])
778 // CHECK1-NEXT: call void @_ZN1SIiEC1ERKS0_2St(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]], ptr noundef [[AGG_TMP]])
779 // CHECK1-NEXT: call void @_ZN2StD1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP]]) #[[ATTR2]]
780 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
781 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
782 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP3]]
783 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE4]], label [[OMP_ARRAYCPY_BODY]]
784 // CHECK1: omp.arraycpy.done4:
785 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[TMP]], align 8
786 // CHECK1-NEXT: call void @_ZN2StC1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP6]])
787 // CHECK1-NEXT: call void @_ZN1SIiEC1ERKS0_2St(ptr noundef nonnull align 4 dereferenceable(4) [[VAR5]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP4]], ptr noundef [[AGG_TMP6]])
788 // CHECK1-NEXT: call void @_ZN2StD1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP6]]) #[[ATTR2]]
789 // CHECK1-NEXT: store ptr [[VAR5]], ptr [[_TMP7]], align 8
790 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
791 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[TMP5]], align 4
792 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP6]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
793 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
794 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP7]], 1
795 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
796 // CHECK1: cond.true:
797 // CHECK1-NEXT: br label [[COND_END:%.*]]
798 // CHECK1: cond.false:
799 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
800 // CHECK1-NEXT: br label [[COND_END]]
802 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP8]], [[COND_FALSE]] ]
803 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
804 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
805 // CHECK1-NEXT: store i32 [[TMP9]], ptr [[DOTOMP_IV]], align 4
806 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
807 // CHECK1: omp.inner.for.cond:
808 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
809 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
810 // CHECK1-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP10]], [[TMP11]]
811 // CHECK1-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
812 // CHECK1: omp.inner.for.cond.cleanup:
813 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
814 // CHECK1: omp.inner.for.body:
815 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
816 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP12]], 1
817 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
818 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
819 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[T_VAR_ADDR]], align 4
820 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[I]], align 4
821 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP14]] to i64
822 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC2]], i64 0, i64 [[IDXPROM]]
823 // CHECK1-NEXT: store i32 [[TMP13]], ptr [[ARRAYIDX]], align 4
824 // CHECK1-NEXT: [[TMP15:%.*]] = load ptr, ptr [[_TMP7]], align 8
825 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[I]], align 4
826 // CHECK1-NEXT: [[IDXPROM9:%.*]] = sext i32 [[TMP16]] to i64
827 // CHECK1-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR3]], i64 0, i64 [[IDXPROM9]]
828 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX10]], ptr align 4 [[TMP15]], i64 4, i1 false)
829 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
830 // CHECK1: omp.body.continue:
831 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
832 // CHECK1: omp.inner.for.inc:
833 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
834 // CHECK1-NEXT: [[ADD11:%.*]] = add nsw i32 [[TMP17]], 1
835 // CHECK1-NEXT: store i32 [[ADD11]], ptr [[DOTOMP_IV]], align 4
836 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
837 // CHECK1: omp.inner.for.end:
838 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
839 // CHECK1: omp.loop.exit:
840 // CHECK1-NEXT: [[TMP18:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
841 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP18]], align 4
842 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP19]])
843 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR5]]) #[[ATTR2]]
844 // CHECK1-NEXT: [[ARRAY_BEGIN12:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR3]], i32 0, i32 0
845 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN12]], i64 2
846 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
847 // CHECK1: arraydestroy.body:
848 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP20]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
849 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
850 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
851 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN12]]
852 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE13:%.*]], label [[ARRAYDESTROY_BODY]]
853 // CHECK1: arraydestroy.done13:
854 // CHECK1-NEXT: ret void
857 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC1ERKS0_2St
858 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[S:%.*]], ptr noundef [[T:%.*]]) unnamed_addr #[[ATTR1]] comdat {
859 // CHECK1-NEXT: entry:
860 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
861 // CHECK1-NEXT: [[S_ADDR:%.*]] = alloca ptr, align 8
862 // CHECK1-NEXT: [[T_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
863 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
864 // CHECK1-NEXT: store ptr [[S]], ptr [[S_ADDR]], align 8
865 // CHECK1-NEXT: store ptr [[T]], ptr [[T_INDIRECT_ADDR]], align 8
866 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
867 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[S_ADDR]], align 8
868 // CHECK1-NEXT: call void @_ZN1SIiEC2ERKS0_2St(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP0]], ptr noundef [[T]])
869 // CHECK1-NEXT: ret void
872 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiED1Ev
873 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
874 // CHECK1-NEXT: entry:
875 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
876 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
877 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
878 // CHECK1-NEXT: call void @_ZN1SIiED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR2]]
879 // CHECK1-NEXT: ret void
882 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ev
883 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
884 // CHECK1-NEXT: entry:
885 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
886 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
887 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
888 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
889 // CHECK1-NEXT: [[TMP0:%.*]] = load volatile i32, ptr @g, align 4
890 // CHECK1-NEXT: store i32 [[TMP0]], ptr [[F]], align 4
891 // CHECK1-NEXT: ret void
894 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ei
895 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef signext [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
896 // CHECK1-NEXT: entry:
897 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
898 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
899 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
900 // CHECK1-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
901 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
902 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
903 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
904 // CHECK1-NEXT: [[TMP1:%.*]] = load volatile i32, ptr @g, align 4
905 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]]
906 // CHECK1-NEXT: store i32 [[ADD]], ptr [[F]], align 4
907 // CHECK1-NEXT: ret void
910 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC2ERKS0_2St
911 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[S:%.*]], ptr noundef [[T:%.*]]) unnamed_addr #[[ATTR1]] comdat {
912 // CHECK1-NEXT: entry:
913 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
914 // CHECK1-NEXT: [[S_ADDR:%.*]] = alloca ptr, align 8
915 // CHECK1-NEXT: [[T_INDIRECT_ADDR:%.*]] = alloca ptr, align 8
916 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
917 // CHECK1-NEXT: store ptr [[S]], ptr [[S_ADDR]], align 8
918 // CHECK1-NEXT: store ptr [[T]], ptr [[T_INDIRECT_ADDR]], align 8
919 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
920 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
921 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[S_ADDR]], align 8
922 // CHECK1-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[TMP0]], i32 0, i32 0
923 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[F2]], align 4
924 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], ptr [[T]], i32 0, i32 0
925 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[A]], align 4
926 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP2]]
927 // CHECK1-NEXT: store i32 [[ADD]], ptr [[F]], align 4
928 // CHECK1-NEXT: ret void
931 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiED2Ev
932 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
933 // CHECK1-NEXT: entry:
934 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
935 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
936 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
937 // CHECK1-NEXT: ret void
940 // CHECK1-LABEL: define {{[^@]+}}@_GLOBAL__sub_I_teams_distribute_firstprivate_codegen.cpp
941 // CHECK1-SAME: () #[[ATTR0]] {
942 // CHECK1-NEXT: entry:
943 // CHECK1-NEXT: call void @__cxx_global_var_init()
944 // CHECK1-NEXT: call void @__cxx_global_var_init.1()
945 // CHECK1-NEXT: call void @__cxx_global_var_init.2()
946 // CHECK1-NEXT: ret void
949 // CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
950 // CHECK1-SAME: () #[[ATTR0]] {
951 // CHECK1-NEXT: entry:
952 // CHECK1-NEXT: call void @__tgt_register_requires(i64 1)
953 // CHECK1-NEXT: ret void
956 // CHECK3-LABEL: define {{[^@]+}}@__cxx_global_var_init
957 // CHECK3-SAME: () #[[ATTR0:[0-9]+]] {
958 // CHECK3-NEXT: entry:
959 // CHECK3-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) @test)
960 // CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @_ZN1SIfED1Ev, ptr @test, ptr @__dso_handle) #[[ATTR2:[0-9]+]]
961 // CHECK3-NEXT: ret void
964 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ev
965 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat align 2 {
966 // CHECK3-NEXT: entry:
967 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
968 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
969 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
970 // CHECK3-NEXT: call void @_ZN1SIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
971 // CHECK3-NEXT: ret void
974 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfED1Ev
975 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
976 // CHECK3-NEXT: entry:
977 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
978 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
979 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
980 // CHECK3-NEXT: call void @_ZN1SIfED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR2]]
981 // CHECK3-NEXT: ret void
984 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ev
985 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
986 // CHECK3-NEXT: entry:
987 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
988 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
989 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
990 // CHECK3-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
991 // CHECK3-NEXT: [[TMP0:%.*]] = load volatile i32, ptr @g, align 4
992 // CHECK3-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP0]] to float
993 // CHECK3-NEXT: store float [[CONV]], ptr [[F]], align 4
994 // CHECK3-NEXT: ret void
997 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfED2Ev
998 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
999 // CHECK3-NEXT: entry:
1000 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1001 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1002 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1003 // CHECK3-NEXT: ret void
1006 // CHECK3-LABEL: define {{[^@]+}}@__cxx_global_var_init.1
1007 // CHECK3-SAME: () #[[ATTR0]] {
1008 // CHECK3-NEXT: entry:
1009 // CHECK3-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) @s_arr, float noundef 1.000000e+00)
1010 // CHECK3-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds ([[STRUCT_S:%.*]], ptr @s_arr, i32 1), float noundef 2.000000e+00)
1011 // CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @__cxx_global_array_dtor, ptr null, ptr @__dso_handle) #[[ATTR2]]
1012 // CHECK3-NEXT: ret void
1015 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ef
1016 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1017 // CHECK3-NEXT: entry:
1018 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1019 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
1020 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1021 // CHECK3-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
1022 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1023 // CHECK3-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
1024 // CHECK3-NEXT: call void @_ZN1SIfEC2Ef(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], float noundef [[TMP0]])
1025 // CHECK3-NEXT: ret void
1028 // CHECK3-LABEL: define {{[^@]+}}@__cxx_global_array_dtor
1029 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]]) #[[ATTR0]] {
1030 // CHECK3-NEXT: entry:
1031 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
1032 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
1033 // CHECK3-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1034 // CHECK3: arraydestroy.body:
1035 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ getelementptr inbounds ([[STRUCT_S:%.*]], ptr @s_arr, i32 2), [[ENTRY:%.*]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1036 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1037 // CHECK3-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
1038 // CHECK3-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], @s_arr
1039 // CHECK3-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE1:%.*]], label [[ARRAYDESTROY_BODY]]
1040 // CHECK3: arraydestroy.done1:
1041 // CHECK3-NEXT: ret void
1044 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ef
1045 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1046 // CHECK3-NEXT: entry:
1047 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1048 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
1049 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1050 // CHECK3-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
1051 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1052 // CHECK3-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
1053 // CHECK3-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
1054 // CHECK3-NEXT: [[TMP1:%.*]] = load volatile i32, ptr @g, align 4
1055 // CHECK3-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to float
1056 // CHECK3-NEXT: [[ADD:%.*]] = fadd float [[TMP0]], [[CONV]]
1057 // CHECK3-NEXT: store float [[ADD]], ptr [[F]], align 4
1058 // CHECK3-NEXT: ret void
1061 // CHECK3-LABEL: define {{[^@]+}}@__cxx_global_var_init.2
1062 // CHECK3-SAME: () #[[ATTR0]] {
1063 // CHECK3-NEXT: entry:
1064 // CHECK3-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) @var, float noundef 3.000000e+00)
1065 // CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @_ZN1SIfED1Ev, ptr @var, ptr @__dso_handle) #[[ATTR2]]
1066 // CHECK3-NEXT: ret void
1069 // CHECK3-LABEL: define {{[^@]+}}@main
1070 // CHECK3-SAME: () #[[ATTR3:[0-9]+]] {
1071 // CHECK3-NEXT: entry:
1072 // CHECK3-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
1073 // CHECK3-NEXT: [[T_VAR_CASTED:%.*]] = alloca i32, align 4
1074 // CHECK3-NEXT: [[SIVAR_CASTED:%.*]] = alloca i32, align 4
1075 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [5 x ptr], align 4
1076 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [5 x ptr], align 4
1077 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [5 x ptr], align 4
1078 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
1079 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1080 // CHECK3-NEXT: store i32 0, ptr [[RETVAL]], align 4
1081 // CHECK3-NEXT: [[TMP0:%.*]] = load i32, ptr @t_var, align 4
1082 // CHECK3-NEXT: store i32 [[TMP0]], ptr [[T_VAR_CASTED]], align 4
1083 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[T_VAR_CASTED]], align 4
1084 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr @_ZZ4mainE5sivar, align 4
1085 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[SIVAR_CASTED]], align 4
1086 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[SIVAR_CASTED]], align 4
1087 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1088 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[TMP4]], align 4
1089 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1090 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[TMP5]], align 4
1091 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
1092 // CHECK3-NEXT: store ptr null, ptr [[TMP6]], align 4
1093 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
1094 // CHECK3-NEXT: store ptr @vec, ptr [[TMP7]], align 4
1095 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
1096 // CHECK3-NEXT: store ptr @vec, ptr [[TMP8]], align 4
1097 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
1098 // CHECK3-NEXT: store ptr null, ptr [[TMP9]], align 4
1099 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
1100 // CHECK3-NEXT: store ptr @s_arr, ptr [[TMP10]], align 4
1101 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
1102 // CHECK3-NEXT: store ptr @s_arr, ptr [[TMP11]], align 4
1103 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
1104 // CHECK3-NEXT: store ptr null, ptr [[TMP12]], align 4
1105 // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
1106 // CHECK3-NEXT: store ptr @var, ptr [[TMP13]], align 4
1107 // CHECK3-NEXT: [[TMP14:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
1108 // CHECK3-NEXT: store ptr @var, ptr [[TMP14]], align 4
1109 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 3
1110 // CHECK3-NEXT: store ptr null, ptr [[TMP15]], align 4
1111 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 4
1112 // CHECK3-NEXT: store i32 [[TMP3]], ptr [[TMP16]], align 4
1113 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 4
1114 // CHECK3-NEXT: store i32 [[TMP3]], ptr [[TMP17]], align 4
1115 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 4
1116 // CHECK3-NEXT: store ptr null, ptr [[TMP18]], align 4
1117 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1118 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1119 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1120 // CHECK3-NEXT: store i32 2, ptr [[TMP21]], align 4
1121 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1122 // CHECK3-NEXT: store i32 5, ptr [[TMP22]], align 4
1123 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1124 // CHECK3-NEXT: store ptr [[TMP19]], ptr [[TMP23]], align 4
1125 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1126 // CHECK3-NEXT: store ptr [[TMP20]], ptr [[TMP24]], align 4
1127 // CHECK3-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1128 // CHECK3-NEXT: store ptr @.offload_sizes, ptr [[TMP25]], align 4
1129 // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1130 // CHECK3-NEXT: store ptr @.offload_maptypes, ptr [[TMP26]], align 4
1131 // CHECK3-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1132 // CHECK3-NEXT: store ptr null, ptr [[TMP27]], align 4
1133 // CHECK3-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1134 // CHECK3-NEXT: store ptr null, ptr [[TMP28]], align 4
1135 // CHECK3-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1136 // CHECK3-NEXT: store i64 2, ptr [[TMP29]], align 8
1137 // CHECK3-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1138 // CHECK3-NEXT: store i64 0, ptr [[TMP30]], align 8
1139 // CHECK3-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1140 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP31]], align 4
1141 // CHECK3-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1142 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP32]], align 4
1143 // CHECK3-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1144 // CHECK3-NEXT: store i32 0, ptr [[TMP33]], align 4
1145 // CHECK3-NEXT: [[TMP34:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l94.region_id, ptr [[KERNEL_ARGS]])
1146 // CHECK3-NEXT: [[TMP35:%.*]] = icmp ne i32 [[TMP34]], 0
1147 // CHECK3-NEXT: br i1 [[TMP35]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1148 // CHECK3: omp_offload.failed:
1149 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l94(i32 [[TMP1]], ptr @vec, ptr @s_arr, ptr @var, i32 [[TMP3]]) #[[ATTR2]]
1150 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
1151 // CHECK3: omp_offload.cont:
1152 // CHECK3-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiET_v()
1153 // CHECK3-NEXT: ret i32 [[CALL]]
1156 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l94
1157 // CHECK3-SAME: (i32 noundef [[T_VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[VEC:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[S_ARR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR:%.*]], i32 noundef [[SIVAR:%.*]]) #[[ATTR4:[0-9]+]] {
1158 // CHECK3-NEXT: entry:
1159 // CHECK3-NEXT: [[T_VAR_ADDR:%.*]] = alloca i32, align 4
1160 // CHECK3-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 4
1161 // CHECK3-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 4
1162 // CHECK3-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 4
1163 // CHECK3-NEXT: [[SIVAR_ADDR:%.*]] = alloca i32, align 4
1164 // CHECK3-NEXT: [[T_VAR_CASTED:%.*]] = alloca i32, align 4
1165 // CHECK3-NEXT: [[SIVAR_CASTED:%.*]] = alloca i32, align 4
1166 // CHECK3-NEXT: store i32 [[T_VAR]], ptr [[T_VAR_ADDR]], align 4
1167 // CHECK3-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 4
1168 // CHECK3-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 4
1169 // CHECK3-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 4
1170 // CHECK3-NEXT: store i32 [[SIVAR]], ptr [[SIVAR_ADDR]], align 4
1171 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VEC_ADDR]], align 4
1172 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 4
1173 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR_ADDR]], align 4
1174 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[T_VAR_ADDR]], align 4
1175 // CHECK3-NEXT: store i32 [[TMP3]], ptr [[T_VAR_CASTED]], align 4
1176 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[T_VAR_CASTED]], align 4
1177 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[SIVAR_ADDR]], align 4
1178 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[SIVAR_CASTED]], align 4
1179 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[SIVAR_CASTED]], align 4
1180 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 5, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l94.omp_outlined, ptr [[TMP0]], i32 [[TMP4]], ptr [[TMP1]], ptr [[TMP2]], i32 [[TMP6]])
1181 // CHECK3-NEXT: ret void
1184 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l94.omp_outlined
1185 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[VEC:%.*]], i32 noundef [[T_VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[S_ARR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR:%.*]], i32 noundef [[SIVAR:%.*]]) #[[ATTR5:[0-9]+]] {
1186 // CHECK3-NEXT: entry:
1187 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1188 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1189 // CHECK3-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 4
1190 // CHECK3-NEXT: [[T_VAR_ADDR:%.*]] = alloca i32, align 4
1191 // CHECK3-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 4
1192 // CHECK3-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 4
1193 // CHECK3-NEXT: [[SIVAR_ADDR:%.*]] = alloca i32, align 4
1194 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1195 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
1196 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1197 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1198 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1199 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1200 // CHECK3-NEXT: [[VEC1:%.*]] = alloca [2 x i32], align 4
1201 // CHECK3-NEXT: [[S_ARR2:%.*]] = alloca [2 x %struct.S], align 4
1202 // CHECK3-NEXT: [[AGG_TMP:%.*]] = alloca [[STRUCT_ST:%.*]], align 4
1203 // CHECK3-NEXT: [[VAR4:%.*]] = alloca [[STRUCT_S:%.*]], align 4
1204 // CHECK3-NEXT: [[AGG_TMP5:%.*]] = alloca [[STRUCT_ST]], align 4
1205 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
1206 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1207 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1208 // CHECK3-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 4
1209 // CHECK3-NEXT: store i32 [[T_VAR]], ptr [[T_VAR_ADDR]], align 4
1210 // CHECK3-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 4
1211 // CHECK3-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 4
1212 // CHECK3-NEXT: store i32 [[SIVAR]], ptr [[SIVAR_ADDR]], align 4
1213 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VEC_ADDR]], align 4
1214 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 4
1215 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR_ADDR]], align 4
1216 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1217 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
1218 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1219 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1220 // CHECK3-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[VEC1]], ptr align 4 [[TMP0]], i32 8, i1 false)
1221 // CHECK3-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR2]], i32 0, i32 0
1222 // CHECK3-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i32 2
1223 // CHECK3-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP3]]
1224 // CHECK3-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE3:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1225 // CHECK3: omp.arraycpy.body:
1226 // CHECK3-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP1]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1227 // CHECK3-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1228 // CHECK3-NEXT: call void @_ZN2StC1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP]])
1229 // CHECK3-NEXT: call void @_ZN1SIfEC1ERKS0_2St(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]], ptr noundef [[AGG_TMP]])
1230 // CHECK3-NEXT: call void @_ZN2StD1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP]]) #[[ATTR2]]
1231 // CHECK3-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1232 // CHECK3-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1233 // CHECK3-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP3]]
1234 // CHECK3-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE3]], label [[OMP_ARRAYCPY_BODY]]
1235 // CHECK3: omp.arraycpy.done3:
1236 // CHECK3-NEXT: call void @_ZN2StC1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP5]])
1237 // CHECK3-NEXT: call void @_ZN1SIfEC1ERKS0_2St(ptr noundef nonnull align 4 dereferenceable(4) [[VAR4]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP2]], ptr noundef [[AGG_TMP5]])
1238 // CHECK3-NEXT: call void @_ZN2StD1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP5]]) #[[ATTR2]]
1239 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1240 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP4]], align 4
1241 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP5]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1242 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1243 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP6]], 1
1244 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1245 // CHECK3: cond.true:
1246 // CHECK3-NEXT: br label [[COND_END:%.*]]
1247 // CHECK3: cond.false:
1248 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1249 // CHECK3-NEXT: br label [[COND_END]]
1250 // CHECK3: cond.end:
1251 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
1252 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1253 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1254 // CHECK3-NEXT: store i32 [[TMP8]], ptr [[DOTOMP_IV]], align 4
1255 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1256 // CHECK3: omp.inner.for.cond:
1257 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1258 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1259 // CHECK3-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
1260 // CHECK3-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1261 // CHECK3: omp.inner.for.cond.cleanup:
1262 // CHECK3-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1263 // CHECK3: omp.inner.for.body:
1264 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1265 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
1266 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1267 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1268 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[T_VAR_ADDR]], align 4
1269 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[I]], align 4
1270 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC1]], i32 0, i32 [[TMP13]]
1271 // CHECK3-NEXT: store i32 [[TMP12]], ptr [[ARRAYIDX]], align 4
1272 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[I]], align 4
1273 // CHECK3-NEXT: [[ARRAYIDX7:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR2]], i32 0, i32 [[TMP14]]
1274 // CHECK3-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[ARRAYIDX7]], ptr align 4 [[VAR4]], i32 4, i1 false)
1275 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[I]], align 4
1276 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[SIVAR_ADDR]], align 4
1277 // CHECK3-NEXT: [[ADD8:%.*]] = add nsw i32 [[TMP16]], [[TMP15]]
1278 // CHECK3-NEXT: store i32 [[ADD8]], ptr [[SIVAR_ADDR]], align 4
1279 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1280 // CHECK3: omp.body.continue:
1281 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1282 // CHECK3: omp.inner.for.inc:
1283 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1284 // CHECK3-NEXT: [[ADD9:%.*]] = add nsw i32 [[TMP17]], 1
1285 // CHECK3-NEXT: store i32 [[ADD9]], ptr [[DOTOMP_IV]], align 4
1286 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
1287 // CHECK3: omp.inner.for.end:
1288 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1289 // CHECK3: omp.loop.exit:
1290 // CHECK3-NEXT: [[TMP18:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1291 // CHECK3-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP18]], align 4
1292 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP19]])
1293 // CHECK3-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR4]]) #[[ATTR2]]
1294 // CHECK3-NEXT: [[ARRAY_BEGIN10:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR2]], i32 0, i32 0
1295 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN10]], i32 2
1296 // CHECK3-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1297 // CHECK3: arraydestroy.body:
1298 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP20]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1299 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1300 // CHECK3-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
1301 // CHECK3-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN10]]
1302 // CHECK3-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE11:%.*]], label [[ARRAYDESTROY_BODY]]
1303 // CHECK3: arraydestroy.done11:
1304 // CHECK3-NEXT: ret void
1307 // CHECK3-LABEL: define {{[^@]+}}@_ZN2StC1Ev
1308 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(8) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1309 // CHECK3-NEXT: entry:
1310 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1311 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1312 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1313 // CHECK3-NEXT: call void @_ZN2StC2Ev(ptr noundef nonnull align 4 dereferenceable(8) [[THIS1]])
1314 // CHECK3-NEXT: ret void
1317 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfEC1ERKS0_2St
1318 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[S:%.*]], ptr noundef [[T:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1319 // CHECK3-NEXT: entry:
1320 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1321 // CHECK3-NEXT: [[S_ADDR:%.*]] = alloca ptr, align 4
1322 // CHECK3-NEXT: [[T_INDIRECT_ADDR:%.*]] = alloca ptr, align 4
1323 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1324 // CHECK3-NEXT: store ptr [[S]], ptr [[S_ADDR]], align 4
1325 // CHECK3-NEXT: store ptr [[T]], ptr [[T_INDIRECT_ADDR]], align 4
1326 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1327 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[S_ADDR]], align 4
1328 // CHECK3-NEXT: call void @_ZN1SIfEC2ERKS0_2St(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP0]], ptr noundef [[T]])
1329 // CHECK3-NEXT: ret void
1332 // CHECK3-LABEL: define {{[^@]+}}@_ZN2StD1Ev
1333 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(8) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1334 // CHECK3-NEXT: entry:
1335 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1336 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1337 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1338 // CHECK3-NEXT: call void @_ZN2StD2Ev(ptr noundef nonnull align 4 dereferenceable(8) [[THIS1]]) #[[ATTR2]]
1339 // CHECK3-NEXT: ret void
1342 // CHECK3-LABEL: define {{[^@]+}}@_Z5tmainIiET_v
1343 // CHECK3-SAME: () #[[ATTR7:[0-9]+]] comdat {
1344 // CHECK3-NEXT: entry:
1345 // CHECK3-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
1346 // CHECK3-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
1347 // CHECK3-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
1348 // CHECK3-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
1349 // CHECK3-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
1350 // CHECK3-NEXT: [[VAR:%.*]] = alloca ptr, align 4
1351 // CHECK3-NEXT: [[TMP:%.*]] = alloca ptr, align 4
1352 // CHECK3-NEXT: [[T_VAR_CASTED:%.*]] = alloca i32, align 4
1353 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [4 x ptr], align 4
1354 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [4 x ptr], align 4
1355 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [4 x ptr], align 4
1356 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
1357 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1358 // CHECK3-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
1359 // CHECK3-NEXT: store i32 0, ptr [[T_VAR]], align 4
1360 // CHECK3-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[VEC]], ptr align 4 @__const._Z5tmainIiET_v.vec, i32 8, i1 false)
1361 // CHECK3-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1362 // CHECK3-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], i32 noundef 1)
1363 // CHECK3-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYINIT_BEGIN]], i32 1
1364 // CHECK3-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], i32 noundef 2)
1365 // CHECK3-NEXT: store ptr [[TEST]], ptr [[VAR]], align 4
1366 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR]], align 4
1367 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[TMP]], align 4
1368 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[T_VAR]], align 4
1369 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[T_VAR_CASTED]], align 4
1370 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[T_VAR_CASTED]], align 4
1371 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 4
1372 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[TMP]], align 4
1373 // CHECK3-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP]], align 4
1374 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1375 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[TMP6]], align 4
1376 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1377 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[TMP7]], align 4
1378 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
1379 // CHECK3-NEXT: store ptr null, ptr [[TMP8]], align 4
1380 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
1381 // CHECK3-NEXT: store ptr [[VEC]], ptr [[TMP9]], align 4
1382 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
1383 // CHECK3-NEXT: store ptr [[VEC]], ptr [[TMP10]], align 4
1384 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
1385 // CHECK3-NEXT: store ptr null, ptr [[TMP11]], align 4
1386 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
1387 // CHECK3-NEXT: store ptr [[S_ARR]], ptr [[TMP12]], align 4
1388 // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
1389 // CHECK3-NEXT: store ptr [[S_ARR]], ptr [[TMP13]], align 4
1390 // CHECK3-NEXT: [[TMP14:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
1391 // CHECK3-NEXT: store ptr null, ptr [[TMP14]], align 4
1392 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
1393 // CHECK3-NEXT: store ptr [[TMP4]], ptr [[TMP15]], align 4
1394 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
1395 // CHECK3-NEXT: store ptr [[TMP5]], ptr [[TMP16]], align 4
1396 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 3
1397 // CHECK3-NEXT: store ptr null, ptr [[TMP17]], align 4
1398 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1399 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1400 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1401 // CHECK3-NEXT: store i32 2, ptr [[TMP20]], align 4
1402 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1403 // CHECK3-NEXT: store i32 4, ptr [[TMP21]], align 4
1404 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1405 // CHECK3-NEXT: store ptr [[TMP18]], ptr [[TMP22]], align 4
1406 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1407 // CHECK3-NEXT: store ptr [[TMP19]], ptr [[TMP23]], align 4
1408 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1409 // CHECK3-NEXT: store ptr @.offload_sizes.3, ptr [[TMP24]], align 4
1410 // CHECK3-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1411 // CHECK3-NEXT: store ptr @.offload_maptypes.4, ptr [[TMP25]], align 4
1412 // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1413 // CHECK3-NEXT: store ptr null, ptr [[TMP26]], align 4
1414 // CHECK3-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1415 // CHECK3-NEXT: store ptr null, ptr [[TMP27]], align 4
1416 // CHECK3-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1417 // CHECK3-NEXT: store i64 2, ptr [[TMP28]], align 8
1418 // CHECK3-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1419 // CHECK3-NEXT: store i64 0, ptr [[TMP29]], align 8
1420 // CHECK3-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1421 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP30]], align 4
1422 // CHECK3-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1423 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP31]], align 4
1424 // CHECK3-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1425 // CHECK3-NEXT: store i32 0, ptr [[TMP32]], align 4
1426 // CHECK3-NEXT: [[TMP33:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56.region_id, ptr [[KERNEL_ARGS]])
1427 // CHECK3-NEXT: [[TMP34:%.*]] = icmp ne i32 [[TMP33]], 0
1428 // CHECK3-NEXT: br i1 [[TMP34]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1429 // CHECK3: omp_offload.failed:
1430 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56(i32 [[TMP2]], ptr [[VEC]], ptr [[S_ARR]], ptr [[TMP3]]) #[[ATTR2]]
1431 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
1432 // CHECK3: omp_offload.cont:
1433 // CHECK3-NEXT: store i32 0, ptr [[RETVAL]], align 4
1434 // CHECK3-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1435 // CHECK3-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i32 2
1436 // CHECK3-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1437 // CHECK3: arraydestroy.body:
1438 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP35]], [[OMP_OFFLOAD_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1439 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1440 // CHECK3-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
1441 // CHECK3-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
1442 // CHECK3-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE2:%.*]], label [[ARRAYDESTROY_BODY]]
1443 // CHECK3: arraydestroy.done2:
1444 // CHECK3-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR2]]
1445 // CHECK3-NEXT: [[TMP36:%.*]] = load i32, ptr [[RETVAL]], align 4
1446 // CHECK3-NEXT: ret i32 [[TMP36]]
1449 // CHECK3-LABEL: define {{[^@]+}}@_ZN2StC2Ev
1450 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(8) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1451 // CHECK3-NEXT: entry:
1452 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1453 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1454 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1455 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], ptr [[THIS1]], i32 0, i32 0
1456 // CHECK3-NEXT: store i32 0, ptr [[A]], align 4
1457 // CHECK3-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_ST]], ptr [[THIS1]], i32 0, i32 1
1458 // CHECK3-NEXT: store i32 0, ptr [[B]], align 4
1459 // CHECK3-NEXT: ret void
1462 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfEC2ERKS0_2St
1463 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[S:%.*]], ptr noundef [[T:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1464 // CHECK3-NEXT: entry:
1465 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1466 // CHECK3-NEXT: [[S_ADDR:%.*]] = alloca ptr, align 4
1467 // CHECK3-NEXT: [[T_INDIRECT_ADDR:%.*]] = alloca ptr, align 4
1468 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1469 // CHECK3-NEXT: store ptr [[S]], ptr [[S_ADDR]], align 4
1470 // CHECK3-NEXT: store ptr [[T]], ptr [[T_INDIRECT_ADDR]], align 4
1471 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1472 // CHECK3-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
1473 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[S_ADDR]], align 4
1474 // CHECK3-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[TMP0]], i32 0, i32 0
1475 // CHECK3-NEXT: [[TMP1:%.*]] = load float, ptr [[F2]], align 4
1476 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], ptr [[T]], i32 0, i32 0
1477 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[A]], align 4
1478 // CHECK3-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP2]] to float
1479 // CHECK3-NEXT: [[ADD:%.*]] = fadd float [[TMP1]], [[CONV]]
1480 // CHECK3-NEXT: store float [[ADD]], ptr [[F]], align 4
1481 // CHECK3-NEXT: ret void
1484 // CHECK3-LABEL: define {{[^@]+}}@_ZN2StD2Ev
1485 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(8) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1486 // CHECK3-NEXT: entry:
1487 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1488 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1489 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1490 // CHECK3-NEXT: ret void
1493 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ev
1494 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1495 // CHECK3-NEXT: entry:
1496 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1497 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1498 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1499 // CHECK3-NEXT: call void @_ZN1SIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
1500 // CHECK3-NEXT: ret void
1503 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ei
1504 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1505 // CHECK3-NEXT: entry:
1506 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1507 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1508 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1509 // CHECK3-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1510 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1511 // CHECK3-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
1512 // CHECK3-NEXT: call void @_ZN1SIiEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], i32 noundef [[TMP0]])
1513 // CHECK3-NEXT: ret void
1516 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56
1517 // CHECK3-SAME: (i32 noundef [[T_VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[VEC:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[S_ARR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR:%.*]]) #[[ATTR4]] {
1518 // CHECK3-NEXT: entry:
1519 // CHECK3-NEXT: [[T_VAR_ADDR:%.*]] = alloca i32, align 4
1520 // CHECK3-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 4
1521 // CHECK3-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 4
1522 // CHECK3-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 4
1523 // CHECK3-NEXT: [[TMP:%.*]] = alloca ptr, align 4
1524 // CHECK3-NEXT: [[T_VAR_CASTED:%.*]] = alloca i32, align 4
1525 // CHECK3-NEXT: store i32 [[T_VAR]], ptr [[T_VAR_ADDR]], align 4
1526 // CHECK3-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 4
1527 // CHECK3-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 4
1528 // CHECK3-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 4
1529 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VEC_ADDR]], align 4
1530 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 4
1531 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR_ADDR]], align 4
1532 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[TMP]], align 4
1533 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[T_VAR_ADDR]], align 4
1534 // CHECK3-NEXT: store i32 [[TMP3]], ptr [[T_VAR_CASTED]], align 4
1535 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[T_VAR_CASTED]], align 4
1536 // CHECK3-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP]], align 4
1537 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56.omp_outlined, ptr [[TMP0]], i32 [[TMP4]], ptr [[TMP1]], ptr [[TMP5]])
1538 // CHECK3-NEXT: ret void
1541 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56.omp_outlined
1542 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[VEC:%.*]], i32 noundef [[T_VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[S_ARR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR:%.*]]) #[[ATTR5]] {
1543 // CHECK3-NEXT: entry:
1544 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1545 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1546 // CHECK3-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 4
1547 // CHECK3-NEXT: [[T_VAR_ADDR:%.*]] = alloca i32, align 4
1548 // CHECK3-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 4
1549 // CHECK3-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 4
1550 // CHECK3-NEXT: [[TMP:%.*]] = alloca ptr, align 4
1551 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1552 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
1553 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1554 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1555 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1556 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1557 // CHECK3-NEXT: [[VEC2:%.*]] = alloca [2 x i32], align 4
1558 // CHECK3-NEXT: [[S_ARR3:%.*]] = alloca [2 x %struct.S.0], align 4
1559 // CHECK3-NEXT: [[AGG_TMP:%.*]] = alloca [[STRUCT_ST:%.*]], align 4
1560 // CHECK3-NEXT: [[VAR5:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
1561 // CHECK3-NEXT: [[AGG_TMP6:%.*]] = alloca [[STRUCT_ST]], align 4
1562 // CHECK3-NEXT: [[_TMP7:%.*]] = alloca ptr, align 4
1563 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
1564 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1565 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1566 // CHECK3-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 4
1567 // CHECK3-NEXT: store i32 [[T_VAR]], ptr [[T_VAR_ADDR]], align 4
1568 // CHECK3-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 4
1569 // CHECK3-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 4
1570 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VEC_ADDR]], align 4
1571 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 4
1572 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR_ADDR]], align 4
1573 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[TMP]], align 4
1574 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1575 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
1576 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1577 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1578 // CHECK3-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[VEC2]], ptr align 4 [[TMP0]], i32 8, i1 false)
1579 // CHECK3-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR3]], i32 0, i32 0
1580 // CHECK3-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i32 2
1581 // CHECK3-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP3]]
1582 // CHECK3-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE4:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1583 // CHECK3: omp.arraycpy.body:
1584 // CHECK3-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP1]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1585 // CHECK3-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1586 // CHECK3-NEXT: call void @_ZN2StC1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP]])
1587 // CHECK3-NEXT: call void @_ZN1SIiEC1ERKS0_2St(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]], ptr noundef [[AGG_TMP]])
1588 // CHECK3-NEXT: call void @_ZN2StD1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP]]) #[[ATTR2]]
1589 // CHECK3-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1590 // CHECK3-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1591 // CHECK3-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP3]]
1592 // CHECK3-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE4]], label [[OMP_ARRAYCPY_BODY]]
1593 // CHECK3: omp.arraycpy.done4:
1594 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[TMP]], align 4
1595 // CHECK3-NEXT: call void @_ZN2StC1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP6]])
1596 // CHECK3-NEXT: call void @_ZN1SIiEC1ERKS0_2St(ptr noundef nonnull align 4 dereferenceable(4) [[VAR5]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP4]], ptr noundef [[AGG_TMP6]])
1597 // CHECK3-NEXT: call void @_ZN2StD1Ev(ptr noundef nonnull align 4 dereferenceable(8) [[AGG_TMP6]]) #[[ATTR2]]
1598 // CHECK3-NEXT: store ptr [[VAR5]], ptr [[_TMP7]], align 4
1599 // CHECK3-NEXT: [[TMP5:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1600 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[TMP5]], align 4
1601 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP6]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1602 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1603 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP7]], 1
1604 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1605 // CHECK3: cond.true:
1606 // CHECK3-NEXT: br label [[COND_END:%.*]]
1607 // CHECK3: cond.false:
1608 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1609 // CHECK3-NEXT: br label [[COND_END]]
1610 // CHECK3: cond.end:
1611 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP8]], [[COND_FALSE]] ]
1612 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1613 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1614 // CHECK3-NEXT: store i32 [[TMP9]], ptr [[DOTOMP_IV]], align 4
1615 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1616 // CHECK3: omp.inner.for.cond:
1617 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1618 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1619 // CHECK3-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP10]], [[TMP11]]
1620 // CHECK3-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1621 // CHECK3: omp.inner.for.cond.cleanup:
1622 // CHECK3-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1623 // CHECK3: omp.inner.for.body:
1624 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1625 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP12]], 1
1626 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1627 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1628 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[T_VAR_ADDR]], align 4
1629 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[I]], align 4
1630 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC2]], i32 0, i32 [[TMP14]]
1631 // CHECK3-NEXT: store i32 [[TMP13]], ptr [[ARRAYIDX]], align 4
1632 // CHECK3-NEXT: [[TMP15:%.*]] = load ptr, ptr [[_TMP7]], align 4
1633 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[I]], align 4
1634 // CHECK3-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR3]], i32 0, i32 [[TMP16]]
1635 // CHECK3-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[ARRAYIDX9]], ptr align 4 [[TMP15]], i32 4, i1 false)
1636 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1637 // CHECK3: omp.body.continue:
1638 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1639 // CHECK3: omp.inner.for.inc:
1640 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1641 // CHECK3-NEXT: [[ADD10:%.*]] = add nsw i32 [[TMP17]], 1
1642 // CHECK3-NEXT: store i32 [[ADD10]], ptr [[DOTOMP_IV]], align 4
1643 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
1644 // CHECK3: omp.inner.for.end:
1645 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1646 // CHECK3: omp.loop.exit:
1647 // CHECK3-NEXT: [[TMP18:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1648 // CHECK3-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP18]], align 4
1649 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP19]])
1650 // CHECK3-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR5]]) #[[ATTR2]]
1651 // CHECK3-NEXT: [[ARRAY_BEGIN11:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR3]], i32 0, i32 0
1652 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN11]], i32 2
1653 // CHECK3-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1654 // CHECK3: arraydestroy.body:
1655 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP20]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1656 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1657 // CHECK3-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
1658 // CHECK3-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN11]]
1659 // CHECK3-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE12:%.*]], label [[ARRAYDESTROY_BODY]]
1660 // CHECK3: arraydestroy.done12:
1661 // CHECK3-NEXT: ret void
1664 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiEC1ERKS0_2St
1665 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[S:%.*]], ptr noundef [[T:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1666 // CHECK3-NEXT: entry:
1667 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1668 // CHECK3-NEXT: [[S_ADDR:%.*]] = alloca ptr, align 4
1669 // CHECK3-NEXT: [[T_INDIRECT_ADDR:%.*]] = alloca ptr, align 4
1670 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1671 // CHECK3-NEXT: store ptr [[S]], ptr [[S_ADDR]], align 4
1672 // CHECK3-NEXT: store ptr [[T]], ptr [[T_INDIRECT_ADDR]], align 4
1673 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1674 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[S_ADDR]], align 4
1675 // CHECK3-NEXT: call void @_ZN1SIiEC2ERKS0_2St(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP0]], ptr noundef [[T]])
1676 // CHECK3-NEXT: ret void
1679 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiED1Ev
1680 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1681 // CHECK3-NEXT: entry:
1682 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1683 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1684 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1685 // CHECK3-NEXT: call void @_ZN1SIiED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR2]]
1686 // CHECK3-NEXT: ret void
1689 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ev
1690 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1691 // CHECK3-NEXT: entry:
1692 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1693 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1694 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1695 // CHECK3-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
1696 // CHECK3-NEXT: [[TMP0:%.*]] = load volatile i32, ptr @g, align 4
1697 // CHECK3-NEXT: store i32 [[TMP0]], ptr [[F]], align 4
1698 // CHECK3-NEXT: ret void
1701 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ei
1702 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1703 // CHECK3-NEXT: entry:
1704 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1705 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1706 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1707 // CHECK3-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1708 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1709 // CHECK3-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
1710 // CHECK3-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
1711 // CHECK3-NEXT: [[TMP1:%.*]] = load volatile i32, ptr @g, align 4
1712 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]]
1713 // CHECK3-NEXT: store i32 [[ADD]], ptr [[F]], align 4
1714 // CHECK3-NEXT: ret void
1717 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiEC2ERKS0_2St
1718 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[S:%.*]], ptr noundef [[T:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1719 // CHECK3-NEXT: entry:
1720 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1721 // CHECK3-NEXT: [[S_ADDR:%.*]] = alloca ptr, align 4
1722 // CHECK3-NEXT: [[T_INDIRECT_ADDR:%.*]] = alloca ptr, align 4
1723 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1724 // CHECK3-NEXT: store ptr [[S]], ptr [[S_ADDR]], align 4
1725 // CHECK3-NEXT: store ptr [[T]], ptr [[T_INDIRECT_ADDR]], align 4
1726 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1727 // CHECK3-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
1728 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[S_ADDR]], align 4
1729 // CHECK3-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[TMP0]], i32 0, i32 0
1730 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[F2]], align 4
1731 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], ptr [[T]], i32 0, i32 0
1732 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[A]], align 4
1733 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP2]]
1734 // CHECK3-NEXT: store i32 [[ADD]], ptr [[F]], align 4
1735 // CHECK3-NEXT: ret void
1738 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiED2Ev
1739 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1740 // CHECK3-NEXT: entry:
1741 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1742 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1743 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1744 // CHECK3-NEXT: ret void
1747 // CHECK3-LABEL: define {{[^@]+}}@_GLOBAL__sub_I_teams_distribute_firstprivate_codegen.cpp
1748 // CHECK3-SAME: () #[[ATTR0]] {
1749 // CHECK3-NEXT: entry:
1750 // CHECK3-NEXT: call void @__cxx_global_var_init()
1751 // CHECK3-NEXT: call void @__cxx_global_var_init.1()
1752 // CHECK3-NEXT: call void @__cxx_global_var_init.2()
1753 // CHECK3-NEXT: ret void
1756 // CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1757 // CHECK3-SAME: () #[[ATTR0]] {
1758 // CHECK3-NEXT: entry:
1759 // CHECK3-NEXT: call void @__tgt_register_requires(i64 1)
1760 // CHECK3-NEXT: ret void
1763 // CHECK9-LABEL: define {{[^@]+}}@__cxx_global_var_init
1764 // CHECK9-SAME: () #[[ATTR0:[0-9]+]] {
1765 // CHECK9-NEXT: entry:
1766 // CHECK9-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) @test)
1767 // CHECK9-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @_ZN1SIfED1Ev, ptr @test, ptr @__dso_handle) #[[ATTR2:[0-9]+]]
1768 // CHECK9-NEXT: ret void
1771 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ev
1772 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat {
1773 // CHECK9-NEXT: entry:
1774 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1775 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1776 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1777 // CHECK9-NEXT: call void @_ZN1SIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
1778 // CHECK9-NEXT: ret void
1781 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfED1Ev
1782 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1783 // CHECK9-NEXT: entry:
1784 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1785 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1786 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1787 // CHECK9-NEXT: call void @_ZN1SIfED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR2]]
1788 // CHECK9-NEXT: ret void
1791 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ev
1792 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1793 // CHECK9-NEXT: entry:
1794 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1795 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1796 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1797 // CHECK9-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
1798 // CHECK9-NEXT: [[TMP0:%.*]] = load volatile i32, ptr @g, align 4
1799 // CHECK9-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP0]] to float
1800 // CHECK9-NEXT: store float [[CONV]], ptr [[F]], align 4
1801 // CHECK9-NEXT: ret void
1804 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfED2Ev
1805 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1806 // CHECK9-NEXT: entry:
1807 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1808 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1809 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1810 // CHECK9-NEXT: ret void
1813 // CHECK9-LABEL: define {{[^@]+}}@__cxx_global_var_init.1
1814 // CHECK9-SAME: () #[[ATTR0]] {
1815 // CHECK9-NEXT: entry:
1816 // CHECK9-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) @s_arr, float noundef 1.000000e+00)
1817 // CHECK9-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds ([[STRUCT_S:%.*]], ptr @s_arr, i64 1), float noundef 2.000000e+00)
1818 // CHECK9-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @__cxx_global_array_dtor, ptr null, ptr @__dso_handle) #[[ATTR2]]
1819 // CHECK9-NEXT: ret void
1822 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ef
1823 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1824 // CHECK9-NEXT: entry:
1825 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1826 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
1827 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1828 // CHECK9-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
1829 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1830 // CHECK9-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
1831 // CHECK9-NEXT: call void @_ZN1SIfEC2Ef(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], float noundef [[TMP0]])
1832 // CHECK9-NEXT: ret void
1835 // CHECK9-LABEL: define {{[^@]+}}@__cxx_global_array_dtor
1836 // CHECK9-SAME: (ptr noundef [[TMP0:%.*]]) #[[ATTR0]] {
1837 // CHECK9-NEXT: entry:
1838 // CHECK9-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
1839 // CHECK9-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
1840 // CHECK9-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1841 // CHECK9: arraydestroy.body:
1842 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ getelementptr inbounds ([[STRUCT_S:%.*]], ptr @s_arr, i64 2), [[ENTRY:%.*]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1843 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
1844 // CHECK9-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
1845 // CHECK9-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], @s_arr
1846 // CHECK9-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE1:%.*]], label [[ARRAYDESTROY_BODY]]
1847 // CHECK9: arraydestroy.done1:
1848 // CHECK9-NEXT: ret void
1851 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ef
1852 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1853 // CHECK9-NEXT: entry:
1854 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1855 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
1856 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1857 // CHECK9-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
1858 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1859 // CHECK9-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
1860 // CHECK9-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
1861 // CHECK9-NEXT: [[TMP1:%.*]] = load volatile i32, ptr @g, align 4
1862 // CHECK9-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to float
1863 // CHECK9-NEXT: [[ADD:%.*]] = fadd float [[TMP0]], [[CONV]]
1864 // CHECK9-NEXT: store float [[ADD]], ptr [[F]], align 4
1865 // CHECK9-NEXT: ret void
1868 // CHECK9-LABEL: define {{[^@]+}}@__cxx_global_var_init.2
1869 // CHECK9-SAME: () #[[ATTR0]] {
1870 // CHECK9-NEXT: entry:
1871 // CHECK9-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) @var, float noundef 3.000000e+00)
1872 // CHECK9-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @_ZN1SIfED1Ev, ptr @var, ptr @__dso_handle) #[[ATTR2]]
1873 // CHECK9-NEXT: ret void
1876 // CHECK9-LABEL: define {{[^@]+}}@main
1877 // CHECK9-SAME: () #[[ATTR3:[0-9]+]] {
1878 // CHECK9-NEXT: entry:
1879 // CHECK9-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
1880 // CHECK9-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON:%.*]], align 1
1881 // CHECK9-NEXT: store i32 0, ptr [[RETVAL]], align 4
1882 // CHECK9-NEXT: call void @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1) [[REF_TMP]])
1883 // CHECK9-NEXT: ret i32 0
1886 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l75
1887 // CHECK9-SAME: (i64 noundef [[G:%.*]], i64 noundef [[SIVAR:%.*]], i64 noundef [[G1:%.*]]) #[[ATTR5:[0-9]+]] {
1888 // CHECK9-NEXT: entry:
1889 // CHECK9-NEXT: [[G_ADDR:%.*]] = alloca i64, align 8
1890 // CHECK9-NEXT: [[SIVAR_ADDR:%.*]] = alloca i64, align 8
1891 // CHECK9-NEXT: [[G1_ADDR:%.*]] = alloca i64, align 8
1892 // CHECK9-NEXT: [[TMP:%.*]] = alloca ptr, align 8
1893 // CHECK9-NEXT: [[G_CASTED:%.*]] = alloca i64, align 8
1894 // CHECK9-NEXT: [[G1_CASTED:%.*]] = alloca i64, align 8
1895 // CHECK9-NEXT: [[SIVAR_CASTED:%.*]] = alloca i64, align 8
1896 // CHECK9-NEXT: store i64 [[G]], ptr [[G_ADDR]], align 8
1897 // CHECK9-NEXT: store i64 [[SIVAR]], ptr [[SIVAR_ADDR]], align 8
1898 // CHECK9-NEXT: store i64 [[G1]], ptr [[G1_ADDR]], align 8
1899 // CHECK9-NEXT: store ptr [[G1_ADDR]], ptr [[TMP]], align 8
1900 // CHECK9-NEXT: [[TMP0:%.*]] = load i32, ptr [[G_ADDR]], align 4
1901 // CHECK9-NEXT: store i32 [[TMP0]], ptr [[G_CASTED]], align 4
1902 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[G_CASTED]], align 8
1903 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[TMP]], align 8
1904 // CHECK9-NEXT: [[TMP3:%.*]] = load volatile i32, ptr [[TMP2]], align 4
1905 // CHECK9-NEXT: store i32 [[TMP3]], ptr [[G1_CASTED]], align 4
1906 // CHECK9-NEXT: [[TMP4:%.*]] = load i64, ptr [[G1_CASTED]], align 8
1907 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[SIVAR_ADDR]], align 4
1908 // CHECK9-NEXT: store i32 [[TMP5]], ptr [[SIVAR_CASTED]], align 4
1909 // CHECK9-NEXT: [[TMP6:%.*]] = load i64, ptr [[SIVAR_CASTED]], align 8
1910 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2:[0-9]+]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l75.omp_outlined, i64 [[TMP1]], i64 [[TMP4]], i64 [[TMP6]])
1911 // CHECK9-NEXT: ret void
1914 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l75.omp_outlined
1915 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[G:%.*]], i64 noundef [[G1:%.*]], i64 noundef [[SIVAR:%.*]]) #[[ATTR6:[0-9]+]] {
1916 // CHECK9-NEXT: entry:
1917 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1918 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1919 // CHECK9-NEXT: [[G_ADDR:%.*]] = alloca i64, align 8
1920 // CHECK9-NEXT: [[G1_ADDR:%.*]] = alloca i64, align 8
1921 // CHECK9-NEXT: [[SIVAR_ADDR:%.*]] = alloca i64, align 8
1922 // CHECK9-NEXT: [[TMP:%.*]] = alloca ptr, align 8
1923 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1924 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
1925 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1926 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1927 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1928 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1929 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1930 // CHECK9-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON_0:%.*]], align 8
1931 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1932 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1933 // CHECK9-NEXT: store i64 [[G]], ptr [[G_ADDR]], align 8
1934 // CHECK9-NEXT: store i64 [[G1]], ptr [[G1_ADDR]], align 8
1935 // CHECK9-NEXT: store i64 [[SIVAR]], ptr [[SIVAR_ADDR]], align 8
1936 // CHECK9-NEXT: store ptr [[G1_ADDR]], ptr [[TMP]], align 8
1937 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1938 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
1939 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1940 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1941 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1942 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1943 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1944 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1945 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 1
1946 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1947 // CHECK9: cond.true:
1948 // CHECK9-NEXT: br label [[COND_END:%.*]]
1949 // CHECK9: cond.false:
1950 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1951 // CHECK9-NEXT: br label [[COND_END]]
1952 // CHECK9: cond.end:
1953 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1954 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1955 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1956 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1957 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1958 // CHECK9: omp.inner.for.cond:
1959 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1960 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1961 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1962 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1963 // CHECK9: omp.inner.for.body:
1964 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1965 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP7]], 1
1966 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1967 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1968 // CHECK9-NEXT: store i32 1, ptr [[G_ADDR]], align 4
1969 // CHECK9-NEXT: [[TMP8:%.*]] = load ptr, ptr [[TMP]], align 8
1970 // CHECK9-NEXT: store volatile i32 1, ptr [[TMP8]], align 4
1971 // CHECK9-NEXT: store i32 2, ptr [[SIVAR_ADDR]], align 4
1972 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 0
1973 // CHECK9-NEXT: store ptr [[G_ADDR]], ptr [[TMP9]], align 8
1974 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 1
1975 // CHECK9-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP]], align 8
1976 // CHECK9-NEXT: store ptr [[TMP11]], ptr [[TMP10]], align 8
1977 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 2
1978 // CHECK9-NEXT: store ptr [[SIVAR_ADDR]], ptr [[TMP12]], align 8
1979 // CHECK9-NEXT: call void @"_ZZZ4mainENK3$_0clEvENKUlvE_clEv"(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]])
1980 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1981 // CHECK9: omp.body.continue:
1982 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1983 // CHECK9: omp.inner.for.inc:
1984 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1985 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP13]], 1
1986 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
1987 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
1988 // CHECK9: omp.inner.for.end:
1989 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1990 // CHECK9: omp.loop.exit:
1991 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1992 // CHECK9-NEXT: ret void
1995 // CHECK9-LABEL: define {{[^@]+}}@_GLOBAL__sub_I_teams_distribute_firstprivate_codegen.cpp
1996 // CHECK9-SAME: () #[[ATTR0]] {
1997 // CHECK9-NEXT: entry:
1998 // CHECK9-NEXT: call void @__cxx_global_var_init()
1999 // CHECK9-NEXT: call void @__cxx_global_var_init.1()
2000 // CHECK9-NEXT: call void @__cxx_global_var_init.2()
2001 // CHECK9-NEXT: ret void
2004 // CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
2005 // CHECK9-SAME: () #[[ATTR0]] {
2006 // CHECK9-NEXT: entry:
2007 // CHECK9-NEXT: call void @__tgt_register_requires(i64 1)
2008 // CHECK9-NEXT: ret void