Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / distribute_firstprivate_codegen.cpp
blob361e26bc2984c3f94e46ec0ada6a0cddd2e9b88c
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _
2 // RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK1
3 // RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
4 // RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK1
5 // RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK3
6 // RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
7 // RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK3
9 // RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
10 // RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
11 // RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
12 // RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
13 // RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
14 // RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
16 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK9
17 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
18 // RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK9
19 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK11
20 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
21 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK11
23 // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
24 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
25 // RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
26 // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
27 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
28 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
29 // expected-no-diagnostics
30 #ifndef HEADER
31 #define HEADER
33 template <class T>
34 struct S {
35 T f;
36 S(T a) : f(a) {}
37 S() : f() {}
38 operator T() { return T(); }
39 ~S() {}
42 template <typename T>
43 T tmain() {
44 S<T> test;
45 T t_var = T();
46 T vec[] = {1, 2};
47 S<T> s_arr[] = {1, 2};
48 S<T> &var = test;
49 #pragma omp target
50 #pragma omp teams
51 #pragma omp distribute firstprivate(t_var, vec, s_arr, s_arr, var, var)
52 for (int i = 0; i < 2; ++i) {
53 vec[i] = t_var;
54 s_arr[i] = var;
56 return T();
59 int main() {
60 static int svar;
61 volatile double g;
62 volatile double &g1 = g;
64 #ifdef LAMBDA
65 [&]() {
66 static float sfvar;
68 #pragma omp target
69 #pragma omp teams
70 #pragma omp distribute firstprivate(g, g1, svar, sfvar)
71 for (int i = 0; i < 2; ++i) {
72 // Private alloca's for conversion
74 // Actual private variables to be used in the body (tmp is used for the reference type)
76 // Store input parameter addresses into private alloca's for conversion
78 g += 1;
79 g1 += 1;
80 svar += 3;
81 sfvar += 4.0;
83 // call inner lambda (use refs to private alloca's)
84 [&]() {
85 g += 2;
86 g1 += 2;
87 svar += 4;
88 sfvar += 8.0;
92 }();
94 }();
95 return 0;
96 #else
97 S<float> test;
98 int t_var = 0;
99 int vec[] = {1, 2};
100 S<float> s_arr[] = {1, 2};
101 S<float> &var = test;
103 #pragma omp target
104 #pragma omp teams
105 #pragma omp distribute firstprivate(t_var, vec, s_arr, s_arr, var, var, svar)
106 for (int i = 0; i < 2; ++i) {
107 vec[i] = t_var;
108 s_arr[i] = var;
110 return tmain<int>();
111 #endif
117 // discard omp loop variables
121 // init t_var
123 // init vec
125 // init s_arr
128 // init var
130 // init svar
134 // Template
138 // discard omp loop variables
142 // init t_var
144 // init vec
146 // init s_arr
149 // init var
152 #endif
153 // CHECK1-LABEL: define {{[^@]+}}@main
154 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
155 // CHECK1-NEXT: entry:
156 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
157 // CHECK1-NEXT: [[G:%.*]] = alloca double, align 8
158 // CHECK1-NEXT: [[G1:%.*]] = alloca ptr, align 8
159 // CHECK1-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON:%.*]], align 8
160 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
161 // CHECK1-NEXT: store ptr [[G]], ptr [[G1]], align 8
162 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[CLASS_ANON]], ptr [[REF_TMP]], i32 0, i32 0
163 // CHECK1-NEXT: store ptr [[G]], ptr [[TMP0]], align 8
164 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[CLASS_ANON]], ptr [[REF_TMP]], i32 0, i32 1
165 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[G1]], align 8
166 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[TMP1]], align 8
167 // CHECK1-NEXT: call void @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(16) [[REF_TMP]])
168 // CHECK1-NEXT: ret i32 0
171 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68
172 // CHECK1-SAME: (i64 noundef [[G:%.*]], i64 noundef [[G1:%.*]], i64 noundef [[SVAR:%.*]], i64 noundef [[SFVAR:%.*]]) #[[ATTR2:[0-9]+]] {
173 // CHECK1-NEXT: entry:
174 // CHECK1-NEXT: [[G_ADDR:%.*]] = alloca i64, align 8
175 // CHECK1-NEXT: [[G1_ADDR:%.*]] = alloca i64, align 8
176 // CHECK1-NEXT: [[SVAR_ADDR:%.*]] = alloca i64, align 8
177 // CHECK1-NEXT: [[SFVAR_ADDR:%.*]] = alloca i64, align 8
178 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
179 // CHECK1-NEXT: store i64 [[G]], ptr [[G_ADDR]], align 8
180 // CHECK1-NEXT: store i64 [[G1]], ptr [[G1_ADDR]], align 8
181 // CHECK1-NEXT: store i64 [[SVAR]], ptr [[SVAR_ADDR]], align 8
182 // CHECK1-NEXT: store i64 [[SFVAR]], ptr [[SFVAR_ADDR]], align 8
183 // CHECK1-NEXT: store ptr [[G1_ADDR]], ptr [[TMP]], align 8
184 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[TMP]], align 8
185 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2:[0-9]+]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68.omp_outlined, ptr [[G_ADDR]], ptr [[TMP0]], ptr [[SVAR_ADDR]], ptr [[SFVAR_ADDR]])
186 // CHECK1-NEXT: ret void
189 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68.omp_outlined
190 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[G:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[G1:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[SVAR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[SFVAR:%.*]]) #[[ATTR2]] {
191 // CHECK1-NEXT: entry:
192 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
193 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
194 // CHECK1-NEXT: [[G_ADDR:%.*]] = alloca ptr, align 8
195 // CHECK1-NEXT: [[G1_ADDR:%.*]] = alloca ptr, align 8
196 // CHECK1-NEXT: [[SVAR_ADDR:%.*]] = alloca ptr, align 8
197 // CHECK1-NEXT: [[SFVAR_ADDR:%.*]] = alloca ptr, align 8
198 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
199 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
200 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
201 // CHECK1-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
202 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
203 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
204 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
205 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
206 // CHECK1-NEXT: [[G3:%.*]] = alloca double, align 8
207 // CHECK1-NEXT: [[G14:%.*]] = alloca double, align 8
208 // CHECK1-NEXT: [[_TMP5:%.*]] = alloca ptr, align 8
209 // CHECK1-NEXT: [[SVAR6:%.*]] = alloca i32, align 4
210 // CHECK1-NEXT: [[SFVAR7:%.*]] = alloca float, align 4
211 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
212 // CHECK1-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON_0:%.*]], align 8
213 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
214 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
215 // CHECK1-NEXT: store ptr [[G]], ptr [[G_ADDR]], align 8
216 // CHECK1-NEXT: store ptr [[G1]], ptr [[G1_ADDR]], align 8
217 // CHECK1-NEXT: store ptr [[SVAR]], ptr [[SVAR_ADDR]], align 8
218 // CHECK1-NEXT: store ptr [[SFVAR]], ptr [[SFVAR_ADDR]], align 8
219 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[G_ADDR]], align 8
220 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[G1_ADDR]], align 8
221 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[SVAR_ADDR]], align 8
222 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[SFVAR_ADDR]], align 8
223 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[TMP]], align 8
224 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[TMP]], align 8
225 // CHECK1-NEXT: store ptr [[TMP4]], ptr [[_TMP1]], align 8
226 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
227 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
228 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
229 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
230 // CHECK1-NEXT: [[TMP5:%.*]] = load volatile double, ptr [[TMP0]], align 8
231 // CHECK1-NEXT: store double [[TMP5]], ptr [[G3]], align 8
232 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[_TMP1]], align 8
233 // CHECK1-NEXT: [[TMP7:%.*]] = load volatile double, ptr [[TMP6]], align 8
234 // CHECK1-NEXT: store double [[TMP7]], ptr [[G14]], align 8
235 // CHECK1-NEXT: store ptr [[G14]], ptr [[_TMP5]], align 8
236 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP2]], align 4
237 // CHECK1-NEXT: store i32 [[TMP8]], ptr [[SVAR6]], align 4
238 // CHECK1-NEXT: [[TMP9:%.*]] = load float, ptr [[TMP3]], align 4
239 // CHECK1-NEXT: store float [[TMP9]], ptr [[SFVAR7]], align 4
240 // CHECK1-NEXT: [[TMP10:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
241 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP10]], align 4
242 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP11]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
243 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
244 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP12]], 1
245 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
246 // CHECK1: cond.true:
247 // CHECK1-NEXT: br label [[COND_END:%.*]]
248 // CHECK1: cond.false:
249 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
250 // CHECK1-NEXT: br label [[COND_END]]
251 // CHECK1: cond.end:
252 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP13]], [[COND_FALSE]] ]
253 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
254 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
255 // CHECK1-NEXT: store i32 [[TMP14]], ptr [[DOTOMP_IV]], align 4
256 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
257 // CHECK1: omp.inner.for.cond:
258 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
259 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
260 // CHECK1-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
261 // CHECK1-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
262 // CHECK1: omp.inner.for.body:
263 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
264 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP17]], 1
265 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
266 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
267 // CHECK1-NEXT: [[TMP18:%.*]] = load double, ptr [[G3]], align 8
268 // CHECK1-NEXT: [[ADD9:%.*]] = fadd double [[TMP18]], 1.000000e+00
269 // CHECK1-NEXT: store double [[ADD9]], ptr [[G3]], align 8
270 // CHECK1-NEXT: [[TMP19:%.*]] = load ptr, ptr [[_TMP5]], align 8
271 // CHECK1-NEXT: [[TMP20:%.*]] = load volatile double, ptr [[TMP19]], align 8
272 // CHECK1-NEXT: [[ADD10:%.*]] = fadd double [[TMP20]], 1.000000e+00
273 // CHECK1-NEXT: store volatile double [[ADD10]], ptr [[TMP19]], align 8
274 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[SVAR6]], align 4
275 // CHECK1-NEXT: [[ADD11:%.*]] = add nsw i32 [[TMP21]], 3
276 // CHECK1-NEXT: store i32 [[ADD11]], ptr [[SVAR6]], align 4
277 // CHECK1-NEXT: [[TMP22:%.*]] = load float, ptr [[SFVAR7]], align 4
278 // CHECK1-NEXT: [[CONV:%.*]] = fpext float [[TMP22]] to double
279 // CHECK1-NEXT: [[ADD12:%.*]] = fadd double [[CONV]], 4.000000e+00
280 // CHECK1-NEXT: [[CONV13:%.*]] = fptrunc double [[ADD12]] to float
281 // CHECK1-NEXT: store float [[CONV13]], ptr [[SFVAR7]], align 4
282 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 0
283 // CHECK1-NEXT: store ptr [[G3]], ptr [[TMP23]], align 8
284 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 1
285 // CHECK1-NEXT: [[TMP25:%.*]] = load ptr, ptr [[_TMP5]], align 8
286 // CHECK1-NEXT: store ptr [[TMP25]], ptr [[TMP24]], align 8
287 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 2
288 // CHECK1-NEXT: store ptr [[SVAR6]], ptr [[TMP26]], align 8
289 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 3
290 // CHECK1-NEXT: store ptr [[SFVAR7]], ptr [[TMP27]], align 8
291 // CHECK1-NEXT: call void @"_ZZZ4mainENK3$_0clEvENKUlvE_clEv"(ptr noundef nonnull align 8 dereferenceable(32) [[REF_TMP]])
292 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
293 // CHECK1: omp.body.continue:
294 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
295 // CHECK1: omp.inner.for.inc:
296 // CHECK1-NEXT: [[TMP28:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
297 // CHECK1-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP28]], 1
298 // CHECK1-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV]], align 4
299 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
300 // CHECK1: omp.inner.for.end:
301 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
302 // CHECK1: omp.loop.exit:
303 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP11]])
304 // CHECK1-NEXT: ret void
307 // CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
308 // CHECK1-SAME: () #[[ATTR4:[0-9]+]] {
309 // CHECK1-NEXT: entry:
310 // CHECK1-NEXT: call void @__tgt_register_requires(i64 1)
311 // CHECK1-NEXT: ret void
314 // CHECK3-LABEL: define {{[^@]+}}@main
315 // CHECK3-SAME: () #[[ATTR0:[0-9]+]] {
316 // CHECK3-NEXT: entry:
317 // CHECK3-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
318 // CHECK3-NEXT: [[G:%.*]] = alloca double, align 8
319 // CHECK3-NEXT: [[G1:%.*]] = alloca ptr, align 4
320 // CHECK3-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON:%.*]], align 4
321 // CHECK3-NEXT: store i32 0, ptr [[RETVAL]], align 4
322 // CHECK3-NEXT: store ptr [[G]], ptr [[G1]], align 4
323 // CHECK3-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[CLASS_ANON]], ptr [[REF_TMP]], i32 0, i32 0
324 // CHECK3-NEXT: store ptr [[G]], ptr [[TMP0]], align 4
325 // CHECK3-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[CLASS_ANON]], ptr [[REF_TMP]], i32 0, i32 1
326 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[G1]], align 4
327 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[TMP1]], align 4
328 // CHECK3-NEXT: call void @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 4 dereferenceable(8) [[REF_TMP]])
329 // CHECK3-NEXT: ret i32 0
332 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68
333 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(8) [[G:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[G1:%.*]], i32 noundef [[SVAR:%.*]], i32 noundef [[SFVAR:%.*]]) #[[ATTR2:[0-9]+]] {
334 // CHECK3-NEXT: entry:
335 // CHECK3-NEXT: [[G_ADDR:%.*]] = alloca ptr, align 4
336 // CHECK3-NEXT: [[G1_ADDR:%.*]] = alloca ptr, align 4
337 // CHECK3-NEXT: [[SVAR_ADDR:%.*]] = alloca i32, align 4
338 // CHECK3-NEXT: [[SFVAR_ADDR:%.*]] = alloca i32, align 4
339 // CHECK3-NEXT: [[TMP:%.*]] = alloca ptr, align 4
340 // CHECK3-NEXT: [[G2:%.*]] = alloca double, align 8
341 // CHECK3-NEXT: [[G13:%.*]] = alloca double, align 8
342 // CHECK3-NEXT: [[_TMP4:%.*]] = alloca ptr, align 4
343 // CHECK3-NEXT: store ptr [[G]], ptr [[G_ADDR]], align 4
344 // CHECK3-NEXT: store ptr [[G1]], ptr [[G1_ADDR]], align 4
345 // CHECK3-NEXT: store i32 [[SVAR]], ptr [[SVAR_ADDR]], align 4
346 // CHECK3-NEXT: store i32 [[SFVAR]], ptr [[SFVAR_ADDR]], align 4
347 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[G_ADDR]], align 4
348 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[G1_ADDR]], align 4
349 // CHECK3-NEXT: store ptr [[TMP1]], ptr [[TMP]], align 4
350 // CHECK3-NEXT: [[TMP2:%.*]] = load double, ptr [[TMP0]], align 8
351 // CHECK3-NEXT: store double [[TMP2]], ptr [[G2]], align 8
352 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 4
353 // CHECK3-NEXT: [[TMP4:%.*]] = load volatile double, ptr [[TMP3]], align 4
354 // CHECK3-NEXT: store double [[TMP4]], ptr [[G13]], align 8
355 // CHECK3-NEXT: store ptr [[G13]], ptr [[_TMP4]], align 4
356 // CHECK3-NEXT: [[TMP5:%.*]] = load ptr, ptr [[_TMP4]], align 4
357 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2:[0-9]+]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68.omp_outlined, ptr [[G2]], ptr [[TMP5]], ptr [[SVAR_ADDR]], ptr [[SFVAR_ADDR]])
358 // CHECK3-NEXT: ret void
361 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68.omp_outlined
362 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[G:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[G1:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[SVAR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[SFVAR:%.*]]) #[[ATTR2]] {
363 // CHECK3-NEXT: entry:
364 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
365 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
366 // CHECK3-NEXT: [[G_ADDR:%.*]] = alloca ptr, align 4
367 // CHECK3-NEXT: [[G1_ADDR:%.*]] = alloca ptr, align 4
368 // CHECK3-NEXT: [[SVAR_ADDR:%.*]] = alloca ptr, align 4
369 // CHECK3-NEXT: [[SFVAR_ADDR:%.*]] = alloca ptr, align 4
370 // CHECK3-NEXT: [[TMP:%.*]] = alloca ptr, align 4
371 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca ptr, align 4
372 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
373 // CHECK3-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
374 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
375 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
376 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
377 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
378 // CHECK3-NEXT: [[G3:%.*]] = alloca double, align 8
379 // CHECK3-NEXT: [[G14:%.*]] = alloca double, align 8
380 // CHECK3-NEXT: [[_TMP5:%.*]] = alloca ptr, align 4
381 // CHECK3-NEXT: [[SVAR6:%.*]] = alloca i32, align 4
382 // CHECK3-NEXT: [[SFVAR7:%.*]] = alloca float, align 4
383 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
384 // CHECK3-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON_0:%.*]], align 4
385 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
386 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
387 // CHECK3-NEXT: store ptr [[G]], ptr [[G_ADDR]], align 4
388 // CHECK3-NEXT: store ptr [[G1]], ptr [[G1_ADDR]], align 4
389 // CHECK3-NEXT: store ptr [[SVAR]], ptr [[SVAR_ADDR]], align 4
390 // CHECK3-NEXT: store ptr [[SFVAR]], ptr [[SFVAR_ADDR]], align 4
391 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[G_ADDR]], align 4
392 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[G1_ADDR]], align 4
393 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[SVAR_ADDR]], align 4
394 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[SFVAR_ADDR]], align 4
395 // CHECK3-NEXT: store ptr [[TMP1]], ptr [[TMP]], align 4
396 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[TMP]], align 4
397 // CHECK3-NEXT: store ptr [[TMP4]], ptr [[_TMP1]], align 4
398 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
399 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
400 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
401 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
402 // CHECK3-NEXT: [[TMP5:%.*]] = load volatile double, ptr [[TMP0]], align 8
403 // CHECK3-NEXT: store double [[TMP5]], ptr [[G3]], align 8
404 // CHECK3-NEXT: [[TMP6:%.*]] = load ptr, ptr [[_TMP1]], align 4
405 // CHECK3-NEXT: [[TMP7:%.*]] = load volatile double, ptr [[TMP6]], align 4
406 // CHECK3-NEXT: store double [[TMP7]], ptr [[G14]], align 8
407 // CHECK3-NEXT: store ptr [[G14]], ptr [[_TMP5]], align 4
408 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP2]], align 4
409 // CHECK3-NEXT: store i32 [[TMP8]], ptr [[SVAR6]], align 4
410 // CHECK3-NEXT: [[TMP9:%.*]] = load float, ptr [[TMP3]], align 4
411 // CHECK3-NEXT: store float [[TMP9]], ptr [[SFVAR7]], align 4
412 // CHECK3-NEXT: [[TMP10:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
413 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP10]], align 4
414 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP11]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
415 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
416 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP12]], 1
417 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
418 // CHECK3: cond.true:
419 // CHECK3-NEXT: br label [[COND_END:%.*]]
420 // CHECK3: cond.false:
421 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
422 // CHECK3-NEXT: br label [[COND_END]]
423 // CHECK3: cond.end:
424 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP13]], [[COND_FALSE]] ]
425 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
426 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
427 // CHECK3-NEXT: store i32 [[TMP14]], ptr [[DOTOMP_IV]], align 4
428 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
429 // CHECK3: omp.inner.for.cond:
430 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
431 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
432 // CHECK3-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
433 // CHECK3-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
434 // CHECK3: omp.inner.for.body:
435 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
436 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP17]], 1
437 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
438 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4
439 // CHECK3-NEXT: [[TMP18:%.*]] = load double, ptr [[G3]], align 8
440 // CHECK3-NEXT: [[ADD9:%.*]] = fadd double [[TMP18]], 1.000000e+00
441 // CHECK3-NEXT: store double [[ADD9]], ptr [[G3]], align 8
442 // CHECK3-NEXT: [[TMP19:%.*]] = load ptr, ptr [[_TMP5]], align 4
443 // CHECK3-NEXT: [[TMP20:%.*]] = load volatile double, ptr [[TMP19]], align 4
444 // CHECK3-NEXT: [[ADD10:%.*]] = fadd double [[TMP20]], 1.000000e+00
445 // CHECK3-NEXT: store volatile double [[ADD10]], ptr [[TMP19]], align 4
446 // CHECK3-NEXT: [[TMP21:%.*]] = load i32, ptr [[SVAR6]], align 4
447 // CHECK3-NEXT: [[ADD11:%.*]] = add nsw i32 [[TMP21]], 3
448 // CHECK3-NEXT: store i32 [[ADD11]], ptr [[SVAR6]], align 4
449 // CHECK3-NEXT: [[TMP22:%.*]] = load float, ptr [[SFVAR7]], align 4
450 // CHECK3-NEXT: [[CONV:%.*]] = fpext float [[TMP22]] to double
451 // CHECK3-NEXT: [[ADD12:%.*]] = fadd double [[CONV]], 4.000000e+00
452 // CHECK3-NEXT: [[CONV13:%.*]] = fptrunc double [[ADD12]] to float
453 // CHECK3-NEXT: store float [[CONV13]], ptr [[SFVAR7]], align 4
454 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 0
455 // CHECK3-NEXT: store ptr [[G3]], ptr [[TMP23]], align 4
456 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 1
457 // CHECK3-NEXT: [[TMP25:%.*]] = load ptr, ptr [[_TMP5]], align 4
458 // CHECK3-NEXT: store ptr [[TMP25]], ptr [[TMP24]], align 4
459 // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 2
460 // CHECK3-NEXT: store ptr [[SVAR6]], ptr [[TMP26]], align 4
461 // CHECK3-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 3
462 // CHECK3-NEXT: store ptr [[SFVAR7]], ptr [[TMP27]], align 4
463 // CHECK3-NEXT: call void @"_ZZZ4mainENK3$_0clEvENKUlvE_clEv"(ptr noundef nonnull align 4 dereferenceable(16) [[REF_TMP]])
464 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
465 // CHECK3: omp.body.continue:
466 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
467 // CHECK3: omp.inner.for.inc:
468 // CHECK3-NEXT: [[TMP28:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
469 // CHECK3-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP28]], 1
470 // CHECK3-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV]], align 4
471 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
472 // CHECK3: omp.inner.for.end:
473 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
474 // CHECK3: omp.loop.exit:
475 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP11]])
476 // CHECK3-NEXT: ret void
479 // CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
480 // CHECK3-SAME: () #[[ATTR4:[0-9]+]] {
481 // CHECK3-NEXT: entry:
482 // CHECK3-NEXT: call void @__tgt_register_requires(i64 1)
483 // CHECK3-NEXT: ret void
486 // CHECK9-LABEL: define {{[^@]+}}@main
487 // CHECK9-SAME: () #[[ATTR0:[0-9]+]] {
488 // CHECK9-NEXT: entry:
489 // CHECK9-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
490 // CHECK9-NEXT: [[G:%.*]] = alloca double, align 8
491 // CHECK9-NEXT: [[G1:%.*]] = alloca ptr, align 8
492 // CHECK9-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S:%.*]], align 4
493 // CHECK9-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
494 // CHECK9-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
495 // CHECK9-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S], align 4
496 // CHECK9-NEXT: [[VAR:%.*]] = alloca ptr, align 8
497 // CHECK9-NEXT: [[TMP:%.*]] = alloca ptr, align 8
498 // CHECK9-NEXT: [[T_VAR_CASTED:%.*]] = alloca i64, align 8
499 // CHECK9-NEXT: [[SVAR_CASTED:%.*]] = alloca i64, align 8
500 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [5 x ptr], align 8
501 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [5 x ptr], align 8
502 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [5 x ptr], align 8
503 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
504 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
505 // CHECK9-NEXT: store i32 0, ptr [[RETVAL]], align 4
506 // CHECK9-NEXT: store ptr [[G]], ptr [[G1]], align 8
507 // CHECK9-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
508 // CHECK9-NEXT: store i32 0, ptr [[T_VAR]], align 4
509 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VEC]], ptr align 4 @__const.main.vec, i64 8, i1 false)
510 // CHECK9-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i64 0, i64 0
511 // CHECK9-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], float noundef 1.000000e+00)
512 // CHECK9-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYINIT_BEGIN]], i64 1
513 // CHECK9-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], float noundef 2.000000e+00)
514 // CHECK9-NEXT: store ptr [[TEST]], ptr [[VAR]], align 8
515 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR]], align 8
516 // CHECK9-NEXT: store ptr [[TMP0]], ptr [[TMP]], align 8
517 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[T_VAR]], align 4
518 // CHECK9-NEXT: store i32 [[TMP1]], ptr [[T_VAR_CASTED]], align 4
519 // CHECK9-NEXT: [[TMP2:%.*]] = load i64, ptr [[T_VAR_CASTED]], align 8
520 // CHECK9-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 8
521 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr @_ZZ4mainE4svar, align 4
522 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[SVAR_CASTED]], align 4
523 // CHECK9-NEXT: [[TMP5:%.*]] = load i64, ptr [[SVAR_CASTED]], align 8
524 // CHECK9-NEXT: [[TMP6:%.*]] = load ptr, ptr [[TMP]], align 8
525 // CHECK9-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP]], align 8
526 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
527 // CHECK9-NEXT: store i64 [[TMP2]], ptr [[TMP8]], align 8
528 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
529 // CHECK9-NEXT: store i64 [[TMP2]], ptr [[TMP9]], align 8
530 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
531 // CHECK9-NEXT: store ptr null, ptr [[TMP10]], align 8
532 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
533 // CHECK9-NEXT: store ptr [[VEC]], ptr [[TMP11]], align 8
534 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
535 // CHECK9-NEXT: store ptr [[VEC]], ptr [[TMP12]], align 8
536 // CHECK9-NEXT: [[TMP13:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
537 // CHECK9-NEXT: store ptr null, ptr [[TMP13]], align 8
538 // CHECK9-NEXT: [[TMP14:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
539 // CHECK9-NEXT: store ptr [[S_ARR]], ptr [[TMP14]], align 8
540 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
541 // CHECK9-NEXT: store ptr [[S_ARR]], ptr [[TMP15]], align 8
542 // CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
543 // CHECK9-NEXT: store ptr null, ptr [[TMP16]], align 8
544 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
545 // CHECK9-NEXT: store ptr [[TMP6]], ptr [[TMP17]], align 8
546 // CHECK9-NEXT: [[TMP18:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
547 // CHECK9-NEXT: store ptr [[TMP7]], ptr [[TMP18]], align 8
548 // CHECK9-NEXT: [[TMP19:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 3
549 // CHECK9-NEXT: store ptr null, ptr [[TMP19]], align 8
550 // CHECK9-NEXT: [[TMP20:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 4
551 // CHECK9-NEXT: store i64 [[TMP5]], ptr [[TMP20]], align 8
552 // CHECK9-NEXT: [[TMP21:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 4
553 // CHECK9-NEXT: store i64 [[TMP5]], ptr [[TMP21]], align 8
554 // CHECK9-NEXT: [[TMP22:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 4
555 // CHECK9-NEXT: store ptr null, ptr [[TMP22]], align 8
556 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
557 // CHECK9-NEXT: [[TMP24:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
558 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
559 // CHECK9-NEXT: store i32 2, ptr [[TMP25]], align 4
560 // CHECK9-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
561 // CHECK9-NEXT: store i32 5, ptr [[TMP26]], align 4
562 // CHECK9-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
563 // CHECK9-NEXT: store ptr [[TMP23]], ptr [[TMP27]], align 8
564 // CHECK9-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
565 // CHECK9-NEXT: store ptr [[TMP24]], ptr [[TMP28]], align 8
566 // CHECK9-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
567 // CHECK9-NEXT: store ptr @.offload_sizes, ptr [[TMP29]], align 8
568 // CHECK9-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
569 // CHECK9-NEXT: store ptr @.offload_maptypes, ptr [[TMP30]], align 8
570 // CHECK9-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
571 // CHECK9-NEXT: store ptr null, ptr [[TMP31]], align 8
572 // CHECK9-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
573 // CHECK9-NEXT: store ptr null, ptr [[TMP32]], align 8
574 // CHECK9-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
575 // CHECK9-NEXT: store i64 2, ptr [[TMP33]], align 8
576 // CHECK9-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
577 // CHECK9-NEXT: store i64 0, ptr [[TMP34]], align 8
578 // CHECK9-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
579 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP35]], align 4
580 // CHECK9-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
581 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP36]], align 4
582 // CHECK9-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
583 // CHECK9-NEXT: store i32 0, ptr [[TMP37]], align 4
584 // CHECK9-NEXT: [[TMP38:%.*]] = 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_l103.region_id, ptr [[KERNEL_ARGS]])
585 // CHECK9-NEXT: [[TMP39:%.*]] = icmp ne i32 [[TMP38]], 0
586 // CHECK9-NEXT: br i1 [[TMP39]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
587 // CHECK9: omp_offload.failed:
588 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l103(i64 [[TMP2]], ptr [[VEC]], ptr [[S_ARR]], ptr [[TMP3]], i64 [[TMP5]]) #[[ATTR4:[0-9]+]]
589 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
590 // CHECK9: omp_offload.cont:
591 // CHECK9-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiET_v()
592 // CHECK9-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
593 // CHECK9-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
594 // CHECK9-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i64 2
595 // CHECK9-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
596 // CHECK9: arraydestroy.body:
597 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP40]], [[OMP_OFFLOAD_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
598 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
599 // CHECK9-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
600 // CHECK9-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
601 // CHECK9-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE2:%.*]], label [[ARRAYDESTROY_BODY]]
602 // CHECK9: arraydestroy.done2:
603 // CHECK9-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR4]]
604 // CHECK9-NEXT: [[TMP41:%.*]] = load i32, ptr [[RETVAL]], align 4
605 // CHECK9-NEXT: ret i32 [[TMP41]]
608 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ev
609 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat {
610 // CHECK9-NEXT: entry:
611 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
612 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
613 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
614 // CHECK9-NEXT: call void @_ZN1SIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
615 // CHECK9-NEXT: ret void
618 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ef
619 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
620 // CHECK9-NEXT: entry:
621 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
622 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
623 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
624 // CHECK9-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
625 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
626 // CHECK9-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
627 // CHECK9-NEXT: call void @_ZN1SIfEC2Ef(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], float noundef [[TMP0]])
628 // CHECK9-NEXT: ret void
631 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l103
632 // CHECK9-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 [[SVAR:%.*]]) #[[ATTR3:[0-9]+]] {
633 // CHECK9-NEXT: entry:
634 // CHECK9-NEXT: [[T_VAR_ADDR:%.*]] = alloca i64, align 8
635 // CHECK9-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 8
636 // CHECK9-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 8
637 // CHECK9-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 8
638 // CHECK9-NEXT: [[SVAR_ADDR:%.*]] = alloca i64, align 8
639 // CHECK9-NEXT: [[TMP:%.*]] = alloca ptr, align 8
640 // CHECK9-NEXT: store i64 [[T_VAR]], ptr [[T_VAR_ADDR]], align 8
641 // CHECK9-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 8
642 // CHECK9-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 8
643 // CHECK9-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 8
644 // CHECK9-NEXT: store i64 [[SVAR]], ptr [[SVAR_ADDR]], align 8
645 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VEC_ADDR]], align 8
646 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 8
647 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR_ADDR]], align 8
648 // CHECK9-NEXT: store ptr [[TMP2]], ptr [[TMP]], align 8
649 // CHECK9-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 8
650 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 5, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l103.omp_outlined, ptr [[T_VAR_ADDR]], ptr [[TMP0]], ptr [[TMP1]], ptr [[TMP3]], ptr [[SVAR_ADDR]])
651 // CHECK9-NEXT: ret void
654 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l103.omp_outlined
655 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[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:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[SVAR:%.*]]) #[[ATTR3]] {
656 // CHECK9-NEXT: entry:
657 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
658 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
659 // CHECK9-NEXT: [[T_VAR_ADDR:%.*]] = alloca ptr, align 8
660 // CHECK9-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 8
661 // CHECK9-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 8
662 // CHECK9-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 8
663 // CHECK9-NEXT: [[SVAR_ADDR:%.*]] = alloca ptr, align 8
664 // CHECK9-NEXT: [[TMP:%.*]] = alloca ptr, align 8
665 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
666 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
667 // CHECK9-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
668 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
669 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
670 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
671 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
672 // CHECK9-NEXT: [[T_VAR3:%.*]] = alloca i32, align 4
673 // CHECK9-NEXT: [[VEC4:%.*]] = alloca [2 x i32], align 4
674 // CHECK9-NEXT: [[S_ARR5:%.*]] = alloca [2 x %struct.S], align 4
675 // CHECK9-NEXT: [[VAR7:%.*]] = alloca [[STRUCT_S:%.*]], align 4
676 // CHECK9-NEXT: [[_TMP8:%.*]] = alloca ptr, align 8
677 // CHECK9-NEXT: [[SVAR9:%.*]] = alloca i32, align 4
678 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
679 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
680 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
681 // CHECK9-NEXT: store ptr [[T_VAR]], ptr [[T_VAR_ADDR]], align 8
682 // CHECK9-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 8
683 // CHECK9-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 8
684 // CHECK9-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 8
685 // CHECK9-NEXT: store ptr [[SVAR]], ptr [[SVAR_ADDR]], align 8
686 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[T_VAR_ADDR]], align 8
687 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[VEC_ADDR]], align 8
688 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 8
689 // CHECK9-NEXT: [[TMP3:%.*]] = load ptr, ptr [[VAR_ADDR]], align 8
690 // CHECK9-NEXT: [[TMP4:%.*]] = load ptr, ptr [[SVAR_ADDR]], align 8
691 // CHECK9-NEXT: store ptr [[TMP3]], ptr [[TMP]], align 8
692 // CHECK9-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP]], align 8
693 // CHECK9-NEXT: store ptr [[TMP5]], ptr [[_TMP1]], align 8
694 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
695 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
696 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
697 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
698 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[TMP0]], align 4
699 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[T_VAR3]], align 4
700 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VEC4]], ptr align 4 [[TMP1]], i64 8, i1 false)
701 // CHECK9-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR5]], i32 0, i32 0
702 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i64 2
703 // CHECK9-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP7]]
704 // CHECK9-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE6:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
705 // CHECK9: omp.arraycpy.body:
706 // CHECK9-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP2]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
707 // CHECK9-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
708 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr align 4 [[OMP_ARRAYCPY_SRCELEMENTPAST]], i64 4, i1 false)
709 // CHECK9-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
710 // CHECK9-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
711 // CHECK9-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP7]]
712 // CHECK9-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE6]], label [[OMP_ARRAYCPY_BODY]]
713 // CHECK9: omp.arraycpy.done6:
714 // CHECK9-NEXT: [[TMP8:%.*]] = load ptr, ptr [[_TMP1]], align 8
715 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VAR7]], ptr align 4 [[TMP8]], i64 4, i1 false)
716 // CHECK9-NEXT: store ptr [[VAR7]], ptr [[_TMP8]], align 8
717 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP4]], align 4
718 // CHECK9-NEXT: store i32 [[TMP9]], ptr [[SVAR9]], align 4
719 // CHECK9-NEXT: [[TMP10:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
720 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP10]], align 4
721 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP11]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
722 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
723 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP12]], 1
724 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
725 // CHECK9: cond.true:
726 // CHECK9-NEXT: br label [[COND_END:%.*]]
727 // CHECK9: cond.false:
728 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
729 // CHECK9-NEXT: br label [[COND_END]]
730 // CHECK9: cond.end:
731 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP13]], [[COND_FALSE]] ]
732 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
733 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
734 // CHECK9-NEXT: store i32 [[TMP14]], ptr [[DOTOMP_IV]], align 4
735 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
736 // CHECK9: omp.inner.for.cond:
737 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
738 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
739 // CHECK9-NEXT: [[CMP10:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
740 // CHECK9-NEXT: br i1 [[CMP10]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
741 // CHECK9: omp.inner.for.cond.cleanup:
742 // CHECK9-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
743 // CHECK9: omp.inner.for.body:
744 // CHECK9-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
745 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP17]], 1
746 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
747 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4
748 // CHECK9-NEXT: [[TMP18:%.*]] = load i32, ptr [[T_VAR3]], align 4
749 // CHECK9-NEXT: [[TMP19:%.*]] = load i32, ptr [[I]], align 4
750 // CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP19]] to i64
751 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC4]], i64 0, i64 [[IDXPROM]]
752 // CHECK9-NEXT: store i32 [[TMP18]], ptr [[ARRAYIDX]], align 4
753 // CHECK9-NEXT: [[TMP20:%.*]] = load ptr, ptr [[_TMP8]], align 8
754 // CHECK9-NEXT: [[TMP21:%.*]] = load i32, ptr [[I]], align 4
755 // CHECK9-NEXT: [[IDXPROM11:%.*]] = sext i32 [[TMP21]] to i64
756 // CHECK9-NEXT: [[ARRAYIDX12:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR5]], i64 0, i64 [[IDXPROM11]]
757 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX12]], ptr align 4 [[TMP20]], i64 4, i1 false)
758 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
759 // CHECK9: omp.body.continue:
760 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
761 // CHECK9: omp.inner.for.inc:
762 // CHECK9-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
763 // CHECK9-NEXT: [[ADD13:%.*]] = add nsw i32 [[TMP22]], 1
764 // CHECK9-NEXT: store i32 [[ADD13]], ptr [[DOTOMP_IV]], align 4
765 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
766 // CHECK9: omp.inner.for.end:
767 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
768 // CHECK9: omp.loop.exit:
769 // CHECK9-NEXT: [[TMP23:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
770 // CHECK9-NEXT: [[TMP24:%.*]] = load i32, ptr [[TMP23]], align 4
771 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP24]])
772 // CHECK9-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR7]]) #[[ATTR4]]
773 // CHECK9-NEXT: [[ARRAY_BEGIN14:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR5]], i32 0, i32 0
774 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN14]], i64 2
775 // CHECK9-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
776 // CHECK9: arraydestroy.body:
777 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP25]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
778 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
779 // CHECK9-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
780 // CHECK9-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN14]]
781 // CHECK9-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE15:%.*]], label [[ARRAYDESTROY_BODY]]
782 // CHECK9: arraydestroy.done15:
783 // CHECK9-NEXT: ret void
786 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfED1Ev
787 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
788 // CHECK9-NEXT: entry:
789 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
790 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
791 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
792 // CHECK9-NEXT: call void @_ZN1SIfED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR4]]
793 // CHECK9-NEXT: ret void
796 // CHECK9-LABEL: define {{[^@]+}}@_Z5tmainIiET_v
797 // CHECK9-SAME: () #[[ATTR5:[0-9]+]] comdat {
798 // CHECK9-NEXT: entry:
799 // CHECK9-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
800 // CHECK9-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
801 // CHECK9-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
802 // CHECK9-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
803 // CHECK9-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
804 // CHECK9-NEXT: [[VAR:%.*]] = alloca ptr, align 8
805 // CHECK9-NEXT: [[TMP:%.*]] = alloca ptr, align 8
806 // CHECK9-NEXT: [[T_VAR_CASTED:%.*]] = alloca i64, align 8
807 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [4 x ptr], align 8
808 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [4 x ptr], align 8
809 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [4 x ptr], align 8
810 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
811 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
812 // CHECK9-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
813 // CHECK9-NEXT: store i32 0, ptr [[T_VAR]], align 4
814 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VEC]], ptr align 4 @__const._Z5tmainIiET_v.vec, i64 8, i1 false)
815 // CHECK9-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i64 0, i64 0
816 // CHECK9-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], i32 noundef signext 1)
817 // CHECK9-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYINIT_BEGIN]], i64 1
818 // CHECK9-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], i32 noundef signext 2)
819 // CHECK9-NEXT: store ptr [[TEST]], ptr [[VAR]], align 8
820 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR]], align 8
821 // CHECK9-NEXT: store ptr [[TMP0]], ptr [[TMP]], align 8
822 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[T_VAR]], align 4
823 // CHECK9-NEXT: store i32 [[TMP1]], ptr [[T_VAR_CASTED]], align 4
824 // CHECK9-NEXT: [[TMP2:%.*]] = load i64, ptr [[T_VAR_CASTED]], align 8
825 // CHECK9-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 8
826 // CHECK9-NEXT: [[TMP4:%.*]] = load ptr, ptr [[TMP]], align 8
827 // CHECK9-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP]], align 8
828 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
829 // CHECK9-NEXT: store i64 [[TMP2]], ptr [[TMP6]], align 8
830 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
831 // CHECK9-NEXT: store i64 [[TMP2]], ptr [[TMP7]], align 8
832 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
833 // CHECK9-NEXT: store ptr null, ptr [[TMP8]], align 8
834 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
835 // CHECK9-NEXT: store ptr [[VEC]], ptr [[TMP9]], align 8
836 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
837 // CHECK9-NEXT: store ptr [[VEC]], ptr [[TMP10]], align 8
838 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
839 // CHECK9-NEXT: store ptr null, ptr [[TMP11]], align 8
840 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
841 // CHECK9-NEXT: store ptr [[S_ARR]], ptr [[TMP12]], align 8
842 // CHECK9-NEXT: [[TMP13:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
843 // CHECK9-NEXT: store ptr [[S_ARR]], ptr [[TMP13]], align 8
844 // CHECK9-NEXT: [[TMP14:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
845 // CHECK9-NEXT: store ptr null, ptr [[TMP14]], align 8
846 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
847 // CHECK9-NEXT: store ptr [[TMP4]], ptr [[TMP15]], align 8
848 // CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
849 // CHECK9-NEXT: store ptr [[TMP5]], ptr [[TMP16]], align 8
850 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 3
851 // CHECK9-NEXT: store ptr null, ptr [[TMP17]], align 8
852 // CHECK9-NEXT: [[TMP18:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
853 // CHECK9-NEXT: [[TMP19:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
854 // CHECK9-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
855 // CHECK9-NEXT: store i32 2, ptr [[TMP20]], align 4
856 // CHECK9-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
857 // CHECK9-NEXT: store i32 4, ptr [[TMP21]], align 4
858 // CHECK9-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
859 // CHECK9-NEXT: store ptr [[TMP18]], ptr [[TMP22]], align 8
860 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
861 // CHECK9-NEXT: store ptr [[TMP19]], ptr [[TMP23]], align 8
862 // CHECK9-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
863 // CHECK9-NEXT: store ptr @.offload_sizes.1, ptr [[TMP24]], align 8
864 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
865 // CHECK9-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP25]], align 8
866 // CHECK9-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
867 // CHECK9-NEXT: store ptr null, ptr [[TMP26]], align 8
868 // CHECK9-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
869 // CHECK9-NEXT: store ptr null, ptr [[TMP27]], align 8
870 // CHECK9-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
871 // CHECK9-NEXT: store i64 2, ptr [[TMP28]], align 8
872 // CHECK9-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
873 // CHECK9-NEXT: store i64 0, ptr [[TMP29]], align 8
874 // CHECK9-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
875 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP30]], align 4
876 // CHECK9-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
877 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP31]], align 4
878 // CHECK9-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
879 // CHECK9-NEXT: store i32 0, ptr [[TMP32]], align 4
880 // CHECK9-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_l49.region_id, ptr [[KERNEL_ARGS]])
881 // CHECK9-NEXT: [[TMP34:%.*]] = icmp ne i32 [[TMP33]], 0
882 // CHECK9-NEXT: br i1 [[TMP34]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
883 // CHECK9: omp_offload.failed:
884 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49(i64 [[TMP2]], ptr [[VEC]], ptr [[S_ARR]], ptr [[TMP3]]) #[[ATTR4]]
885 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
886 // CHECK9: omp_offload.cont:
887 // CHECK9-NEXT: store i32 0, ptr [[RETVAL]], align 4
888 // CHECK9-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
889 // CHECK9-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i64 2
890 // CHECK9-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
891 // CHECK9: arraydestroy.body:
892 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP35]], [[OMP_OFFLOAD_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
893 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
894 // CHECK9-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
895 // CHECK9-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
896 // CHECK9-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE2:%.*]], label [[ARRAYDESTROY_BODY]]
897 // CHECK9: arraydestroy.done2:
898 // CHECK9-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR4]]
899 // CHECK9-NEXT: [[TMP36:%.*]] = load i32, ptr [[RETVAL]], align 4
900 // CHECK9-NEXT: ret i32 [[TMP36]]
903 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ev
904 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
905 // CHECK9-NEXT: entry:
906 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
907 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
908 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
909 // CHECK9-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
910 // CHECK9-NEXT: store float 0.000000e+00, ptr [[F]], align 4
911 // CHECK9-NEXT: ret void
914 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ef
915 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
916 // CHECK9-NEXT: entry:
917 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
918 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
919 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
920 // CHECK9-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
921 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
922 // CHECK9-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
923 // CHECK9-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
924 // CHECK9-NEXT: store float [[TMP0]], ptr [[F]], align 4
925 // CHECK9-NEXT: ret void
928 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIfED2Ev
929 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
930 // CHECK9-NEXT: entry:
931 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
932 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
933 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
934 // CHECK9-NEXT: ret void
937 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ev
938 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
939 // CHECK9-NEXT: entry:
940 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
941 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
942 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
943 // CHECK9-NEXT: call void @_ZN1SIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
944 // CHECK9-NEXT: ret void
947 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ei
948 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef signext [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
949 // CHECK9-NEXT: entry:
950 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
951 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
952 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
953 // CHECK9-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
954 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
955 // CHECK9-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
956 // CHECK9-NEXT: call void @_ZN1SIiEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], i32 noundef signext [[TMP0]])
957 // CHECK9-NEXT: ret void
960 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49
961 // CHECK9-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:%.*]]) #[[ATTR3]] {
962 // CHECK9-NEXT: entry:
963 // CHECK9-NEXT: [[T_VAR_ADDR:%.*]] = alloca i64, align 8
964 // CHECK9-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 8
965 // CHECK9-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 8
966 // CHECK9-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 8
967 // CHECK9-NEXT: [[TMP:%.*]] = alloca ptr, align 8
968 // CHECK9-NEXT: store i64 [[T_VAR]], ptr [[T_VAR_ADDR]], align 8
969 // CHECK9-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 8
970 // CHECK9-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 8
971 // CHECK9-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 8
972 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VEC_ADDR]], align 8
973 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 8
974 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR_ADDR]], align 8
975 // CHECK9-NEXT: store ptr [[TMP2]], ptr [[TMP]], align 8
976 // CHECK9-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 8
977 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.omp_outlined, ptr [[T_VAR_ADDR]], ptr [[TMP0]], ptr [[TMP1]], ptr [[TMP3]])
978 // CHECK9-NEXT: ret void
981 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.omp_outlined
982 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[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:%.*]]) #[[ATTR3]] {
983 // CHECK9-NEXT: entry:
984 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
985 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
986 // CHECK9-NEXT: [[T_VAR_ADDR:%.*]] = alloca ptr, align 8
987 // CHECK9-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 8
988 // CHECK9-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 8
989 // CHECK9-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 8
990 // CHECK9-NEXT: [[TMP:%.*]] = alloca ptr, align 8
991 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
992 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
993 // CHECK9-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
994 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
995 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
996 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
997 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
998 // CHECK9-NEXT: [[T_VAR3:%.*]] = alloca i32, align 4
999 // CHECK9-NEXT: [[VEC4:%.*]] = alloca [2 x i32], align 4
1000 // CHECK9-NEXT: [[S_ARR5:%.*]] = alloca [2 x %struct.S.0], align 4
1001 // CHECK9-NEXT: [[VAR7:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
1002 // CHECK9-NEXT: [[_TMP8:%.*]] = alloca ptr, align 8
1003 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1004 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1005 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1006 // CHECK9-NEXT: store ptr [[T_VAR]], ptr [[T_VAR_ADDR]], align 8
1007 // CHECK9-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 8
1008 // CHECK9-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 8
1009 // CHECK9-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 8
1010 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[T_VAR_ADDR]], align 8
1011 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[VEC_ADDR]], align 8
1012 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 8
1013 // CHECK9-NEXT: [[TMP3:%.*]] = load ptr, ptr [[VAR_ADDR]], align 8
1014 // CHECK9-NEXT: store ptr [[TMP3]], ptr [[TMP]], align 8
1015 // CHECK9-NEXT: [[TMP4:%.*]] = load ptr, ptr [[TMP]], align 8
1016 // CHECK9-NEXT: store ptr [[TMP4]], ptr [[_TMP1]], align 8
1017 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1018 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
1019 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1020 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1021 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
1022 // CHECK9-NEXT: store i32 [[TMP5]], ptr [[T_VAR3]], align 4
1023 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VEC4]], ptr align 4 [[TMP1]], i64 8, i1 false)
1024 // CHECK9-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR5]], i32 0, i32 0
1025 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i64 2
1026 // CHECK9-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP6]]
1027 // CHECK9-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE6:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1028 // CHECK9: omp.arraycpy.body:
1029 // CHECK9-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP2]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1030 // CHECK9-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1031 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr align 4 [[OMP_ARRAYCPY_SRCELEMENTPAST]], i64 4, i1 false)
1032 // CHECK9-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1033 // CHECK9-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1034 // CHECK9-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP6]]
1035 // CHECK9-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE6]], label [[OMP_ARRAYCPY_BODY]]
1036 // CHECK9: omp.arraycpy.done6:
1037 // CHECK9-NEXT: [[TMP7:%.*]] = load ptr, ptr [[_TMP1]], align 8
1038 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VAR7]], ptr align 4 [[TMP7]], i64 4, i1 false)
1039 // CHECK9-NEXT: store ptr [[VAR7]], ptr [[_TMP8]], align 8
1040 // CHECK9-NEXT: [[TMP8:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1041 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP8]], align 4
1042 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP9]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1043 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1044 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP10]], 1
1045 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1046 // CHECK9: cond.true:
1047 // CHECK9-NEXT: br label [[COND_END:%.*]]
1048 // CHECK9: cond.false:
1049 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1050 // CHECK9-NEXT: br label [[COND_END]]
1051 // CHECK9: cond.end:
1052 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP11]], [[COND_FALSE]] ]
1053 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1054 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1055 // CHECK9-NEXT: store i32 [[TMP12]], ptr [[DOTOMP_IV]], align 4
1056 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1057 // CHECK9: omp.inner.for.cond:
1058 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1059 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1060 // CHECK9-NEXT: [[CMP9:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
1061 // CHECK9-NEXT: br i1 [[CMP9]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1062 // CHECK9: omp.inner.for.cond.cleanup:
1063 // CHECK9-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1064 // CHECK9: omp.inner.for.body:
1065 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1066 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP15]], 1
1067 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1068 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1069 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[T_VAR3]], align 4
1070 // CHECK9-NEXT: [[TMP17:%.*]] = load i32, ptr [[I]], align 4
1071 // CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP17]] to i64
1072 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC4]], i64 0, i64 [[IDXPROM]]
1073 // CHECK9-NEXT: store i32 [[TMP16]], ptr [[ARRAYIDX]], align 4
1074 // CHECK9-NEXT: [[TMP18:%.*]] = load ptr, ptr [[_TMP8]], align 8
1075 // CHECK9-NEXT: [[TMP19:%.*]] = load i32, ptr [[I]], align 4
1076 // CHECK9-NEXT: [[IDXPROM10:%.*]] = sext i32 [[TMP19]] to i64
1077 // CHECK9-NEXT: [[ARRAYIDX11:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR5]], i64 0, i64 [[IDXPROM10]]
1078 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX11]], ptr align 4 [[TMP18]], i64 4, i1 false)
1079 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1080 // CHECK9: omp.body.continue:
1081 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1082 // CHECK9: omp.inner.for.inc:
1083 // CHECK9-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1084 // CHECK9-NEXT: [[ADD12:%.*]] = add nsw i32 [[TMP20]], 1
1085 // CHECK9-NEXT: store i32 [[ADD12]], ptr [[DOTOMP_IV]], align 4
1086 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
1087 // CHECK9: omp.inner.for.end:
1088 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1089 // CHECK9: omp.loop.exit:
1090 // CHECK9-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1091 // CHECK9-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
1092 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP22]])
1093 // CHECK9-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR7]]) #[[ATTR4]]
1094 // CHECK9-NEXT: [[ARRAY_BEGIN13:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR5]], i32 0, i32 0
1095 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN13]], i64 2
1096 // CHECK9-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1097 // CHECK9: arraydestroy.body:
1098 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP23]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1099 // CHECK9-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
1100 // CHECK9-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
1101 // CHECK9-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN13]]
1102 // CHECK9-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE14:%.*]], label [[ARRAYDESTROY_BODY]]
1103 // CHECK9: arraydestroy.done14:
1104 // CHECK9-NEXT: ret void
1107 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIiED1Ev
1108 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1109 // CHECK9-NEXT: entry:
1110 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1111 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1112 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1113 // CHECK9-NEXT: call void @_ZN1SIiED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR4]]
1114 // CHECK9-NEXT: ret void
1117 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ev
1118 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1119 // CHECK9-NEXT: entry:
1120 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1121 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1122 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1123 // CHECK9-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
1124 // CHECK9-NEXT: store i32 0, ptr [[F]], align 4
1125 // CHECK9-NEXT: ret void
1128 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ei
1129 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef signext [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1130 // CHECK9-NEXT: entry:
1131 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1132 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1133 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1134 // CHECK9-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1135 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1136 // CHECK9-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
1137 // CHECK9-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
1138 // CHECK9-NEXT: store i32 [[TMP0]], ptr [[F]], align 4
1139 // CHECK9-NEXT: ret void
1142 // CHECK9-LABEL: define {{[^@]+}}@_ZN1SIiED2Ev
1143 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat {
1144 // CHECK9-NEXT: entry:
1145 // CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1146 // CHECK9-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1147 // CHECK9-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1148 // CHECK9-NEXT: ret void
1151 // CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1152 // CHECK9-SAME: () #[[ATTR6:[0-9]+]] {
1153 // CHECK9-NEXT: entry:
1154 // CHECK9-NEXT: call void @__tgt_register_requires(i64 1)
1155 // CHECK9-NEXT: ret void
1158 // CHECK11-LABEL: define {{[^@]+}}@main
1159 // CHECK11-SAME: () #[[ATTR0:[0-9]+]] {
1160 // CHECK11-NEXT: entry:
1161 // CHECK11-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
1162 // CHECK11-NEXT: [[G:%.*]] = alloca double, align 8
1163 // CHECK11-NEXT: [[G1:%.*]] = alloca ptr, align 4
1164 // CHECK11-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S:%.*]], align 4
1165 // CHECK11-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
1166 // CHECK11-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
1167 // CHECK11-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S], align 4
1168 // CHECK11-NEXT: [[VAR:%.*]] = alloca ptr, align 4
1169 // CHECK11-NEXT: [[TMP:%.*]] = alloca ptr, align 4
1170 // CHECK11-NEXT: [[T_VAR_CASTED:%.*]] = alloca i32, align 4
1171 // CHECK11-NEXT: [[SVAR_CASTED:%.*]] = alloca i32, align 4
1172 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [5 x ptr], align 4
1173 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [5 x ptr], align 4
1174 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [5 x ptr], align 4
1175 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
1176 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1177 // CHECK11-NEXT: store i32 0, ptr [[RETVAL]], align 4
1178 // CHECK11-NEXT: store ptr [[G]], ptr [[G1]], align 4
1179 // CHECK11-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
1180 // CHECK11-NEXT: store i32 0, ptr [[T_VAR]], align 4
1181 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[VEC]], ptr align 4 @__const.main.vec, i32 8, i1 false)
1182 // CHECK11-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
1183 // CHECK11-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], float noundef 1.000000e+00)
1184 // CHECK11-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYINIT_BEGIN]], i32 1
1185 // CHECK11-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], float noundef 2.000000e+00)
1186 // CHECK11-NEXT: store ptr [[TEST]], ptr [[VAR]], align 4
1187 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR]], align 4
1188 // CHECK11-NEXT: store ptr [[TMP0]], ptr [[TMP]], align 4
1189 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[T_VAR]], align 4
1190 // CHECK11-NEXT: store i32 [[TMP1]], ptr [[T_VAR_CASTED]], align 4
1191 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[T_VAR_CASTED]], align 4
1192 // CHECK11-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 4
1193 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr @_ZZ4mainE4svar, align 4
1194 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[SVAR_CASTED]], align 4
1195 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[SVAR_CASTED]], align 4
1196 // CHECK11-NEXT: [[TMP6:%.*]] = load ptr, ptr [[TMP]], align 4
1197 // CHECK11-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP]], align 4
1198 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1199 // CHECK11-NEXT: store i32 [[TMP2]], ptr [[TMP8]], align 4
1200 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1201 // CHECK11-NEXT: store i32 [[TMP2]], ptr [[TMP9]], align 4
1202 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
1203 // CHECK11-NEXT: store ptr null, ptr [[TMP10]], align 4
1204 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
1205 // CHECK11-NEXT: store ptr [[VEC]], ptr [[TMP11]], align 4
1206 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
1207 // CHECK11-NEXT: store ptr [[VEC]], ptr [[TMP12]], align 4
1208 // CHECK11-NEXT: [[TMP13:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
1209 // CHECK11-NEXT: store ptr null, ptr [[TMP13]], align 4
1210 // CHECK11-NEXT: [[TMP14:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
1211 // CHECK11-NEXT: store ptr [[S_ARR]], ptr [[TMP14]], align 4
1212 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
1213 // CHECK11-NEXT: store ptr [[S_ARR]], ptr [[TMP15]], align 4
1214 // CHECK11-NEXT: [[TMP16:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
1215 // CHECK11-NEXT: store ptr null, ptr [[TMP16]], align 4
1216 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
1217 // CHECK11-NEXT: store ptr [[TMP6]], ptr [[TMP17]], align 4
1218 // CHECK11-NEXT: [[TMP18:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
1219 // CHECK11-NEXT: store ptr [[TMP7]], ptr [[TMP18]], align 4
1220 // CHECK11-NEXT: [[TMP19:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 3
1221 // CHECK11-NEXT: store ptr null, ptr [[TMP19]], align 4
1222 // CHECK11-NEXT: [[TMP20:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 4
1223 // CHECK11-NEXT: store i32 [[TMP5]], ptr [[TMP20]], align 4
1224 // CHECK11-NEXT: [[TMP21:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 4
1225 // CHECK11-NEXT: store i32 [[TMP5]], ptr [[TMP21]], align 4
1226 // CHECK11-NEXT: [[TMP22:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 4
1227 // CHECK11-NEXT: store ptr null, ptr [[TMP22]], align 4
1228 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1229 // CHECK11-NEXT: [[TMP24:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1230 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1231 // CHECK11-NEXT: store i32 2, ptr [[TMP25]], align 4
1232 // CHECK11-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1233 // CHECK11-NEXT: store i32 5, ptr [[TMP26]], align 4
1234 // CHECK11-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1235 // CHECK11-NEXT: store ptr [[TMP23]], ptr [[TMP27]], align 4
1236 // CHECK11-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1237 // CHECK11-NEXT: store ptr [[TMP24]], ptr [[TMP28]], align 4
1238 // CHECK11-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1239 // CHECK11-NEXT: store ptr @.offload_sizes, ptr [[TMP29]], align 4
1240 // CHECK11-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1241 // CHECK11-NEXT: store ptr @.offload_maptypes, ptr [[TMP30]], align 4
1242 // CHECK11-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1243 // CHECK11-NEXT: store ptr null, ptr [[TMP31]], align 4
1244 // CHECK11-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1245 // CHECK11-NEXT: store ptr null, ptr [[TMP32]], align 4
1246 // CHECK11-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1247 // CHECK11-NEXT: store i64 2, ptr [[TMP33]], align 8
1248 // CHECK11-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1249 // CHECK11-NEXT: store i64 0, ptr [[TMP34]], align 8
1250 // CHECK11-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1251 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP35]], align 4
1252 // CHECK11-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1253 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP36]], align 4
1254 // CHECK11-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1255 // CHECK11-NEXT: store i32 0, ptr [[TMP37]], align 4
1256 // CHECK11-NEXT: [[TMP38:%.*]] = 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_l103.region_id, ptr [[KERNEL_ARGS]])
1257 // CHECK11-NEXT: [[TMP39:%.*]] = icmp ne i32 [[TMP38]], 0
1258 // CHECK11-NEXT: br i1 [[TMP39]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1259 // CHECK11: omp_offload.failed:
1260 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l103(i32 [[TMP2]], ptr [[VEC]], ptr [[S_ARR]], ptr [[TMP3]], i32 [[TMP5]]) #[[ATTR4:[0-9]+]]
1261 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
1262 // CHECK11: omp_offload.cont:
1263 // CHECK11-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiET_v()
1264 // CHECK11-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
1265 // CHECK11-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
1266 // CHECK11-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i32 2
1267 // CHECK11-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1268 // CHECK11: arraydestroy.body:
1269 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP40]], [[OMP_OFFLOAD_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1270 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1271 // CHECK11-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
1272 // CHECK11-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
1273 // CHECK11-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE2:%.*]], label [[ARRAYDESTROY_BODY]]
1274 // CHECK11: arraydestroy.done2:
1275 // CHECK11-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR4]]
1276 // CHECK11-NEXT: [[TMP41:%.*]] = load i32, ptr [[RETVAL]], align 4
1277 // CHECK11-NEXT: ret i32 [[TMP41]]
1280 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ev
1281 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat align 2 {
1282 // CHECK11-NEXT: entry:
1283 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1284 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1285 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1286 // CHECK11-NEXT: call void @_ZN1SIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
1287 // CHECK11-NEXT: ret void
1290 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ef
1291 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1292 // CHECK11-NEXT: entry:
1293 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1294 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
1295 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1296 // CHECK11-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
1297 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1298 // CHECK11-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
1299 // CHECK11-NEXT: call void @_ZN1SIfEC2Ef(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], float noundef [[TMP0]])
1300 // CHECK11-NEXT: ret void
1303 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l103
1304 // CHECK11-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 [[SVAR:%.*]]) #[[ATTR3:[0-9]+]] {
1305 // CHECK11-NEXT: entry:
1306 // CHECK11-NEXT: [[T_VAR_ADDR:%.*]] = alloca i32, align 4
1307 // CHECK11-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 4
1308 // CHECK11-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 4
1309 // CHECK11-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 4
1310 // CHECK11-NEXT: [[SVAR_ADDR:%.*]] = alloca i32, align 4
1311 // CHECK11-NEXT: [[TMP:%.*]] = alloca ptr, align 4
1312 // CHECK11-NEXT: store i32 [[T_VAR]], ptr [[T_VAR_ADDR]], align 4
1313 // CHECK11-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 4
1314 // CHECK11-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 4
1315 // CHECK11-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 4
1316 // CHECK11-NEXT: store i32 [[SVAR]], ptr [[SVAR_ADDR]], align 4
1317 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VEC_ADDR]], align 4
1318 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 4
1319 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR_ADDR]], align 4
1320 // CHECK11-NEXT: store ptr [[TMP2]], ptr [[TMP]], align 4
1321 // CHECK11-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 4
1322 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 5, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l103.omp_outlined, ptr [[T_VAR_ADDR]], ptr [[TMP0]], ptr [[TMP1]], ptr [[TMP3]], ptr [[SVAR_ADDR]])
1323 // CHECK11-NEXT: ret void
1326 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l103.omp_outlined
1327 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[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:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[SVAR:%.*]]) #[[ATTR3]] {
1328 // CHECK11-NEXT: entry:
1329 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1330 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1331 // CHECK11-NEXT: [[T_VAR_ADDR:%.*]] = alloca ptr, align 4
1332 // CHECK11-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 4
1333 // CHECK11-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 4
1334 // CHECK11-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 4
1335 // CHECK11-NEXT: [[SVAR_ADDR:%.*]] = alloca ptr, align 4
1336 // CHECK11-NEXT: [[TMP:%.*]] = alloca ptr, align 4
1337 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca ptr, align 4
1338 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1339 // CHECK11-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
1340 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1341 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1342 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1343 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1344 // CHECK11-NEXT: [[T_VAR3:%.*]] = alloca i32, align 4
1345 // CHECK11-NEXT: [[VEC4:%.*]] = alloca [2 x i32], align 4
1346 // CHECK11-NEXT: [[S_ARR5:%.*]] = alloca [2 x %struct.S], align 4
1347 // CHECK11-NEXT: [[VAR7:%.*]] = alloca [[STRUCT_S:%.*]], align 4
1348 // CHECK11-NEXT: [[_TMP8:%.*]] = alloca ptr, align 4
1349 // CHECK11-NEXT: [[SVAR9:%.*]] = alloca i32, align 4
1350 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
1351 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1352 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1353 // CHECK11-NEXT: store ptr [[T_VAR]], ptr [[T_VAR_ADDR]], align 4
1354 // CHECK11-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 4
1355 // CHECK11-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 4
1356 // CHECK11-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 4
1357 // CHECK11-NEXT: store ptr [[SVAR]], ptr [[SVAR_ADDR]], align 4
1358 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[T_VAR_ADDR]], align 4
1359 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[VEC_ADDR]], align 4
1360 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 4
1361 // CHECK11-NEXT: [[TMP3:%.*]] = load ptr, ptr [[VAR_ADDR]], align 4
1362 // CHECK11-NEXT: [[TMP4:%.*]] = load ptr, ptr [[SVAR_ADDR]], align 4
1363 // CHECK11-NEXT: store ptr [[TMP3]], ptr [[TMP]], align 4
1364 // CHECK11-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP]], align 4
1365 // CHECK11-NEXT: store ptr [[TMP5]], ptr [[_TMP1]], align 4
1366 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1367 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
1368 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1369 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1370 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[TMP0]], align 4
1371 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[T_VAR3]], align 4
1372 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[VEC4]], ptr align 4 [[TMP1]], i32 8, i1 false)
1373 // CHECK11-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR5]], i32 0, i32 0
1374 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i32 2
1375 // CHECK11-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP7]]
1376 // CHECK11-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE6:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1377 // CHECK11: omp.arraycpy.body:
1378 // CHECK11-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP2]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1379 // CHECK11-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1380 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr align 4 [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 4, i1 false)
1381 // CHECK11-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1382 // CHECK11-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1383 // CHECK11-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP7]]
1384 // CHECK11-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE6]], label [[OMP_ARRAYCPY_BODY]]
1385 // CHECK11: omp.arraycpy.done6:
1386 // CHECK11-NEXT: [[TMP8:%.*]] = load ptr, ptr [[_TMP1]], align 4
1387 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[VAR7]], ptr align 4 [[TMP8]], i32 4, i1 false)
1388 // CHECK11-NEXT: store ptr [[VAR7]], ptr [[_TMP8]], align 4
1389 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP4]], align 4
1390 // CHECK11-NEXT: store i32 [[TMP9]], ptr [[SVAR9]], align 4
1391 // CHECK11-NEXT: [[TMP10:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1392 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP10]], align 4
1393 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP11]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1394 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1395 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP12]], 1
1396 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1397 // CHECK11: cond.true:
1398 // CHECK11-NEXT: br label [[COND_END:%.*]]
1399 // CHECK11: cond.false:
1400 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1401 // CHECK11-NEXT: br label [[COND_END]]
1402 // CHECK11: cond.end:
1403 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP13]], [[COND_FALSE]] ]
1404 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1405 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1406 // CHECK11-NEXT: store i32 [[TMP14]], ptr [[DOTOMP_IV]], align 4
1407 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1408 // CHECK11: omp.inner.for.cond:
1409 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1410 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1411 // CHECK11-NEXT: [[CMP10:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
1412 // CHECK11-NEXT: br i1 [[CMP10]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1413 // CHECK11: omp.inner.for.cond.cleanup:
1414 // CHECK11-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1415 // CHECK11: omp.inner.for.body:
1416 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1417 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP17]], 1
1418 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1419 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1420 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[T_VAR3]], align 4
1421 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[I]], align 4
1422 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC4]], i32 0, i32 [[TMP19]]
1423 // CHECK11-NEXT: store i32 [[TMP18]], ptr [[ARRAYIDX]], align 4
1424 // CHECK11-NEXT: [[TMP20:%.*]] = load ptr, ptr [[_TMP8]], align 4
1425 // CHECK11-NEXT: [[TMP21:%.*]] = load i32, ptr [[I]], align 4
1426 // CHECK11-NEXT: [[ARRAYIDX11:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR5]], i32 0, i32 [[TMP21]]
1427 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[ARRAYIDX11]], ptr align 4 [[TMP20]], i32 4, i1 false)
1428 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1429 // CHECK11: omp.body.continue:
1430 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1431 // CHECK11: omp.inner.for.inc:
1432 // CHECK11-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1433 // CHECK11-NEXT: [[ADD12:%.*]] = add nsw i32 [[TMP22]], 1
1434 // CHECK11-NEXT: store i32 [[ADD12]], ptr [[DOTOMP_IV]], align 4
1435 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]]
1436 // CHECK11: omp.inner.for.end:
1437 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1438 // CHECK11: omp.loop.exit:
1439 // CHECK11-NEXT: [[TMP23:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1440 // CHECK11-NEXT: [[TMP24:%.*]] = load i32, ptr [[TMP23]], align 4
1441 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP24]])
1442 // CHECK11-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR7]]) #[[ATTR4]]
1443 // CHECK11-NEXT: [[ARRAY_BEGIN13:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR5]], i32 0, i32 0
1444 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN13]], i32 2
1445 // CHECK11-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1446 // CHECK11: arraydestroy.body:
1447 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP25]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1448 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1449 // CHECK11-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
1450 // CHECK11-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN13]]
1451 // CHECK11-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE14:%.*]], label [[ARRAYDESTROY_BODY]]
1452 // CHECK11: arraydestroy.done14:
1453 // CHECK11-NEXT: ret void
1456 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIfED1Ev
1457 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1458 // CHECK11-NEXT: entry:
1459 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1460 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1461 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1462 // CHECK11-NEXT: call void @_ZN1SIfED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR4]]
1463 // CHECK11-NEXT: ret void
1466 // CHECK11-LABEL: define {{[^@]+}}@_Z5tmainIiET_v
1467 // CHECK11-SAME: () #[[ATTR5:[0-9]+]] comdat {
1468 // CHECK11-NEXT: entry:
1469 // CHECK11-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
1470 // CHECK11-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
1471 // CHECK11-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
1472 // CHECK11-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
1473 // CHECK11-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
1474 // CHECK11-NEXT: [[VAR:%.*]] = alloca ptr, align 4
1475 // CHECK11-NEXT: [[TMP:%.*]] = alloca ptr, align 4
1476 // CHECK11-NEXT: [[T_VAR_CASTED:%.*]] = alloca i32, align 4
1477 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [4 x ptr], align 4
1478 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [4 x ptr], align 4
1479 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [4 x ptr], align 4
1480 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
1481 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1482 // CHECK11-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
1483 // CHECK11-NEXT: store i32 0, ptr [[T_VAR]], align 4
1484 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[VEC]], ptr align 4 @__const._Z5tmainIiET_v.vec, i32 8, i1 false)
1485 // CHECK11-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1486 // CHECK11-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], i32 noundef 1)
1487 // CHECK11-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYINIT_BEGIN]], i32 1
1488 // CHECK11-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], i32 noundef 2)
1489 // CHECK11-NEXT: store ptr [[TEST]], ptr [[VAR]], align 4
1490 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR]], align 4
1491 // CHECK11-NEXT: store ptr [[TMP0]], ptr [[TMP]], align 4
1492 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[T_VAR]], align 4
1493 // CHECK11-NEXT: store i32 [[TMP1]], ptr [[T_VAR_CASTED]], align 4
1494 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[T_VAR_CASTED]], align 4
1495 // CHECK11-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 4
1496 // CHECK11-NEXT: [[TMP4:%.*]] = load ptr, ptr [[TMP]], align 4
1497 // CHECK11-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP]], align 4
1498 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1499 // CHECK11-NEXT: store i32 [[TMP2]], ptr [[TMP6]], align 4
1500 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1501 // CHECK11-NEXT: store i32 [[TMP2]], ptr [[TMP7]], align 4
1502 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
1503 // CHECK11-NEXT: store ptr null, ptr [[TMP8]], align 4
1504 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
1505 // CHECK11-NEXT: store ptr [[VEC]], ptr [[TMP9]], align 4
1506 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
1507 // CHECK11-NEXT: store ptr [[VEC]], ptr [[TMP10]], align 4
1508 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
1509 // CHECK11-NEXT: store ptr null, ptr [[TMP11]], align 4
1510 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
1511 // CHECK11-NEXT: store ptr [[S_ARR]], ptr [[TMP12]], align 4
1512 // CHECK11-NEXT: [[TMP13:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
1513 // CHECK11-NEXT: store ptr [[S_ARR]], ptr [[TMP13]], align 4
1514 // CHECK11-NEXT: [[TMP14:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
1515 // CHECK11-NEXT: store ptr null, ptr [[TMP14]], align 4
1516 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
1517 // CHECK11-NEXT: store ptr [[TMP4]], ptr [[TMP15]], align 4
1518 // CHECK11-NEXT: [[TMP16:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
1519 // CHECK11-NEXT: store ptr [[TMP5]], ptr [[TMP16]], align 4
1520 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 3
1521 // CHECK11-NEXT: store ptr null, ptr [[TMP17]], align 4
1522 // CHECK11-NEXT: [[TMP18:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1523 // CHECK11-NEXT: [[TMP19:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1524 // CHECK11-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1525 // CHECK11-NEXT: store i32 2, ptr [[TMP20]], align 4
1526 // CHECK11-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1527 // CHECK11-NEXT: store i32 4, ptr [[TMP21]], align 4
1528 // CHECK11-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1529 // CHECK11-NEXT: store ptr [[TMP18]], ptr [[TMP22]], align 4
1530 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1531 // CHECK11-NEXT: store ptr [[TMP19]], ptr [[TMP23]], align 4
1532 // CHECK11-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1533 // CHECK11-NEXT: store ptr @.offload_sizes.1, ptr [[TMP24]], align 4
1534 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1535 // CHECK11-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP25]], align 4
1536 // CHECK11-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1537 // CHECK11-NEXT: store ptr null, ptr [[TMP26]], align 4
1538 // CHECK11-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1539 // CHECK11-NEXT: store ptr null, ptr [[TMP27]], align 4
1540 // CHECK11-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1541 // CHECK11-NEXT: store i64 2, ptr [[TMP28]], align 8
1542 // CHECK11-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1543 // CHECK11-NEXT: store i64 0, ptr [[TMP29]], align 8
1544 // CHECK11-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1545 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP30]], align 4
1546 // CHECK11-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1547 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP31]], align 4
1548 // CHECK11-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1549 // CHECK11-NEXT: store i32 0, ptr [[TMP32]], align 4
1550 // CHECK11-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_l49.region_id, ptr [[KERNEL_ARGS]])
1551 // CHECK11-NEXT: [[TMP34:%.*]] = icmp ne i32 [[TMP33]], 0
1552 // CHECK11-NEXT: br i1 [[TMP34]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1553 // CHECK11: omp_offload.failed:
1554 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49(i32 [[TMP2]], ptr [[VEC]], ptr [[S_ARR]], ptr [[TMP3]]) #[[ATTR4]]
1555 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
1556 // CHECK11: omp_offload.cont:
1557 // CHECK11-NEXT: store i32 0, ptr [[RETVAL]], align 4
1558 // CHECK11-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
1559 // CHECK11-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i32 2
1560 // CHECK11-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1561 // CHECK11: arraydestroy.body:
1562 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP35]], [[OMP_OFFLOAD_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1563 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1564 // CHECK11-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
1565 // CHECK11-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
1566 // CHECK11-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE2:%.*]], label [[ARRAYDESTROY_BODY]]
1567 // CHECK11: arraydestroy.done2:
1568 // CHECK11-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR4]]
1569 // CHECK11-NEXT: [[TMP36:%.*]] = load i32, ptr [[RETVAL]], align 4
1570 // CHECK11-NEXT: ret i32 [[TMP36]]
1573 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ev
1574 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1575 // CHECK11-NEXT: entry:
1576 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1577 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1578 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1579 // CHECK11-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
1580 // CHECK11-NEXT: store float 0.000000e+00, ptr [[F]], align 4
1581 // CHECK11-NEXT: ret void
1584 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ef
1585 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1586 // CHECK11-NEXT: entry:
1587 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1588 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
1589 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1590 // CHECK11-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
1591 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1592 // CHECK11-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
1593 // CHECK11-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
1594 // CHECK11-NEXT: store float [[TMP0]], ptr [[F]], align 4
1595 // CHECK11-NEXT: ret void
1598 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIfED2Ev
1599 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1600 // CHECK11-NEXT: entry:
1601 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1602 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1603 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1604 // CHECK11-NEXT: ret void
1607 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ev
1608 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1609 // CHECK11-NEXT: entry:
1610 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1611 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1612 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1613 // CHECK11-NEXT: call void @_ZN1SIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
1614 // CHECK11-NEXT: ret void
1617 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ei
1618 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1619 // CHECK11-NEXT: entry:
1620 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1621 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1622 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1623 // CHECK11-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1624 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1625 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
1626 // CHECK11-NEXT: call void @_ZN1SIiEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], i32 noundef [[TMP0]])
1627 // CHECK11-NEXT: ret void
1630 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49
1631 // CHECK11-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:%.*]]) #[[ATTR3]] {
1632 // CHECK11-NEXT: entry:
1633 // CHECK11-NEXT: [[T_VAR_ADDR:%.*]] = alloca i32, align 4
1634 // CHECK11-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 4
1635 // CHECK11-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 4
1636 // CHECK11-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 4
1637 // CHECK11-NEXT: [[TMP:%.*]] = alloca ptr, align 4
1638 // CHECK11-NEXT: store i32 [[T_VAR]], ptr [[T_VAR_ADDR]], align 4
1639 // CHECK11-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 4
1640 // CHECK11-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 4
1641 // CHECK11-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 4
1642 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VEC_ADDR]], align 4
1643 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 4
1644 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR_ADDR]], align 4
1645 // CHECK11-NEXT: store ptr [[TMP2]], ptr [[TMP]], align 4
1646 // CHECK11-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 4
1647 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.omp_outlined, ptr [[T_VAR_ADDR]], ptr [[TMP0]], ptr [[TMP1]], ptr [[TMP3]])
1648 // CHECK11-NEXT: ret void
1651 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiET_v_l49.omp_outlined
1652 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[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:%.*]]) #[[ATTR3]] {
1653 // CHECK11-NEXT: entry:
1654 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1655 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1656 // CHECK11-NEXT: [[T_VAR_ADDR:%.*]] = alloca ptr, align 4
1657 // CHECK11-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 4
1658 // CHECK11-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 4
1659 // CHECK11-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 4
1660 // CHECK11-NEXT: [[TMP:%.*]] = alloca ptr, align 4
1661 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca ptr, align 4
1662 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1663 // CHECK11-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
1664 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1665 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1666 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1667 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1668 // CHECK11-NEXT: [[T_VAR3:%.*]] = alloca i32, align 4
1669 // CHECK11-NEXT: [[VEC4:%.*]] = alloca [2 x i32], align 4
1670 // CHECK11-NEXT: [[S_ARR5:%.*]] = alloca [2 x %struct.S.0], align 4
1671 // CHECK11-NEXT: [[VAR7:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
1672 // CHECK11-NEXT: [[_TMP8:%.*]] = alloca ptr, align 4
1673 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
1674 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1675 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1676 // CHECK11-NEXT: store ptr [[T_VAR]], ptr [[T_VAR_ADDR]], align 4
1677 // CHECK11-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 4
1678 // CHECK11-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 4
1679 // CHECK11-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 4
1680 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[T_VAR_ADDR]], align 4
1681 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[VEC_ADDR]], align 4
1682 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 4
1683 // CHECK11-NEXT: [[TMP3:%.*]] = load ptr, ptr [[VAR_ADDR]], align 4
1684 // CHECK11-NEXT: store ptr [[TMP3]], ptr [[TMP]], align 4
1685 // CHECK11-NEXT: [[TMP4:%.*]] = load ptr, ptr [[TMP]], align 4
1686 // CHECK11-NEXT: store ptr [[TMP4]], ptr [[_TMP1]], align 4
1687 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1688 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
1689 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1690 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1691 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
1692 // CHECK11-NEXT: store i32 [[TMP5]], ptr [[T_VAR3]], align 4
1693 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[VEC4]], ptr align 4 [[TMP1]], i32 8, i1 false)
1694 // CHECK11-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR5]], i32 0, i32 0
1695 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i32 2
1696 // CHECK11-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP6]]
1697 // CHECK11-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE6:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1698 // CHECK11: omp.arraycpy.body:
1699 // CHECK11-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP2]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1700 // CHECK11-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1701 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr align 4 [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 4, i1 false)
1702 // CHECK11-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1703 // CHECK11-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1704 // CHECK11-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP6]]
1705 // CHECK11-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE6]], label [[OMP_ARRAYCPY_BODY]]
1706 // CHECK11: omp.arraycpy.done6:
1707 // CHECK11-NEXT: [[TMP7:%.*]] = load ptr, ptr [[_TMP1]], align 4
1708 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[VAR7]], ptr align 4 [[TMP7]], i32 4, i1 false)
1709 // CHECK11-NEXT: store ptr [[VAR7]], ptr [[_TMP8]], align 4
1710 // CHECK11-NEXT: [[TMP8:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1711 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP8]], align 4
1712 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP9]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1713 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1714 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP10]], 1
1715 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1716 // CHECK11: cond.true:
1717 // CHECK11-NEXT: br label [[COND_END:%.*]]
1718 // CHECK11: cond.false:
1719 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1720 // CHECK11-NEXT: br label [[COND_END]]
1721 // CHECK11: cond.end:
1722 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP11]], [[COND_FALSE]] ]
1723 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1724 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1725 // CHECK11-NEXT: store i32 [[TMP12]], ptr [[DOTOMP_IV]], align 4
1726 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1727 // CHECK11: omp.inner.for.cond:
1728 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1729 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1730 // CHECK11-NEXT: [[CMP9:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
1731 // CHECK11-NEXT: br i1 [[CMP9]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1732 // CHECK11: omp.inner.for.cond.cleanup:
1733 // CHECK11-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1734 // CHECK11: omp.inner.for.body:
1735 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1736 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP15]], 1
1737 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1738 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1739 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[T_VAR3]], align 4
1740 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[I]], align 4
1741 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC4]], i32 0, i32 [[TMP17]]
1742 // CHECK11-NEXT: store i32 [[TMP16]], ptr [[ARRAYIDX]], align 4
1743 // CHECK11-NEXT: [[TMP18:%.*]] = load ptr, ptr [[_TMP8]], align 4
1744 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[I]], align 4
1745 // CHECK11-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR5]], i32 0, i32 [[TMP19]]
1746 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[ARRAYIDX10]], ptr align 4 [[TMP18]], i32 4, i1 false)
1747 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1748 // CHECK11: omp.body.continue:
1749 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1750 // CHECK11: omp.inner.for.inc:
1751 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1752 // CHECK11-NEXT: [[ADD11:%.*]] = add nsw i32 [[TMP20]], 1
1753 // CHECK11-NEXT: store i32 [[ADD11]], ptr [[DOTOMP_IV]], align 4
1754 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]]
1755 // CHECK11: omp.inner.for.end:
1756 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1757 // CHECK11: omp.loop.exit:
1758 // CHECK11-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1759 // CHECK11-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
1760 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP22]])
1761 // CHECK11-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR7]]) #[[ATTR4]]
1762 // CHECK11-NEXT: [[ARRAY_BEGIN12:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR5]], i32 0, i32 0
1763 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN12]], i32 2
1764 // CHECK11-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1765 // CHECK11: arraydestroy.body:
1766 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP23]], [[OMP_LOOP_EXIT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1767 // CHECK11-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i32 -1
1768 // CHECK11-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
1769 // CHECK11-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN12]]
1770 // CHECK11-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE13:%.*]], label [[ARRAYDESTROY_BODY]]
1771 // CHECK11: arraydestroy.done13:
1772 // CHECK11-NEXT: ret void
1775 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIiED1Ev
1776 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1777 // CHECK11-NEXT: entry:
1778 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1779 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1780 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1781 // CHECK11-NEXT: call void @_ZN1SIiED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR4]]
1782 // CHECK11-NEXT: ret void
1785 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ev
1786 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1787 // CHECK11-NEXT: entry:
1788 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1789 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1790 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1791 // CHECK11-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
1792 // CHECK11-NEXT: store i32 0, ptr [[F]], align 4
1793 // CHECK11-NEXT: ret void
1796 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ei
1797 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1798 // CHECK11-NEXT: entry:
1799 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1800 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1801 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1802 // CHECK11-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1803 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1804 // CHECK11-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
1805 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
1806 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[F]], align 4
1807 // CHECK11-NEXT: ret void
1810 // CHECK11-LABEL: define {{[^@]+}}@_ZN1SIiED2Ev
1811 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
1812 // CHECK11-NEXT: entry:
1813 // CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
1814 // CHECK11-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
1815 // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
1816 // CHECK11-NEXT: ret void
1819 // CHECK11-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1820 // CHECK11-SAME: () #[[ATTR6:[0-9]+]] {
1821 // CHECK11-NEXT: entry:
1822 // CHECK11-NEXT: call void @__tgt_register_requires(i64 1)
1823 // CHECK11-NEXT: ret void