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 - | 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
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 - | 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 - | 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
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 - | 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 - | 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
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 - | 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 - | 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
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 - | 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 - | 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
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 - | 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 - | 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
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 - | 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 private(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 private(g, g1, sivar)
77 for (int i
= 0; i
< 2; ++i
) {
79 // Skip global, bound tid and loop vars
94 #pragma omp teams distribute private(t_var, vec, s_arr, var, sivar)
95 for (int i
= 0; i
< 2; ++i
) {
106 // Skip global, bound tid and loop vars
116 // Skip global, bound tid and loop vars
125 // CHECK1-LABEL: define {{[^@]+}}@__cxx_global_var_init
126 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
127 // CHECK1-NEXT: entry:
128 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) @test)
129 // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @_ZN1SIfED1Ev, ptr @test, ptr @__dso_handle) #[[ATTR2:[0-9]+]]
130 // CHECK1-NEXT: ret void
133 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ev
134 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat {
135 // CHECK1-NEXT: entry:
136 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
137 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
138 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
139 // CHECK1-NEXT: call void @_ZN1SIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
140 // CHECK1-NEXT: ret void
143 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfED1Ev
144 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
145 // CHECK1-NEXT: entry:
146 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
147 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
148 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
149 // CHECK1-NEXT: call void @_ZN1SIfED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR2]]
150 // CHECK1-NEXT: ret void
153 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ev
154 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] 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: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
160 // CHECK1-NEXT: [[TMP0:%.*]] = load volatile i32, ptr @g, align 4
161 // CHECK1-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP0]] to float
162 // CHECK1-NEXT: store float [[CONV]], ptr [[F]], align 4
163 // CHECK1-NEXT: ret void
166 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfED2Ev
167 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
168 // CHECK1-NEXT: entry:
169 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
170 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
171 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
172 // CHECK1-NEXT: ret void
175 // CHECK1-LABEL: define {{[^@]+}}@__cxx_global_var_init.1
176 // CHECK1-SAME: () #[[ATTR0]] {
177 // CHECK1-NEXT: entry:
178 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) @s_arr, float noundef 1.000000e+00)
179 // 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)
180 // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @__cxx_global_array_dtor, ptr null, ptr @__dso_handle) #[[ATTR2]]
181 // CHECK1-NEXT: ret void
184 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ef
185 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
186 // CHECK1-NEXT: entry:
187 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
188 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
189 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
190 // CHECK1-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
191 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
192 // CHECK1-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
193 // CHECK1-NEXT: call void @_ZN1SIfEC2Ef(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], float noundef [[TMP0]])
194 // CHECK1-NEXT: ret void
197 // CHECK1-LABEL: define {{[^@]+}}@__cxx_global_array_dtor
198 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]]) #[[ATTR0]] {
199 // CHECK1-NEXT: entry:
200 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
201 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
202 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
203 // CHECK1: arraydestroy.body:
204 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ getelementptr inbounds ([[STRUCT_S:%.*]], ptr @s_arr, i64 2), [[ENTRY:%.*]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
205 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
206 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
207 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], @s_arr
208 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE1:%.*]], label [[ARRAYDESTROY_BODY]]
209 // CHECK1: arraydestroy.done1:
210 // CHECK1-NEXT: ret void
213 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ef
214 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
215 // CHECK1-NEXT: entry:
216 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
217 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
218 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
219 // CHECK1-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
220 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
221 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
222 // CHECK1-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
223 // CHECK1-NEXT: [[TMP1:%.*]] = load volatile i32, ptr @g, align 4
224 // CHECK1-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to float
225 // CHECK1-NEXT: [[ADD:%.*]] = fadd float [[TMP0]], [[CONV]]
226 // CHECK1-NEXT: store float [[ADD]], ptr [[F]], align 4
227 // CHECK1-NEXT: ret void
230 // CHECK1-LABEL: define {{[^@]+}}@__cxx_global_var_init.2
231 // CHECK1-SAME: () #[[ATTR0]] {
232 // CHECK1-NEXT: entry:
233 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) @var, float noundef 3.000000e+00)
234 // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @_ZN1SIfED1Ev, ptr @var, ptr @__dso_handle) #[[ATTR2]]
235 // CHECK1-NEXT: ret void
238 // CHECK1-LABEL: define {{[^@]+}}@main
239 // CHECK1-SAME: () #[[ATTR3:[0-9]+]] {
240 // CHECK1-NEXT: entry:
241 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
242 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
243 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
244 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
245 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
246 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
247 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
248 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
249 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
250 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
251 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
252 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
253 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
254 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
255 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
256 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
257 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
258 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
259 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
260 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
261 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
262 // CHECK1-NEXT: store i64 2, ptr [[TMP8]], align 8
263 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
264 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
265 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
266 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
267 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
268 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
269 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
270 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
271 // CHECK1-NEXT: [[TMP13:%.*]] = 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_l93.region_id, ptr [[KERNEL_ARGS]])
272 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
273 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
274 // CHECK1: omp_offload.failed:
275 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l93() #[[ATTR2]]
276 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
277 // CHECK1: omp_offload.cont:
278 // CHECK1-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiET_v()
279 // CHECK1-NEXT: ret i32 [[CALL]]
282 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l93
283 // CHECK1-SAME: () #[[ATTR4:[0-9]+]] {
284 // CHECK1-NEXT: entry:
285 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l93.omp_outlined)
286 // CHECK1-NEXT: ret void
289 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l93.omp_outlined
290 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR5:[0-9]+]] {
291 // CHECK1-NEXT: entry:
292 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
293 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
294 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
295 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
296 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
297 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
298 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
299 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
300 // CHECK1-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
301 // CHECK1-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
302 // CHECK1-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S], align 4
303 // CHECK1-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S:%.*]], align 4
304 // CHECK1-NEXT: [[SIVAR:%.*]] = alloca i32, align 4
305 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
306 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
307 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
308 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
309 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
310 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
311 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
312 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
313 // CHECK1-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i64 2
314 // CHECK1-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
315 // CHECK1: arrayctor.loop:
316 // CHECK1-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
317 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
318 // CHECK1-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYCTOR_CUR]], i64 1
319 // CHECK1-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
320 // CHECK1-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
321 // CHECK1: arrayctor.cont:
322 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
323 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
324 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
325 // CHECK1-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)
326 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
327 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 1
328 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
329 // CHECK1: cond.true:
330 // CHECK1-NEXT: br label [[COND_END:%.*]]
331 // CHECK1: cond.false:
332 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
333 // CHECK1-NEXT: br label [[COND_END]]
335 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
336 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
337 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
338 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
339 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
340 // CHECK1: omp.inner.for.cond:
341 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
342 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
343 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
344 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
345 // CHECK1: omp.inner.for.cond.cleanup:
346 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
347 // CHECK1: omp.inner.for.body:
348 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
349 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP7]], 1
350 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
351 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
352 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[T_VAR]], align 4
353 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4
354 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP9]] to i64
355 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC]], i64 0, i64 [[IDXPROM]]
356 // CHECK1-NEXT: store i32 [[TMP8]], ptr [[ARRAYIDX]], align 4
357 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[I]], align 4
358 // CHECK1-NEXT: [[IDXPROM2:%.*]] = sext i32 [[TMP10]] to i64
359 // CHECK1-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i64 0, i64 [[IDXPROM2]]
360 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX3]], ptr align 4 [[VAR]], i64 4, i1 false)
361 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4
362 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[SIVAR]], align 4
363 // CHECK1-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP12]], [[TMP11]]
364 // CHECK1-NEXT: store i32 [[ADD4]], ptr [[SIVAR]], align 4
365 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
366 // CHECK1: omp.body.continue:
367 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
368 // CHECK1: omp.inner.for.inc:
369 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
370 // CHECK1-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP13]], 1
371 // CHECK1-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4
372 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
373 // CHECK1: omp.inner.for.end:
374 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
375 // CHECK1: omp.loop.exit:
376 // CHECK1-NEXT: [[TMP14:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
377 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[TMP14]], align 4
378 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP15]])
379 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR2]]
380 // CHECK1-NEXT: [[ARRAY_BEGIN6:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
381 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN6]], i64 2
382 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
383 // CHECK1: arraydestroy.body:
384 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP16]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
385 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
386 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
387 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN6]]
388 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE7:%.*]], label [[ARRAYDESTROY_BODY]]
389 // CHECK1: arraydestroy.done7:
390 // CHECK1-NEXT: ret void
393 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiET_v
394 // CHECK1-SAME: () #[[ATTR7:[0-9]+]] comdat {
395 // CHECK1-NEXT: entry:
396 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
397 // CHECK1-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
398 // CHECK1-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
399 // CHECK1-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
400 // CHECK1-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
401 // CHECK1-NEXT: [[VAR:%.*]] = alloca ptr, align 8
402 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
403 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
404 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
405 // CHECK1-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
406 // CHECK1-NEXT: store i32 0, ptr [[T_VAR]], align 4
407 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VEC]], ptr align 4 @__const._Z5tmainIiET_v.vec, i64 8, i1 false)
408 // CHECK1-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i64 0, i64 0
409 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], i32 noundef signext 1)
410 // CHECK1-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYINIT_BEGIN]], i64 1
411 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], i32 noundef signext 2)
412 // CHECK1-NEXT: store ptr [[TEST]], ptr [[VAR]], align 8
413 // CHECK1-NEXT: store ptr undef, ptr [[_TMP1]], align 8
414 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
415 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
416 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
417 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
418 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
419 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
420 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
421 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
422 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
423 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
424 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
425 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
426 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
427 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
428 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
429 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
430 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
431 // CHECK1-NEXT: store i64 2, ptr [[TMP8]], align 8
432 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
433 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
434 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
435 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
436 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
437 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
438 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
439 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
440 // CHECK1-NEXT: [[TMP13:%.*]] = 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]])
441 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
442 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
443 // CHECK1: omp_offload.failed:
444 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56() #[[ATTR2]]
445 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
446 // CHECK1: omp_offload.cont:
447 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
448 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
449 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i64 2
450 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
451 // CHECK1: arraydestroy.body:
452 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP15]], [[OMP_OFFLOAD_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
453 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
454 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
455 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
456 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE2:%.*]], label [[ARRAYDESTROY_BODY]]
457 // CHECK1: arraydestroy.done2:
458 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR2]]
459 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[RETVAL]], align 4
460 // CHECK1-NEXT: ret i32 [[TMP16]]
463 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ev
464 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
465 // CHECK1-NEXT: entry:
466 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
467 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
468 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
469 // CHECK1-NEXT: call void @_ZN1SIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
470 // CHECK1-NEXT: ret void
473 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ei
474 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef signext [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
475 // CHECK1-NEXT: entry:
476 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
477 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
478 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
479 // CHECK1-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
480 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
481 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
482 // CHECK1-NEXT: call void @_ZN1SIiEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], i32 noundef signext [[TMP0]])
483 // CHECK1-NEXT: ret void
486 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56
487 // CHECK1-SAME: () #[[ATTR4]] {
488 // CHECK1-NEXT: entry:
489 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56.omp_outlined)
490 // CHECK1-NEXT: ret void
493 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56.omp_outlined
494 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR5]] {
495 // CHECK1-NEXT: entry:
496 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
497 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
498 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
499 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
500 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
501 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
502 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
503 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
504 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
505 // CHECK1-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
506 // CHECK1-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
507 // CHECK1-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
508 // CHECK1-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
509 // CHECK1-NEXT: [[_TMP2:%.*]] = alloca ptr, align 8
510 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
511 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
512 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
513 // CHECK1-NEXT: store ptr undef, ptr [[_TMP1]], align 8
514 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
515 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
516 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
517 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
518 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
519 // CHECK1-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i64 2
520 // CHECK1-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
521 // CHECK1: arrayctor.loop:
522 // CHECK1-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
523 // CHECK1-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
524 // CHECK1-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYCTOR_CUR]], i64 1
525 // CHECK1-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
526 // CHECK1-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
527 // CHECK1: arrayctor.cont:
528 // CHECK1-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
529 // CHECK1-NEXT: store ptr [[VAR]], ptr [[_TMP2]], align 8
530 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
531 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
532 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
533 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
534 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 1
535 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
536 // CHECK1: cond.true:
537 // CHECK1-NEXT: br label [[COND_END:%.*]]
538 // CHECK1: cond.false:
539 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
540 // CHECK1-NEXT: br label [[COND_END]]
542 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
543 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
544 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
545 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
546 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
547 // CHECK1: omp.inner.for.cond:
548 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
549 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
550 // CHECK1-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
551 // CHECK1-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
552 // CHECK1: omp.inner.for.cond.cleanup:
553 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
554 // CHECK1: omp.inner.for.body:
555 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
556 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP7]], 1
557 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
558 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
559 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[T_VAR]], align 4
560 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4
561 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP9]] to i64
562 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC]], i64 0, i64 [[IDXPROM]]
563 // CHECK1-NEXT: store i32 [[TMP8]], ptr [[ARRAYIDX]], align 4
564 // CHECK1-NEXT: [[TMP10:%.*]] = load ptr, ptr [[_TMP2]], align 8
565 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4
566 // CHECK1-NEXT: [[IDXPROM4:%.*]] = sext i32 [[TMP11]] to i64
567 // CHECK1-NEXT: [[ARRAYIDX5:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i64 0, i64 [[IDXPROM4]]
568 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX5]], ptr align 4 [[TMP10]], i64 4, i1 false)
569 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
570 // CHECK1: omp.body.continue:
571 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
572 // CHECK1: omp.inner.for.inc:
573 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
574 // CHECK1-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP12]], 1
575 // CHECK1-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
576 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
577 // CHECK1: omp.inner.for.end:
578 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
579 // CHECK1: omp.loop.exit:
580 // CHECK1-NEXT: [[TMP13:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
581 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP13]], align 4
582 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP14]])
583 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR2]]
584 // CHECK1-NEXT: [[ARRAY_BEGIN7:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
585 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN7]], i64 2
586 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
587 // CHECK1: arraydestroy.body:
588 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP15]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
589 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
590 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
591 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN7]]
592 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE8:%.*]], label [[ARRAYDESTROY_BODY]]
593 // CHECK1: arraydestroy.done8:
594 // CHECK1-NEXT: ret void
597 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiED1Ev
598 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
599 // CHECK1-NEXT: entry:
600 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
601 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
602 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
603 // CHECK1-NEXT: call void @_ZN1SIiED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR2]]
604 // CHECK1-NEXT: ret void
607 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ev
608 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
609 // CHECK1-NEXT: entry:
610 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
611 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
612 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
613 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
614 // CHECK1-NEXT: [[TMP0:%.*]] = load volatile i32, ptr @g, align 4
615 // CHECK1-NEXT: store i32 [[TMP0]], ptr [[F]], align 4
616 // CHECK1-NEXT: ret void
619 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ei
620 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef signext [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
621 // CHECK1-NEXT: entry:
622 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
623 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
624 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
625 // CHECK1-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
626 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
627 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
628 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
629 // CHECK1-NEXT: [[TMP1:%.*]] = load volatile i32, ptr @g, align 4
630 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]]
631 // CHECK1-NEXT: store i32 [[ADD]], ptr [[F]], align 4
632 // CHECK1-NEXT: ret void
635 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiED2Ev
636 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
637 // CHECK1-NEXT: entry:
638 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
639 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
640 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
641 // CHECK1-NEXT: ret void
644 // CHECK1-LABEL: define {{[^@]+}}@_GLOBAL__sub_I_teams_distribute_private_codegen.cpp
645 // CHECK1-SAME: () #[[ATTR0]] {
646 // CHECK1-NEXT: entry:
647 // CHECK1-NEXT: call void @__cxx_global_var_init()
648 // CHECK1-NEXT: call void @__cxx_global_var_init.1()
649 // CHECK1-NEXT: call void @__cxx_global_var_init.2()
650 // CHECK1-NEXT: ret void
653 // CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
654 // CHECK1-SAME: () #[[ATTR0]] {
655 // CHECK1-NEXT: entry:
656 // CHECK1-NEXT: call void @__tgt_register_requires(i64 1)
657 // CHECK1-NEXT: ret void
660 // CHECK3-LABEL: define {{[^@]+}}@__cxx_global_var_init
661 // CHECK3-SAME: () #[[ATTR0:[0-9]+]] {
662 // CHECK3-NEXT: entry:
663 // CHECK3-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) @test)
664 // CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @_ZN1SIfED1Ev, ptr @test, ptr @__dso_handle) #[[ATTR2:[0-9]+]]
665 // CHECK3-NEXT: ret void
668 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ev
669 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat align 2 {
670 // CHECK3-NEXT: entry:
671 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
672 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
673 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
674 // CHECK3-NEXT: call void @_ZN1SIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
675 // CHECK3-NEXT: ret void
678 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfED1Ev
679 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
680 // CHECK3-NEXT: entry:
681 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
682 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
683 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
684 // CHECK3-NEXT: call void @_ZN1SIfED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR2]]
685 // CHECK3-NEXT: ret void
688 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ev
689 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
690 // CHECK3-NEXT: entry:
691 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
692 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
693 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
694 // CHECK3-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
695 // CHECK3-NEXT: [[TMP0:%.*]] = load volatile i32, ptr @g, align 4
696 // CHECK3-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP0]] to float
697 // CHECK3-NEXT: store float [[CONV]], ptr [[F]], align 4
698 // CHECK3-NEXT: ret void
701 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfED2Ev
702 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
703 // CHECK3-NEXT: entry:
704 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
705 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
706 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
707 // CHECK3-NEXT: ret void
710 // CHECK3-LABEL: define {{[^@]+}}@__cxx_global_var_init.1
711 // CHECK3-SAME: () #[[ATTR0]] {
712 // CHECK3-NEXT: entry:
713 // CHECK3-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) @s_arr, float noundef 1.000000e+00)
714 // 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)
715 // CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @__cxx_global_array_dtor, ptr null, ptr @__dso_handle) #[[ATTR2]]
716 // CHECK3-NEXT: ret void
719 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ef
720 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
721 // CHECK3-NEXT: entry:
722 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
723 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
724 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
725 // CHECK3-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
726 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
727 // CHECK3-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
728 // CHECK3-NEXT: call void @_ZN1SIfEC2Ef(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], float noundef [[TMP0]])
729 // CHECK3-NEXT: ret void
732 // CHECK3-LABEL: define {{[^@]+}}@__cxx_global_array_dtor
733 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]]) #[[ATTR0]] {
734 // CHECK3-NEXT: entry:
735 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
736 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
737 // CHECK3-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
738 // CHECK3: arraydestroy.body:
739 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ getelementptr inbounds ([[STRUCT_S:%.*]], ptr @s_arr, i32 2), [[ENTRY:%.*]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
740 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
741 // CHECK3-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
742 // CHECK3-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], @s_arr
743 // CHECK3-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE1:%.*]], label [[ARRAYDESTROY_BODY]]
744 // CHECK3: arraydestroy.done1:
745 // CHECK3-NEXT: ret void
748 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ef
749 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
750 // CHECK3-NEXT: entry:
751 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
752 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
753 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
754 // CHECK3-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
755 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
756 // CHECK3-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
757 // CHECK3-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
758 // CHECK3-NEXT: [[TMP1:%.*]] = load volatile i32, ptr @g, align 4
759 // CHECK3-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to float
760 // CHECK3-NEXT: [[ADD:%.*]] = fadd float [[TMP0]], [[CONV]]
761 // CHECK3-NEXT: store float [[ADD]], ptr [[F]], align 4
762 // CHECK3-NEXT: ret void
765 // CHECK3-LABEL: define {{[^@]+}}@__cxx_global_var_init.2
766 // CHECK3-SAME: () #[[ATTR0]] {
767 // CHECK3-NEXT: entry:
768 // CHECK3-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) @var, float noundef 3.000000e+00)
769 // CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @_ZN1SIfED1Ev, ptr @var, ptr @__dso_handle) #[[ATTR2]]
770 // CHECK3-NEXT: ret void
773 // CHECK3-LABEL: define {{[^@]+}}@main
774 // CHECK3-SAME: () #[[ATTR3:[0-9]+]] {
775 // CHECK3-NEXT: entry:
776 // CHECK3-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
777 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
778 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
779 // CHECK3-NEXT: store i32 0, ptr [[RETVAL]], align 4
780 // CHECK3-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
781 // CHECK3-NEXT: store i32 2, ptr [[TMP0]], align 4
782 // CHECK3-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
783 // CHECK3-NEXT: store i32 0, ptr [[TMP1]], align 4
784 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
785 // CHECK3-NEXT: store ptr null, ptr [[TMP2]], align 4
786 // CHECK3-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
787 // CHECK3-NEXT: store ptr null, ptr [[TMP3]], align 4
788 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
789 // CHECK3-NEXT: store ptr null, ptr [[TMP4]], align 4
790 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
791 // CHECK3-NEXT: store ptr null, ptr [[TMP5]], align 4
792 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
793 // CHECK3-NEXT: store ptr null, ptr [[TMP6]], align 4
794 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
795 // CHECK3-NEXT: store ptr null, ptr [[TMP7]], align 4
796 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
797 // CHECK3-NEXT: store i64 2, ptr [[TMP8]], align 8
798 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
799 // CHECK3-NEXT: store i64 0, ptr [[TMP9]], align 8
800 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
801 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
802 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
803 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
804 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
805 // CHECK3-NEXT: store i32 0, ptr [[TMP12]], align 4
806 // CHECK3-NEXT: [[TMP13:%.*]] = 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_l93.region_id, ptr [[KERNEL_ARGS]])
807 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
808 // CHECK3-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
809 // CHECK3: omp_offload.failed:
810 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l93() #[[ATTR2]]
811 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
812 // CHECK3: omp_offload.cont:
813 // CHECK3-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiET_v()
814 // CHECK3-NEXT: ret i32 [[CALL]]
817 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l93
818 // CHECK3-SAME: () #[[ATTR4:[0-9]+]] {
819 // CHECK3-NEXT: entry:
820 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l93.omp_outlined)
821 // CHECK3-NEXT: ret void
824 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l93.omp_outlined
825 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR5:[0-9]+]] {
826 // CHECK3-NEXT: entry:
827 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
828 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
829 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
830 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
831 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
832 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
833 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
834 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
835 // CHECK3-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
836 // CHECK3-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
837 // CHECK3-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S], align 4
838 // CHECK3-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S:%.*]], align 4
839 // CHECK3-NEXT: [[SIVAR:%.*]] = alloca i32, align 4
840 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
841 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
842 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
843 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
844 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
845 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
846 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
847 // CHECK3-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
848 // CHECK3-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i32 2
849 // CHECK3-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
850 // CHECK3: arrayctor.loop:
851 // CHECK3-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
852 // CHECK3-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
853 // CHECK3-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYCTOR_CUR]], i32 1
854 // CHECK3-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
855 // CHECK3-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
856 // CHECK3: arrayctor.cont:
857 // CHECK3-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
858 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
859 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
860 // CHECK3-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)
861 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
862 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 1
863 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
864 // CHECK3: cond.true:
865 // CHECK3-NEXT: br label [[COND_END:%.*]]
866 // CHECK3: cond.false:
867 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
868 // CHECK3-NEXT: br label [[COND_END]]
870 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
871 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
872 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
873 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
874 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
875 // CHECK3: omp.inner.for.cond:
876 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
877 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
878 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
879 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
880 // CHECK3: omp.inner.for.cond.cleanup:
881 // CHECK3-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
882 // CHECK3: omp.inner.for.body:
883 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
884 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP7]], 1
885 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
886 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4
887 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[T_VAR]], align 4
888 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4
889 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC]], i32 0, i32 [[TMP9]]
890 // CHECK3-NEXT: store i32 [[TMP8]], ptr [[ARRAYIDX]], align 4
891 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[I]], align 4
892 // CHECK3-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 [[TMP10]]
893 // CHECK3-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[ARRAYIDX2]], ptr align 4 [[VAR]], i32 4, i1 false)
894 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4
895 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[SIVAR]], align 4
896 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP12]], [[TMP11]]
897 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[SIVAR]], align 4
898 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
899 // CHECK3: omp.body.continue:
900 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
901 // CHECK3: omp.inner.for.inc:
902 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
903 // CHECK3-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP13]], 1
904 // CHECK3-NEXT: store i32 [[ADD4]], ptr [[DOTOMP_IV]], align 4
905 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
906 // CHECK3: omp.inner.for.end:
907 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
908 // CHECK3: omp.loop.exit:
909 // CHECK3-NEXT: [[TMP14:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
910 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[TMP14]], align 4
911 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP15]])
912 // CHECK3-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR2]]
913 // CHECK3-NEXT: [[ARRAY_BEGIN5:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
914 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN5]], i32 2
915 // CHECK3-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
916 // CHECK3: arraydestroy.body:
917 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP16]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
918 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
919 // CHECK3-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
920 // CHECK3-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN5]]
921 // CHECK3-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE6:%.*]], label [[ARRAYDESTROY_BODY]]
922 // CHECK3: arraydestroy.done6:
923 // CHECK3-NEXT: ret void
926 // CHECK3-LABEL: define {{[^@]+}}@_Z5tmainIiET_v
927 // CHECK3-SAME: () #[[ATTR7:[0-9]+]] comdat {
928 // CHECK3-NEXT: entry:
929 // CHECK3-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
930 // CHECK3-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
931 // CHECK3-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
932 // CHECK3-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
933 // CHECK3-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
934 // CHECK3-NEXT: [[VAR:%.*]] = alloca ptr, align 4
935 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
936 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca ptr, align 4
937 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
938 // CHECK3-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
939 // CHECK3-NEXT: store i32 0, ptr [[T_VAR]], align 4
940 // CHECK3-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[VEC]], ptr align 4 @__const._Z5tmainIiET_v.vec, i32 8, i1 false)
941 // CHECK3-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
942 // CHECK3-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], i32 noundef 1)
943 // CHECK3-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYINIT_BEGIN]], i32 1
944 // CHECK3-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], i32 noundef 2)
945 // CHECK3-NEXT: store ptr [[TEST]], ptr [[VAR]], align 4
946 // CHECK3-NEXT: store ptr undef, ptr [[_TMP1]], align 4
947 // CHECK3-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
948 // CHECK3-NEXT: store i32 2, ptr [[TMP0]], align 4
949 // CHECK3-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
950 // CHECK3-NEXT: store i32 0, ptr [[TMP1]], align 4
951 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
952 // CHECK3-NEXT: store ptr null, ptr [[TMP2]], align 4
953 // CHECK3-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
954 // CHECK3-NEXT: store ptr null, ptr [[TMP3]], align 4
955 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
956 // CHECK3-NEXT: store ptr null, ptr [[TMP4]], align 4
957 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
958 // CHECK3-NEXT: store ptr null, ptr [[TMP5]], align 4
959 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
960 // CHECK3-NEXT: store ptr null, ptr [[TMP6]], align 4
961 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
962 // CHECK3-NEXT: store ptr null, ptr [[TMP7]], align 4
963 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
964 // CHECK3-NEXT: store i64 2, ptr [[TMP8]], align 8
965 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
966 // CHECK3-NEXT: store i64 0, ptr [[TMP9]], align 8
967 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
968 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
969 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
970 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
971 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
972 // CHECK3-NEXT: store i32 0, ptr [[TMP12]], align 4
973 // CHECK3-NEXT: [[TMP13:%.*]] = 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]])
974 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
975 // CHECK3-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
976 // CHECK3: omp_offload.failed:
977 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56() #[[ATTR2]]
978 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
979 // CHECK3: omp_offload.cont:
980 // CHECK3-NEXT: store i32 0, ptr [[RETVAL]], align 4
981 // CHECK3-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
982 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i32 2
983 // CHECK3-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
984 // CHECK3: arraydestroy.body:
985 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP15]], [[OMP_OFFLOAD_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
986 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
987 // CHECK3-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
988 // CHECK3-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
989 // CHECK3-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE2:%.*]], label [[ARRAYDESTROY_BODY]]
990 // CHECK3: arraydestroy.done2:
991 // CHECK3-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR2]]
992 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[RETVAL]], align 4
993 // CHECK3-NEXT: ret i32 [[TMP16]]
996 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ev
997 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
998 // CHECK3-NEXT: entry:
999 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1000 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1001 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1002 // CHECK3-NEXT: call void @_ZN1SIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
1003 // CHECK3-NEXT: ret void
1006 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ei
1007 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1008 // CHECK3-NEXT: entry:
1009 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1010 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1011 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1012 // CHECK3-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1013 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1014 // CHECK3-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
1015 // CHECK3-NEXT: call void @_ZN1SIiEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], i32 noundef [[TMP0]])
1016 // CHECK3-NEXT: ret void
1019 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56
1020 // CHECK3-SAME: () #[[ATTR4]] {
1021 // CHECK3-NEXT: entry:
1022 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56.omp_outlined)
1023 // CHECK3-NEXT: ret void
1026 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l56.omp_outlined
1027 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR5]] {
1028 // CHECK3-NEXT: entry:
1029 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1030 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1031 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1032 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
1033 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca ptr, align 4
1034 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1035 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1036 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1037 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1038 // CHECK3-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
1039 // CHECK3-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
1040 // CHECK3-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
1041 // CHECK3-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
1042 // CHECK3-NEXT: [[_TMP2:%.*]] = alloca ptr, align 4
1043 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
1044 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1045 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1046 // CHECK3-NEXT: store ptr undef, ptr [[_TMP1]], align 4
1047 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1048 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
1049 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1050 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1051 // CHECK3-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1052 // CHECK3-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i32 2
1053 // CHECK3-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
1054 // CHECK3: arrayctor.loop:
1055 // CHECK3-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
1056 // CHECK3-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
1057 // CHECK3-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYCTOR_CUR]], i32 1
1058 // CHECK3-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
1059 // CHECK3-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
1060 // CHECK3: arrayctor.cont:
1061 // CHECK3-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
1062 // CHECK3-NEXT: store ptr [[VAR]], ptr [[_TMP2]], align 4
1063 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1064 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1065 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1066 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1067 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 1
1068 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1069 // CHECK3: cond.true:
1070 // CHECK3-NEXT: br label [[COND_END:%.*]]
1071 // CHECK3: cond.false:
1072 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1073 // CHECK3-NEXT: br label [[COND_END]]
1074 // CHECK3: cond.end:
1075 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1076 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1077 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1078 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1079 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1080 // CHECK3: omp.inner.for.cond:
1081 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1082 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1083 // CHECK3-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1084 // CHECK3-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1085 // CHECK3: omp.inner.for.cond.cleanup:
1086 // CHECK3-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1087 // CHECK3: omp.inner.for.body:
1088 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1089 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP7]], 1
1090 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1091 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1092 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[T_VAR]], align 4
1093 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4
1094 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC]], i32 0, i32 [[TMP9]]
1095 // CHECK3-NEXT: store i32 [[TMP8]], ptr [[ARRAYIDX]], align 4
1096 // CHECK3-NEXT: [[TMP10:%.*]] = load ptr, ptr [[_TMP2]], align 4
1097 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4
1098 // CHECK3-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 [[TMP11]]
1099 // CHECK3-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[ARRAYIDX4]], ptr align 4 [[TMP10]], i32 4, i1 false)
1100 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1101 // CHECK3: omp.body.continue:
1102 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1103 // CHECK3: omp.inner.for.inc:
1104 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1105 // CHECK3-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP12]], 1
1106 // CHECK3-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4
1107 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
1108 // CHECK3: omp.inner.for.end:
1109 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1110 // CHECK3: omp.loop.exit:
1111 // CHECK3-NEXT: [[TMP13:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1112 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP13]], align 4
1113 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP14]])
1114 // CHECK3-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR2]]
1115 // CHECK3-NEXT: [[ARRAY_BEGIN6:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1116 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN6]], i32 2
1117 // CHECK3-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1118 // CHECK3: arraydestroy.body:
1119 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP15]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1120 // CHECK3-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1121 // CHECK3-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
1122 // CHECK3-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN6]]
1123 // CHECK3-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE7:%.*]], label [[ARRAYDESTROY_BODY]]
1124 // CHECK3: arraydestroy.done7:
1125 // CHECK3-NEXT: ret void
1128 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiED1Ev
1129 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1130 // CHECK3-NEXT: entry:
1131 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1132 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1133 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1134 // CHECK3-NEXT: call void @_ZN1SIiED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR2]]
1135 // CHECK3-NEXT: ret void
1138 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ev
1139 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1140 // CHECK3-NEXT: entry:
1141 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1142 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1143 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1144 // CHECK3-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
1145 // CHECK3-NEXT: [[TMP0:%.*]] = load volatile i32, ptr @g, align 4
1146 // CHECK3-NEXT: store i32 [[TMP0]], ptr [[F]], align 4
1147 // CHECK3-NEXT: ret void
1150 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ei
1151 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1152 // CHECK3-NEXT: entry:
1153 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1154 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1155 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1156 // CHECK3-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1157 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1158 // CHECK3-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
1159 // CHECK3-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
1160 // CHECK3-NEXT: [[TMP1:%.*]] = load volatile i32, ptr @g, align 4
1161 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]]
1162 // CHECK3-NEXT: store i32 [[ADD]], ptr [[F]], align 4
1163 // CHECK3-NEXT: ret void
1166 // CHECK3-LABEL: define {{[^@]+}}@_ZN1SIiED2Ev
1167 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1168 // CHECK3-NEXT: entry:
1169 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1170 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1171 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1172 // CHECK3-NEXT: ret void
1175 // CHECK3-LABEL: define {{[^@]+}}@_GLOBAL__sub_I_teams_distribute_private_codegen.cpp
1176 // CHECK3-SAME: () #[[ATTR0]] {
1177 // CHECK3-NEXT: entry:
1178 // CHECK3-NEXT: call void @__cxx_global_var_init()
1179 // CHECK3-NEXT: call void @__cxx_global_var_init.1()
1180 // CHECK3-NEXT: call void @__cxx_global_var_init.2()
1181 // CHECK3-NEXT: ret void
1184 // CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1185 // CHECK3-SAME: () #[[ATTR0]] {
1186 // CHECK3-NEXT: entry:
1187 // CHECK3-NEXT: call void @__tgt_register_requires(i64 1)
1188 // CHECK3-NEXT: ret void
1191 // CHECK9-LABEL: define {{[^@]+}}@__cxx_global_var_init
1192 // CHECK9-SAME: () #[[ATTR0:[0-9]+]] {
1193 // CHECK9-NEXT: entry:
1194 // CHECK9-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) @test)
1195 // CHECK9-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @_ZN1SIfED1Ev, ptr @test, ptr @__dso_handle) #[[ATTR2:[0-9]+]]
1196 // CHECK9-NEXT: ret void
1199 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ev
1200 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat {
1201 // CHECK9-NEXT: entry:
1202 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1203 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1204 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1205 // CHECK9-NEXT: call void @_ZN1SIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
1206 // CHECK9-NEXT: ret void
1209 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfED1Ev
1210 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1211 // CHECK9-NEXT: entry:
1212 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1213 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1214 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1215 // CHECK9-NEXT: call void @_ZN1SIfED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR2]]
1216 // CHECK9-NEXT: ret void
1219 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ev
1220 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1221 // CHECK9-NEXT: entry:
1222 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1223 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1224 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1225 // CHECK9-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
1226 // CHECK9-NEXT: [[TMP0:%.*]] = load volatile i32, ptr @g, align 4
1227 // CHECK9-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP0]] to float
1228 // CHECK9-NEXT: store float [[CONV]], ptr [[F]], align 4
1229 // CHECK9-NEXT: ret void
1232 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfED2Ev
1233 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1234 // CHECK9-NEXT: entry:
1235 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1236 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1237 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1238 // CHECK9-NEXT: ret void
1241 // CHECK9-LABEL: define {{[^@]+}}@__cxx_global_var_init.1
1242 // CHECK9-SAME: () #[[ATTR0]] {
1243 // CHECK9-NEXT: entry:
1244 // CHECK9-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) @s_arr, float noundef 1.000000e+00)
1245 // 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)
1246 // CHECK9-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @__cxx_global_array_dtor, ptr null, ptr @__dso_handle) #[[ATTR2]]
1247 // CHECK9-NEXT: ret void
1250 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ef
1251 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1252 // CHECK9-NEXT: entry:
1253 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1254 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
1255 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1256 // CHECK9-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
1257 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1258 // CHECK9-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
1259 // CHECK9-NEXT: call void @_ZN1SIfEC2Ef(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], float noundef [[TMP0]])
1260 // CHECK9-NEXT: ret void
1263 // CHECK9-LABEL: define {{[^@]+}}@__cxx_global_array_dtor
1264 // CHECK9-SAME: (ptr noundef [[TMP0:%.*]]) #[[ATTR0]] {
1265 // CHECK9-NEXT: entry:
1266 // CHECK9-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
1267 // CHECK9-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
1268 // CHECK9-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1269 // CHECK9: arraydestroy.body:
1270 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ getelementptr inbounds ([[STRUCT_S:%.*]], ptr @s_arr, i64 2), [[ENTRY:%.*]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1271 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
1272 // CHECK9-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR2]]
1273 // CHECK9-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], @s_arr
1274 // CHECK9-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE1:%.*]], label [[ARRAYDESTROY_BODY]]
1275 // CHECK9: arraydestroy.done1:
1276 // CHECK9-NEXT: ret void
1279 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ef
1280 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1281 // CHECK9-NEXT: entry:
1282 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1283 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
1284 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1285 // CHECK9-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
1286 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1287 // CHECK9-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
1288 // CHECK9-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
1289 // CHECK9-NEXT: [[TMP1:%.*]] = load volatile i32, ptr @g, align 4
1290 // CHECK9-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to float
1291 // CHECK9-NEXT: [[ADD:%.*]] = fadd float [[TMP0]], [[CONV]]
1292 // CHECK9-NEXT: store float [[ADD]], ptr [[F]], align 4
1293 // CHECK9-NEXT: ret void
1296 // CHECK9-LABEL: define {{[^@]+}}@__cxx_global_var_init.2
1297 // CHECK9-SAME: () #[[ATTR0]] {
1298 // CHECK9-NEXT: entry:
1299 // CHECK9-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) @var, float noundef 3.000000e+00)
1300 // CHECK9-NEXT: [[TMP0:%.*]] = call i32 @__cxa_atexit(ptr @_ZN1SIfED1Ev, ptr @var, ptr @__dso_handle) #[[ATTR2]]
1301 // CHECK9-NEXT: ret void
1304 // CHECK9-LABEL: define {{[^@]+}}@main
1305 // CHECK9-SAME: () #[[ATTR3:[0-9]+]] {
1306 // CHECK9-NEXT: entry:
1307 // CHECK9-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
1308 // CHECK9-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON:%.*]], align 1
1309 // CHECK9-NEXT: store i32 0, ptr [[RETVAL]], align 4
1310 // CHECK9-NEXT: call void @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1) [[REF_TMP]])
1311 // CHECK9-NEXT: ret i32 0
1314 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l75
1315 // CHECK9-SAME: (i64 noundef [[G1:%.*]]) #[[ATTR5:[0-9]+]] {
1316 // CHECK9-NEXT: entry:
1317 // CHECK9-NEXT: [[G1_ADDR:%.*]] = alloca i64, align 8
1318 // CHECK9-NEXT: [[TMP:%.*]] = alloca ptr, align 8
1319 // CHECK9-NEXT: store i64 [[G1]], ptr [[G1_ADDR]], align 8
1320 // CHECK9-NEXT: store ptr [[G1_ADDR]], ptr [[TMP]], align 8
1321 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2:[0-9]+]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l75.omp_outlined)
1322 // CHECK9-NEXT: ret void
1325 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l75.omp_outlined
1326 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR6:[0-9]+]] {
1327 // CHECK9-NEXT: entry:
1328 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1329 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1330 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1331 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1332 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
1333 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1334 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1335 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1336 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1337 // CHECK9-NEXT: [[G:%.*]] = alloca i32, align 4
1338 // CHECK9-NEXT: [[G1:%.*]] = alloca i32, align 4
1339 // CHECK9-NEXT: [[_TMP2:%.*]] = alloca ptr, align 8
1340 // CHECK9-NEXT: [[SIVAR:%.*]] = alloca i32, align 4
1341 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1342 // CHECK9-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON_0:%.*]], align 8
1343 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1344 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1345 // CHECK9-NEXT: store ptr undef, ptr [[_TMP1]], align 8
1346 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1347 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
1348 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1349 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1350 // CHECK9-NEXT: store ptr [[G1]], ptr [[_TMP2]], align 8
1351 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1352 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1353 // 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)
1354 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1355 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 1
1356 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1357 // CHECK9: cond.true:
1358 // CHECK9-NEXT: br label [[COND_END:%.*]]
1359 // CHECK9: cond.false:
1360 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1361 // CHECK9-NEXT: br label [[COND_END]]
1362 // CHECK9: cond.end:
1363 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1364 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1365 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1366 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1367 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1368 // CHECK9: omp.inner.for.cond:
1369 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1370 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1371 // CHECK9-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1372 // CHECK9-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1373 // CHECK9: omp.inner.for.body:
1374 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1375 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP7]], 1
1376 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1377 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1378 // CHECK9-NEXT: store i32 1, ptr [[G]], align 4
1379 // CHECK9-NEXT: [[TMP8:%.*]] = load ptr, ptr [[_TMP2]], align 8
1380 // CHECK9-NEXT: store volatile i32 1, ptr [[TMP8]], align 4
1381 // CHECK9-NEXT: store i32 2, ptr [[SIVAR]], align 4
1382 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 0
1383 // CHECK9-NEXT: store ptr [[G]], ptr [[TMP9]], align 8
1384 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 1
1385 // CHECK9-NEXT: [[TMP11:%.*]] = load ptr, ptr [[_TMP2]], align 8
1386 // CHECK9-NEXT: store ptr [[TMP11]], ptr [[TMP10]], align 8
1387 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 2
1388 // CHECK9-NEXT: store ptr [[SIVAR]], ptr [[TMP12]], align 8
1389 // CHECK9-NEXT: call void @"_ZZZ4mainENK3$_0clEvENKUlvE_clEv"(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]])
1390 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1391 // CHECK9: omp.body.continue:
1392 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1393 // CHECK9: omp.inner.for.inc:
1394 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1395 // CHECK9-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP13]], 1
1396 // CHECK9-NEXT: store i32 [[ADD4]], ptr [[DOTOMP_IV]], align 4
1397 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
1398 // CHECK9: omp.inner.for.end:
1399 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1400 // CHECK9: omp.loop.exit:
1401 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1402 // CHECK9-NEXT: ret void
1405 // CHECK9-LABEL: define {{[^@]+}}@_GLOBAL__sub_I_teams_distribute_private_codegen.cpp
1406 // CHECK9-SAME: () #[[ATTR0]] {
1407 // CHECK9-NEXT: entry:
1408 // CHECK9-NEXT: call void @__cxx_global_var_init()
1409 // CHECK9-NEXT: call void @__cxx_global_var_init.1()
1410 // CHECK9-NEXT: call void @__cxx_global_var_init.2()
1411 // CHECK9-NEXT: ret void
1414 // CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1415 // CHECK9-SAME: () #[[ATTR0]] {
1416 // CHECK9-NEXT: entry:
1417 // CHECK9-NEXT: call void @__tgt_register_requires(i64 1)
1418 // CHECK9-NEXT: ret void