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