Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / parallel_private_codegen.cpp
blob5d8326f203b61b9152edcba5cd205615e5fb88dc
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 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK1
3 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
4 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK1
5 // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK3
6 // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK4
8 // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
9 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
10 // RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
11 // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-unknown-linux -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
12 // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-unknown-linux -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
13 // expected-no-diagnostics
14 #ifndef HEADER
15 #define HEADER
17 enum omp_allocator_handle_t {
18 omp_null_allocator = 0,
19 omp_default_mem_alloc = 1,
20 omp_large_cap_mem_alloc = 2,
21 omp_const_mem_alloc = 3,
22 omp_high_bw_mem_alloc = 4,
23 omp_low_lat_mem_alloc = 5,
24 omp_cgroup_mem_alloc = 6,
25 omp_pteam_mem_alloc = 7,
26 omp_thread_mem_alloc = 8,
27 KMP_ALLOCATOR_MAX_HANDLE = __UINTPTR_MAX__
30 template <class T>
31 struct S {
32 T f;
33 S(T a) : f(a) {}
34 S() : f() {}
35 operator T() { return T(); }
36 ~S() {}
39 volatile int g __attribute__((aligned(128))) = 1212;
41 struct SS {
42 int a;
43 int b : 4;
44 int &c;
45 SS(int &d) : a(0), b(0), c(d) {
46 #pragma omp parallel private(a, b, c)
47 #ifdef LAMBDA
48 [&]() {
49 ++this->a, --b, (this)->c /= 1;
50 #pragma omp parallel private(a, b, c)
51 ++(this)->a, --b, this->c /= 1;
52 }();
53 #elif defined(BLOCKS)
55 ++a;
56 --this->b;
57 (this)->c /= 1;
58 #pragma omp parallel private(a, b, c)
59 ++(this)->a, --b, this->c /= 1;
60 }();
61 #else
62 ++this->a, --b, c /= 1;
63 #endif
67 template<typename T>
68 struct SST {
69 T a;
70 SST() : a(T()) {
71 #pragma omp parallel private(a) allocate(omp_large_cap_mem_alloc:a)
72 #ifdef LAMBDA
73 [&]() {
74 [&]() {
75 ++this->a;
76 #pragma omp parallel private(a)
77 ++(this)->a;
78 }();
79 }();
80 #elif defined(BLOCKS)
83 ++a;
84 #pragma omp parallel private(a)
85 ++(this)->a;
86 }();
87 }();
88 #else
89 ++(this)->a;
90 #endif
94 template <typename T>
95 T tmain() {
96 S<T> test;
97 SST<T> sst;
98 T t_var __attribute__((aligned(128))) = T();
99 T vec[] __attribute__((aligned(128))) = {1, 2};
100 S<T> s_arr[] __attribute__((aligned(128))) = {1, 2};
101 S<T> var __attribute__((aligned(128))) (3);
102 #pragma omp parallel private(t_var, vec, s_arr, var)
104 vec[0] = t_var;
105 s_arr[0] = var;
107 return T();
110 int main() {
111 static int sivar;
112 SS ss(sivar);
113 #ifdef LAMBDA
114 [&]() {
115 #pragma omp parallel private(g, sivar)
120 g = 1;
121 sivar = 2;
124 [&]() {
125 g = 2;
126 sivar = 4;
127 }();
129 }();
130 return 0;
131 #elif defined(BLOCKS)
133 #pragma omp parallel private(g, sivar)
135 g = 1;
136 sivar = 20;
138 g = 2;
139 sivar = 40;
140 }();
142 }();
143 return 0;
146 #else
147 S<float> test;
148 int t_var = 0;
149 int vec[] = {1, 2};
150 S<float> s_arr[] = {1, 2};
151 S<float> var(3);
152 #pragma omp parallel private(t_var, vec, s_arr, var, sivar)
154 vec[0] = t_var;
155 s_arr[0] = var;
156 sivar = 3;
158 return tmain<int>();
159 #endif
168 #endif
170 // CHECK1-LABEL: define {{[^@]+}}@main
171 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
172 // CHECK1-NEXT: entry:
173 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
174 // CHECK1-NEXT: [[SS:%.*]] = alloca [[STRUCT_SS:%.*]], align 8
175 // CHECK1-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S:%.*]], align 4
176 // CHECK1-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
177 // CHECK1-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
178 // CHECK1-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S], align 4
179 // CHECK1-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S]], align 4
180 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
181 // CHECK1-NEXT: call void @_ZN2SSC1ERi(ptr noundef nonnull align 8 dereferenceable(16) [[SS]], ptr noundef nonnull align 4 dereferenceable(4) @_ZZ4mainE5sivar)
182 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
183 // CHECK1-NEXT: store i32 0, ptr [[T_VAR]], align 4
184 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VEC]], ptr align 4 @__const.main.vec, i64 8, i1 false)
185 // CHECK1-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i64 0, i64 0
186 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], float noundef 1.000000e+00)
187 // CHECK1-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYINIT_BEGIN]], i64 1
188 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], float noundef 2.000000e+00)
189 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]], float noundef 3.000000e+00)
190 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1:[0-9]+]], i32 0, ptr @main.omp_outlined)
191 // CHECK1-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiET_v()
192 // CHECK1-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
193 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR4:[0-9]+]]
194 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
195 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i64 2
196 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
197 // CHECK1: arraydestroy.body:
198 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP0]], [[ENTRY:%.*]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
199 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
200 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
201 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
202 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE1:%.*]], label [[ARRAYDESTROY_BODY]]
203 // CHECK1: arraydestroy.done1:
204 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR4]]
205 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[RETVAL]], align 4
206 // CHECK1-NEXT: ret i32 [[TMP1]]
209 // CHECK1-LABEL: define {{[^@]+}}@_ZN2SSC1ERi
210 // CHECK1-SAME: (ptr noundef nonnull align 8 dereferenceable(16) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[D:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat align 2 {
211 // CHECK1-NEXT: entry:
212 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
213 // CHECK1-NEXT: [[D_ADDR:%.*]] = alloca ptr, align 8
214 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
215 // CHECK1-NEXT: store ptr [[D]], ptr [[D_ADDR]], align 8
216 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
217 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[D_ADDR]], align 8
218 // CHECK1-NEXT: call void @_ZN2SSC2ERi(ptr noundef nonnull align 8 dereferenceable(16) [[THIS1]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP0]])
219 // CHECK1-NEXT: ret void
222 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ev
223 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
224 // CHECK1-NEXT: entry:
225 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
226 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
227 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
228 // CHECK1-NEXT: call void @_ZN1SIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
229 // CHECK1-NEXT: ret void
232 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ef
233 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
234 // CHECK1-NEXT: entry:
235 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
236 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
237 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
238 // CHECK1-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
239 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
240 // CHECK1-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
241 // CHECK1-NEXT: call void @_ZN1SIfEC2Ef(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], float noundef [[TMP0]])
242 // CHECK1-NEXT: ret void
245 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined
246 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR3:[0-9]+]] {
247 // CHECK1-NEXT: entry:
248 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
249 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
250 // CHECK1-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
251 // CHECK1-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
252 // CHECK1-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S], align 4
253 // CHECK1-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S:%.*]], align 4
254 // CHECK1-NEXT: [[SIVAR:%.*]] = alloca i32, align 4
255 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
256 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
257 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
258 // CHECK1-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i64 2
259 // CHECK1-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
260 // CHECK1: arrayctor.loop:
261 // CHECK1-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
262 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
263 // CHECK1-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYCTOR_CUR]], i64 1
264 // CHECK1-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
265 // CHECK1-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
266 // CHECK1: arrayctor.cont:
267 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
268 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[T_VAR]], align 4
269 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC]], i64 0, i64 0
270 // CHECK1-NEXT: store i32 [[TMP0]], ptr [[ARRAYIDX]], align 4
271 // CHECK1-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i64 0, i64 0
272 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX1]], ptr align 4 [[VAR]], i64 4, i1 false)
273 // CHECK1-NEXT: store i32 3, ptr [[SIVAR]], align 4
274 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR4]]
275 // CHECK1-NEXT: [[ARRAY_BEGIN2:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
276 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN2]], i64 2
277 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
278 // CHECK1: arraydestroy.body:
279 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP1]], [[ARRAYCTOR_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
280 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
281 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
282 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN2]]
283 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE3:%.*]], label [[ARRAYDESTROY_BODY]]
284 // CHECK1: arraydestroy.done3:
285 // CHECK1-NEXT: ret void
288 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfED1Ev
289 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
290 // CHECK1-NEXT: entry:
291 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
292 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
293 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
294 // CHECK1-NEXT: call void @_ZN1SIfED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR4]]
295 // CHECK1-NEXT: ret void
298 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiET_v
299 // CHECK1-SAME: () #[[ATTR5:[0-9]+]] comdat {
300 // CHECK1-NEXT: entry:
301 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
302 // CHECK1-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
303 // CHECK1-NEXT: [[SST:%.*]] = alloca [[STRUCT_SST:%.*]], align 4
304 // CHECK1-NEXT: [[T_VAR:%.*]] = alloca i32, align 128
305 // CHECK1-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 128
306 // CHECK1-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 128
307 // CHECK1-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S_0]], align 128
308 // CHECK1-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
309 // CHECK1-NEXT: call void @_ZN3SSTIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[SST]])
310 // CHECK1-NEXT: store i32 0, ptr [[T_VAR]], align 128
311 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 128 [[VEC]], ptr align 128 @__const._Z5tmainIiET_v.vec, i64 8, i1 false)
312 // CHECK1-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i64 0, i64 0
313 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], i32 noundef 1)
314 // CHECK1-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYINIT_BEGIN]], i64 1
315 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], i32 noundef 2)
316 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]], i32 noundef 3)
317 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 0, ptr @_Z5tmainIiET_v.omp_outlined)
318 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
319 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR4]]
320 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
321 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i64 2
322 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
323 // CHECK1: arraydestroy.body:
324 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP0]], [[ENTRY:%.*]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
325 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
326 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
327 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN]]
328 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE1:%.*]], label [[ARRAYDESTROY_BODY]]
329 // CHECK1: arraydestroy.done1:
330 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR4]]
331 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[RETVAL]], align 4
332 // CHECK1-NEXT: ret i32 [[TMP1]]
335 // CHECK1-LABEL: define {{[^@]+}}@_ZN2SSC2ERi
336 // CHECK1-SAME: (ptr noundef nonnull align 8 dereferenceable(16) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[D:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
337 // CHECK1-NEXT: entry:
338 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
339 // CHECK1-NEXT: [[D_ADDR:%.*]] = alloca ptr, align 8
340 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
341 // CHECK1-NEXT: store ptr [[D]], ptr [[D_ADDR]], align 8
342 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
343 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 0
344 // CHECK1-NEXT: store i32 0, ptr [[A]], align 8
345 // CHECK1-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 1
346 // CHECK1-NEXT: [[BF_LOAD:%.*]] = load i8, ptr [[B]], align 4
347 // CHECK1-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF_LOAD]], -16
348 // CHECK1-NEXT: [[BF_SET:%.*]] = or i8 [[BF_CLEAR]], 0
349 // CHECK1-NEXT: store i8 [[BF_SET]], ptr [[B]], align 4
350 // CHECK1-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 2
351 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[D_ADDR]], align 8
352 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[C]], align 8
353 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @_ZN2SSC2ERi.omp_outlined, ptr [[THIS1]])
354 // CHECK1-NEXT: ret void
357 // CHECK1-LABEL: define {{[^@]+}}@_ZN2SSC2ERi.omp_outlined
358 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR3]] {
359 // CHECK1-NEXT: entry:
360 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
361 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
362 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
363 // CHECK1-NEXT: [[A:%.*]] = alloca i32, align 4
364 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
365 // CHECK1-NEXT: [[B:%.*]] = alloca i32, align 4
366 // CHECK1-NEXT: [[C:%.*]] = alloca i32, align 4
367 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
368 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
369 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
370 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
371 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
372 // CHECK1-NEXT: store ptr [[A]], ptr [[TMP]], align 8
373 // CHECK1-NEXT: store ptr [[C]], ptr [[_TMP1]], align 8
374 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP]], align 8
375 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
376 // CHECK1-NEXT: [[INC:%.*]] = add nsw i32 [[TMP2]], 1
377 // CHECK1-NEXT: store i32 [[INC]], ptr [[TMP1]], align 4
378 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[B]], align 4
379 // CHECK1-NEXT: [[DEC:%.*]] = add nsw i32 [[TMP3]], -1
380 // CHECK1-NEXT: store i32 [[DEC]], ptr [[B]], align 4
381 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[_TMP1]], align 8
382 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP4]], align 4
383 // CHECK1-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP5]], 1
384 // CHECK1-NEXT: store i32 [[DIV]], ptr [[TMP4]], align 4
385 // CHECK1-NEXT: ret void
388 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ev
389 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
390 // CHECK1-NEXT: entry:
391 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
392 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
393 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
394 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
395 // CHECK1-NEXT: store float 0.000000e+00, ptr [[F]], align 4
396 // CHECK1-NEXT: ret void
399 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ef
400 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
401 // CHECK1-NEXT: entry:
402 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
403 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
404 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
405 // CHECK1-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
406 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
407 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
408 // CHECK1-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
409 // CHECK1-NEXT: store float [[TMP0]], ptr [[F]], align 4
410 // CHECK1-NEXT: ret void
413 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfED2Ev
414 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
415 // CHECK1-NEXT: entry:
416 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
417 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
418 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
419 // CHECK1-NEXT: ret void
422 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ev
423 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
424 // CHECK1-NEXT: entry:
425 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
426 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
427 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
428 // CHECK1-NEXT: call void @_ZN1SIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
429 // CHECK1-NEXT: ret void
432 // CHECK1-LABEL: define {{[^@]+}}@_ZN3SSTIiEC1Ev
433 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
434 // CHECK1-NEXT: entry:
435 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
436 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
437 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
438 // CHECK1-NEXT: call void @_ZN3SSTIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
439 // CHECK1-NEXT: ret void
442 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ei
443 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
444 // CHECK1-NEXT: entry:
445 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
446 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
447 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
448 // CHECK1-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
449 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
450 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
451 // CHECK1-NEXT: call void @_ZN1SIiEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], i32 noundef [[TMP0]])
452 // CHECK1-NEXT: ret void
455 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiET_v.omp_outlined
456 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] {
457 // CHECK1-NEXT: entry:
458 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
459 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
460 // CHECK1-NEXT: [[T_VAR:%.*]] = alloca i32, align 128
461 // CHECK1-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 128
462 // CHECK1-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 128
463 // CHECK1-NEXT: [[VAR:%.*]] = alloca [[STRUCT_S_0:%.*]], align 128
464 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
465 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
466 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
467 // CHECK1-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i64 2
468 // CHECK1-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
469 // CHECK1: arrayctor.loop:
470 // CHECK1-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
471 // CHECK1-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
472 // CHECK1-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYCTOR_CUR]], i64 1
473 // CHECK1-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
474 // CHECK1-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
475 // CHECK1: arrayctor.cont:
476 // CHECK1-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]])
477 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[T_VAR]], align 128
478 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC]], i64 0, i64 0
479 // CHECK1-NEXT: store i32 [[TMP0]], ptr [[ARRAYIDX]], align 128
480 // CHECK1-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i64 0, i64 0
481 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 128 [[ARRAYIDX1]], ptr align 128 [[VAR]], i64 4, i1 false)
482 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR]]) #[[ATTR4]]
483 // CHECK1-NEXT: [[ARRAY_BEGIN2:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
484 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN2]], i64 2
485 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
486 // CHECK1: arraydestroy.body:
487 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP1]], [[ARRAYCTOR_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
488 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
489 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR4]]
490 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN2]]
491 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE3:%.*]], label [[ARRAYDESTROY_BODY]]
492 // CHECK1: arraydestroy.done3:
493 // CHECK1-NEXT: ret void
496 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiED1Ev
497 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
498 // CHECK1-NEXT: entry:
499 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
500 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
501 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
502 // CHECK1-NEXT: call void @_ZN1SIiED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR4]]
503 // CHECK1-NEXT: ret void
506 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ev
507 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
508 // CHECK1-NEXT: entry:
509 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
510 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
511 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
512 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
513 // CHECK1-NEXT: store i32 0, ptr [[F]], align 4
514 // CHECK1-NEXT: ret void
517 // CHECK1-LABEL: define {{[^@]+}}@_ZN3SSTIiEC2Ev
518 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
519 // CHECK1-NEXT: entry:
520 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
521 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
522 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
523 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SST:%.*]], ptr [[THIS1]], i32 0, i32 0
524 // CHECK1-NEXT: store i32 0, ptr [[A]], align 4
525 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @_ZN3SSTIiEC2Ev.omp_outlined, ptr [[THIS1]])
526 // CHECK1-NEXT: ret void
529 // CHECK1-LABEL: define {{[^@]+}}@_ZN3SSTIiEC2Ev.omp_outlined
530 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR3]] {
531 // CHECK1-NEXT: entry:
532 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
533 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
534 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
535 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
536 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
537 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
538 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
539 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
540 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
541 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
542 // CHECK1-NEXT: [[DOTA__VOID_ADDR:%.*]] = call ptr @__kmpc_alloc(i32 [[TMP2]], i64 4, ptr inttoptr (i64 2 to ptr))
543 // CHECK1-NEXT: store ptr [[DOTA__VOID_ADDR]], ptr [[TMP]], align 8
544 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 8
545 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
546 // CHECK1-NEXT: [[INC:%.*]] = add nsw i32 [[TMP4]], 1
547 // CHECK1-NEXT: store i32 [[INC]], ptr [[TMP3]], align 4
548 // CHECK1-NEXT: call void @__kmpc_free(i32 [[TMP2]], ptr [[DOTA__VOID_ADDR]], ptr inttoptr (i64 2 to ptr))
549 // CHECK1-NEXT: ret void
552 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ei
553 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
554 // CHECK1-NEXT: entry:
555 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
556 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
557 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
558 // CHECK1-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
559 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
560 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
561 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
562 // CHECK1-NEXT: store i32 [[TMP0]], ptr [[F]], align 4
563 // CHECK1-NEXT: ret void
566 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiED2Ev
567 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
568 // CHECK1-NEXT: entry:
569 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
570 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
571 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
572 // CHECK1-NEXT: ret void
575 // CHECK3-LABEL: define {{[^@]+}}@main
576 // CHECK3-SAME: () #[[ATTR0:[0-9]+]] {
577 // CHECK3-NEXT: entry:
578 // CHECK3-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
579 // CHECK3-NEXT: [[SS:%.*]] = alloca [[STRUCT_SS:%.*]], align 8
580 // CHECK3-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON:%.*]], align 1
581 // CHECK3-NEXT: store i32 0, ptr [[RETVAL]], align 4
582 // CHECK3-NEXT: call void @_ZN2SSC1ERi(ptr noundef nonnull align 8 dereferenceable(16) [[SS]], ptr noundef nonnull align 4 dereferenceable(4) @_ZZ4mainE5sivar)
583 // CHECK3-NEXT: call void @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1) [[REF_TMP]])
584 // CHECK3-NEXT: ret i32 0
587 // CHECK3-LABEL: define {{[^@]+}}@_ZN2SSC1ERi
588 // CHECK3-SAME: (ptr noundef nonnull align 8 dereferenceable(16) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[D:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat align 2 {
589 // CHECK3-NEXT: entry:
590 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
591 // CHECK3-NEXT: [[D_ADDR:%.*]] = alloca ptr, align 8
592 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
593 // CHECK3-NEXT: store ptr [[D]], ptr [[D_ADDR]], align 8
594 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
595 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[D_ADDR]], align 8
596 // CHECK3-NEXT: call void @_ZN2SSC2ERi(ptr noundef nonnull align 8 dereferenceable(16) [[THIS1]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP0]])
597 // CHECK3-NEXT: ret void
600 // CHECK3-LABEL: define {{[^@]+}}@_ZN2SSC2ERi
601 // CHECK3-SAME: (ptr noundef nonnull align 8 dereferenceable(16) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[D:%.*]]) unnamed_addr #[[ATTR1]] comdat align 2 {
602 // CHECK3-NEXT: entry:
603 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
604 // CHECK3-NEXT: [[D_ADDR:%.*]] = alloca ptr, align 8
605 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
606 // CHECK3-NEXT: store ptr [[D]], ptr [[D_ADDR]], align 8
607 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
608 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 0
609 // CHECK3-NEXT: store i32 0, ptr [[A]], align 8
610 // CHECK3-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 1
611 // CHECK3-NEXT: [[BF_LOAD:%.*]] = load i8, ptr [[B]], align 4
612 // CHECK3-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF_LOAD]], -16
613 // CHECK3-NEXT: [[BF_SET:%.*]] = or i8 [[BF_CLEAR]], 0
614 // CHECK3-NEXT: store i8 [[BF_SET]], ptr [[B]], align 4
615 // CHECK3-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 2
616 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[D_ADDR]], align 8
617 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[C]], align 8
618 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1:[0-9]+]], i32 1, ptr @_ZN2SSC2ERi.omp_outlined, ptr [[THIS1]])
619 // CHECK3-NEXT: ret void
622 // CHECK3-LABEL: define {{[^@]+}}@_ZN2SSC2ERi.omp_outlined
623 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR3:[0-9]+]] {
624 // CHECK3-NEXT: entry:
625 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
626 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
627 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
628 // CHECK3-NEXT: [[A:%.*]] = alloca i32, align 4
629 // CHECK3-NEXT: [[TMP:%.*]] = alloca ptr, align 8
630 // CHECK3-NEXT: [[B:%.*]] = alloca i32, align 4
631 // CHECK3-NEXT: [[C:%.*]] = alloca i32, align 4
632 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
633 // CHECK3-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON_0:%.*]], align 8
634 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
635 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
636 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
637 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
638 // CHECK3-NEXT: store ptr [[A]], ptr [[TMP]], align 8
639 // CHECK3-NEXT: store ptr [[C]], ptr [[_TMP1]], align 8
640 // CHECK3-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 0
641 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[TMP1]], align 8
642 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 1
643 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 8
644 // CHECK3-NEXT: store ptr [[TMP3]], ptr [[TMP2]], align 8
645 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 2
646 // CHECK3-NEXT: store ptr [[B]], ptr [[TMP4]], align 8
647 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[REF_TMP]], i32 0, i32 3
648 // CHECK3-NEXT: [[TMP6:%.*]] = load ptr, ptr [[_TMP1]], align 8
649 // CHECK3-NEXT: store ptr [[TMP6]], ptr [[TMP5]], align 8
650 // CHECK3-NEXT: call void @_ZZN2SSC1ERiENKUlvE_clEv(ptr noundef nonnull align 8 dereferenceable(32) [[REF_TMP]])
651 // CHECK3-NEXT: ret void
654 // CHECK3-LABEL: define {{[^@]+}}@_ZZN2SSC1ERiENKUlvE_clEv
655 // CHECK3-SAME: (ptr noundef nonnull align 8 dereferenceable(32) [[THIS:%.*]]) #[[ATTR2:[0-9]+]] align 2 {
656 // CHECK3-NEXT: entry:
657 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
658 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
659 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
660 // CHECK3-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[CLASS_ANON_0:%.*]], ptr [[THIS1]], i32 0, i32 0
661 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP0]], align 8
662 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[THIS1]], i32 0, i32 1
663 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP2]], align 8
664 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
665 // CHECK3-NEXT: [[INC:%.*]] = add nsw i32 [[TMP4]], 1
666 // CHECK3-NEXT: store i32 [[INC]], ptr [[TMP3]], align 4
667 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[THIS1]], i32 0, i32 2
668 // CHECK3-NEXT: [[TMP6:%.*]] = load ptr, ptr [[TMP5]], align 8
669 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP6]], align 4
670 // CHECK3-NEXT: [[DEC:%.*]] = add nsw i32 [[TMP7]], -1
671 // CHECK3-NEXT: store i32 [[DEC]], ptr [[TMP6]], align 4
672 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[CLASS_ANON_0]], ptr [[THIS1]], i32 0, i32 3
673 // CHECK3-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 8
674 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP9]], align 4
675 // CHECK3-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP10]], 1
676 // CHECK3-NEXT: store i32 [[DIV]], ptr [[TMP9]], align 4
677 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @_ZZN2SSC1ERiENKUlvE_clEv.omp_outlined, ptr [[TMP1]])
678 // CHECK3-NEXT: ret void
681 // CHECK3-LABEL: define {{[^@]+}}@_ZZN2SSC1ERiENKUlvE_clEv.omp_outlined
682 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR3]] {
683 // CHECK3-NEXT: entry:
684 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
685 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
686 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
687 // CHECK3-NEXT: [[A:%.*]] = alloca i32, align 4
688 // CHECK3-NEXT: [[TMP:%.*]] = alloca ptr, align 8
689 // CHECK3-NEXT: [[B:%.*]] = alloca i32, align 4
690 // CHECK3-NEXT: [[C:%.*]] = alloca i32, align 4
691 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
692 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
693 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
694 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
695 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
696 // CHECK3-NEXT: store ptr [[A]], ptr [[TMP]], align 8
697 // CHECK3-NEXT: store ptr [[C]], ptr [[_TMP1]], align 8
698 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP]], align 8
699 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
700 // CHECK3-NEXT: [[INC:%.*]] = add nsw i32 [[TMP2]], 1
701 // CHECK3-NEXT: store i32 [[INC]], ptr [[TMP1]], align 4
702 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[B]], align 4
703 // CHECK3-NEXT: [[DEC:%.*]] = add nsw i32 [[TMP3]], -1
704 // CHECK3-NEXT: store i32 [[DEC]], ptr [[B]], align 4
705 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[_TMP1]], align 8
706 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP4]], align 4
707 // CHECK3-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP5]], 1
708 // CHECK3-NEXT: store i32 [[DIV]], ptr [[TMP4]], align 4
709 // CHECK3-NEXT: ret void
712 // CHECK4-LABEL: define {{[^@]+}}@main
713 // CHECK4-SAME: () #[[ATTR1:[0-9]+]] {
714 // CHECK4-NEXT: entry:
715 // CHECK4-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
716 // CHECK4-NEXT: [[SS:%.*]] = alloca [[STRUCT_SS:%.*]], align 8
717 // CHECK4-NEXT: store i32 0, ptr [[RETVAL]], align 4
718 // CHECK4-NEXT: call void @_ZN2SSC1ERi(ptr noundef nonnull align 8 dereferenceable(16) [[SS]], ptr noundef nonnull align 4 dereferenceable(4) @_ZZ4mainE5sivar)
719 // CHECK4-NEXT: [[TMP0:%.*]] = load ptr, ptr getelementptr inbounds ([[STRUCT___BLOCK_LITERAL_GENERIC:%.*]], ptr @__block_literal_global, i32 0, i32 3), align 8
720 // CHECK4-NEXT: call void [[TMP0]](ptr noundef @__block_literal_global)
721 // CHECK4-NEXT: ret i32 0
724 // CHECK4-LABEL: define {{[^@]+}}@_ZN2SSC1ERi
725 // CHECK4-SAME: (ptr noundef nonnull align 8 dereferenceable(16) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[D:%.*]]) unnamed_addr #[[ATTR2:[0-9]+]] comdat align 2 {
726 // CHECK4-NEXT: entry:
727 // CHECK4-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
728 // CHECK4-NEXT: [[D_ADDR:%.*]] = alloca ptr, align 8
729 // CHECK4-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
730 // CHECK4-NEXT: store ptr [[D]], ptr [[D_ADDR]], align 8
731 // CHECK4-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
732 // CHECK4-NEXT: [[TMP0:%.*]] = load ptr, ptr [[D_ADDR]], align 8
733 // CHECK4-NEXT: call void @_ZN2SSC2ERi(ptr noundef nonnull align 8 dereferenceable(16) [[THIS1]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP0]])
734 // CHECK4-NEXT: ret void
737 // CHECK4-LABEL: define {{[^@]+}}@__main_block_invoke
738 // CHECK4-SAME: (ptr noundef [[DOTBLOCK_DESCRIPTOR:%.*]]) #[[ATTR2]] {
739 // CHECK4-NEXT: entry:
740 // CHECK4-NEXT: [[DOTBLOCK_DESCRIPTOR_ADDR:%.*]] = alloca ptr, align 8
741 // CHECK4-NEXT: [[BLOCK_ADDR:%.*]] = alloca ptr, align 8
742 // CHECK4-NEXT: store ptr [[DOTBLOCK_DESCRIPTOR]], ptr [[DOTBLOCK_DESCRIPTOR_ADDR]], align 8
743 // CHECK4-NEXT: store ptr [[DOTBLOCK_DESCRIPTOR]], ptr [[BLOCK_ADDR]], align 8
744 // CHECK4-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1:[0-9]+]], i32 0, ptr @__main_block_invoke.omp_outlined)
745 // CHECK4-NEXT: ret void
748 // CHECK4-LABEL: define {{[^@]+}}@__main_block_invoke.omp_outlined
749 // CHECK4-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR3:[0-9]+]] {
750 // CHECK4-NEXT: entry:
751 // CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
752 // CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
753 // CHECK4-NEXT: [[G:%.*]] = alloca i32, align 128
754 // CHECK4-NEXT: [[SIVAR:%.*]] = alloca i32, align 4
755 // CHECK4-NEXT: [[BLOCK:%.*]] = alloca <{ ptr, i32, i32, ptr, ptr, i32, [92 x i8], i32 }>, align 128
756 // CHECK4-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
757 // CHECK4-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
758 // CHECK4-NEXT: store i32 1, ptr [[G]], align 128
759 // CHECK4-NEXT: store i32 20, ptr [[SIVAR]], align 4
760 // CHECK4-NEXT: [[BLOCK_ISA:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, i32, [92 x i8], i32 }>, ptr [[BLOCK]], i32 0, i32 0
761 // CHECK4-NEXT: store ptr @_NSConcreteStackBlock, ptr [[BLOCK_ISA]], align 128
762 // CHECK4-NEXT: [[BLOCK_FLAGS:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, i32, [92 x i8], i32 }>, ptr [[BLOCK]], i32 0, i32 1
763 // CHECK4-NEXT: store i32 1073741824, ptr [[BLOCK_FLAGS]], align 8
764 // CHECK4-NEXT: [[BLOCK_RESERVED:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, i32, [92 x i8], i32 }>, ptr [[BLOCK]], i32 0, i32 2
765 // CHECK4-NEXT: store i32 0, ptr [[BLOCK_RESERVED]], align 4
766 // CHECK4-NEXT: [[BLOCK_INVOKE:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, i32, [92 x i8], i32 }>, ptr [[BLOCK]], i32 0, i32 3
767 // CHECK4-NEXT: store ptr @g_block_invoke, ptr [[BLOCK_INVOKE]], align 16
768 // CHECK4-NEXT: [[BLOCK_DESCRIPTOR:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, i32, [92 x i8], i32 }>, ptr [[BLOCK]], i32 0, i32 4
769 // CHECK4-NEXT: store ptr @__block_descriptor_tmp.1, ptr [[BLOCK_DESCRIPTOR]], align 8
770 // CHECK4-NEXT: [[BLOCK_CAPTURED:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, i32, [92 x i8], i32 }>, ptr [[BLOCK]], i32 0, i32 7
771 // CHECK4-NEXT: [[TMP0:%.*]] = load volatile i32, ptr [[G]], align 128
772 // CHECK4-NEXT: store volatile i32 [[TMP0]], ptr [[BLOCK_CAPTURED]], align 128
773 // CHECK4-NEXT: [[BLOCK_CAPTURED1:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, i32, [92 x i8], i32 }>, ptr [[BLOCK]], i32 0, i32 5
774 // CHECK4-NEXT: [[TMP1:%.*]] = load i32, ptr [[SIVAR]], align 4
775 // CHECK4-NEXT: store i32 [[TMP1]], ptr [[BLOCK_CAPTURED1]], align 32
776 // CHECK4-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___BLOCK_LITERAL_GENERIC:%.*]], ptr [[BLOCK]], i32 0, i32 3
777 // CHECK4-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP2]], align 8
778 // CHECK4-NEXT: call void [[TMP3]](ptr noundef [[BLOCK]])
779 // CHECK4-NEXT: ret void
782 // CHECK4-LABEL: define {{[^@]+}}@g_block_invoke
783 // CHECK4-SAME: (ptr noundef [[DOTBLOCK_DESCRIPTOR:%.*]]) #[[ATTR2]] {
784 // CHECK4-NEXT: entry:
785 // CHECK4-NEXT: [[DOTBLOCK_DESCRIPTOR_ADDR:%.*]] = alloca ptr, align 8
786 // CHECK4-NEXT: [[BLOCK_ADDR:%.*]] = alloca ptr, align 8
787 // CHECK4-NEXT: store ptr [[DOTBLOCK_DESCRIPTOR]], ptr [[DOTBLOCK_DESCRIPTOR_ADDR]], align 8
788 // CHECK4-NEXT: store ptr [[DOTBLOCK_DESCRIPTOR]], ptr [[BLOCK_ADDR]], align 8
789 // CHECK4-NEXT: [[BLOCK_CAPTURE_ADDR:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, i32, [92 x i8], i32 }>, ptr [[DOTBLOCK_DESCRIPTOR]], i32 0, i32 7
790 // CHECK4-NEXT: store i32 2, ptr [[BLOCK_CAPTURE_ADDR]], align 128
791 // CHECK4-NEXT: [[BLOCK_CAPTURE_ADDR1:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, i32, [92 x i8], i32 }>, ptr [[DOTBLOCK_DESCRIPTOR]], i32 0, i32 5
792 // CHECK4-NEXT: store i32 40, ptr [[BLOCK_CAPTURE_ADDR1]], align 32
793 // CHECK4-NEXT: ret void
796 // CHECK4-LABEL: define {{[^@]+}}@_ZN2SSC2ERi
797 // CHECK4-SAME: (ptr noundef nonnull align 8 dereferenceable(16) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[D:%.*]]) unnamed_addr #[[ATTR2]] comdat align 2 {
798 // CHECK4-NEXT: entry:
799 // CHECK4-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
800 // CHECK4-NEXT: [[D_ADDR:%.*]] = alloca ptr, align 8
801 // CHECK4-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
802 // CHECK4-NEXT: store ptr [[D]], ptr [[D_ADDR]], align 8
803 // CHECK4-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
804 // CHECK4-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 0
805 // CHECK4-NEXT: store i32 0, ptr [[A]], align 8
806 // CHECK4-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 1
807 // CHECK4-NEXT: [[BF_LOAD:%.*]] = load i8, ptr [[B]], align 4
808 // CHECK4-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF_LOAD]], -16
809 // CHECK4-NEXT: [[BF_SET:%.*]] = or i8 [[BF_CLEAR]], 0
810 // CHECK4-NEXT: store i8 [[BF_SET]], ptr [[B]], align 4
811 // CHECK4-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 2
812 // CHECK4-NEXT: [[TMP0:%.*]] = load ptr, ptr [[D_ADDR]], align 8
813 // CHECK4-NEXT: store ptr [[TMP0]], ptr [[C]], align 8
814 // CHECK4-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @_ZN2SSC2ERi.omp_outlined, ptr [[THIS1]])
815 // CHECK4-NEXT: ret void
818 // CHECK4-LABEL: define {{[^@]+}}@_ZN2SSC2ERi.omp_outlined
819 // CHECK4-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR3]] {
820 // CHECK4-NEXT: entry:
821 // CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
822 // CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
823 // CHECK4-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
824 // CHECK4-NEXT: [[A:%.*]] = alloca i32, align 4
825 // CHECK4-NEXT: [[TMP:%.*]] = alloca ptr, align 8
826 // CHECK4-NEXT: [[B:%.*]] = alloca i32, align 4
827 // CHECK4-NEXT: [[C:%.*]] = alloca i32, align 4
828 // CHECK4-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
829 // CHECK4-NEXT: [[BLOCK:%.*]] = alloca <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, align 8
830 // CHECK4-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
831 // CHECK4-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
832 // CHECK4-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
833 // CHECK4-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
834 // CHECK4-NEXT: store ptr [[A]], ptr [[TMP]], align 8
835 // CHECK4-NEXT: store ptr [[C]], ptr [[_TMP1]], align 8
836 // CHECK4-NEXT: [[BLOCK_ISA:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, ptr [[BLOCK]], i32 0, i32 0
837 // CHECK4-NEXT: store ptr @_NSConcreteStackBlock, ptr [[BLOCK_ISA]], align 8
838 // CHECK4-NEXT: [[BLOCK_FLAGS:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, ptr [[BLOCK]], i32 0, i32 1
839 // CHECK4-NEXT: store i32 1073741824, ptr [[BLOCK_FLAGS]], align 8
840 // CHECK4-NEXT: [[BLOCK_RESERVED:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, ptr [[BLOCK]], i32 0, i32 2
841 // CHECK4-NEXT: store i32 0, ptr [[BLOCK_RESERVED]], align 4
842 // CHECK4-NEXT: [[BLOCK_INVOKE:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, ptr [[BLOCK]], i32 0, i32 3
843 // CHECK4-NEXT: store ptr @g_block_invoke_2, ptr [[BLOCK_INVOKE]], align 8
844 // CHECK4-NEXT: [[BLOCK_DESCRIPTOR:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, ptr [[BLOCK]], i32 0, i32 4
845 // CHECK4-NEXT: store ptr @__block_descriptor_tmp.2, ptr [[BLOCK_DESCRIPTOR]], align 8
846 // CHECK4-NEXT: [[BLOCK_CAPTURED_THIS_ADDR:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, ptr [[BLOCK]], i32 0, i32 5
847 // CHECK4-NEXT: store ptr [[TMP0]], ptr [[BLOCK_CAPTURED_THIS_ADDR]], align 8
848 // CHECK4-NEXT: [[BLOCK_CAPTURED:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, ptr [[BLOCK]], i32 0, i32 6
849 // CHECK4-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP]], align 8
850 // CHECK4-NEXT: store ptr [[TMP1]], ptr [[BLOCK_CAPTURED]], align 8
851 // CHECK4-NEXT: [[BLOCK_CAPTURED2:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, ptr [[BLOCK]], i32 0, i32 8
852 // CHECK4-NEXT: [[TMP2:%.*]] = load i32, ptr [[B]], align 4
853 // CHECK4-NEXT: store i32 [[TMP2]], ptr [[BLOCK_CAPTURED2]], align 8
854 // CHECK4-NEXT: [[BLOCK_CAPTURED3:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, ptr [[BLOCK]], i32 0, i32 7
855 // CHECK4-NEXT: [[TMP3:%.*]] = load ptr, ptr [[_TMP1]], align 8
856 // CHECK4-NEXT: store ptr [[TMP3]], ptr [[BLOCK_CAPTURED3]], align 8
857 // CHECK4-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___BLOCK_LITERAL_GENERIC:%.*]], ptr [[BLOCK]], i32 0, i32 3
858 // CHECK4-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
859 // CHECK4-NEXT: call void [[TMP5]](ptr noundef [[BLOCK]])
860 // CHECK4-NEXT: ret void
863 // CHECK4-LABEL: define {{[^@]+}}@g_block_invoke_2
864 // CHECK4-SAME: (ptr noundef [[DOTBLOCK_DESCRIPTOR:%.*]]) #[[ATTR2]] {
865 // CHECK4-NEXT: entry:
866 // CHECK4-NEXT: [[DOTBLOCK_DESCRIPTOR_ADDR:%.*]] = alloca ptr, align 8
867 // CHECK4-NEXT: [[BLOCK_ADDR:%.*]] = alloca ptr, align 8
868 // CHECK4-NEXT: store ptr [[DOTBLOCK_DESCRIPTOR]], ptr [[DOTBLOCK_DESCRIPTOR_ADDR]], align 8
869 // CHECK4-NEXT: store ptr [[DOTBLOCK_DESCRIPTOR]], ptr [[BLOCK_ADDR]], align 8
870 // CHECK4-NEXT: [[BLOCK_CAPTURED_THIS:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, ptr [[DOTBLOCK_DESCRIPTOR]], i32 0, i32 5
871 // CHECK4-NEXT: [[THIS:%.*]] = load ptr, ptr [[BLOCK_CAPTURED_THIS]], align 8
872 // CHECK4-NEXT: [[BLOCK_CAPTURE_ADDR:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, ptr [[DOTBLOCK_DESCRIPTOR]], i32 0, i32 6
873 // CHECK4-NEXT: [[TMP0:%.*]] = load ptr, ptr [[BLOCK_CAPTURE_ADDR]], align 8
874 // CHECK4-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
875 // CHECK4-NEXT: [[INC:%.*]] = add nsw i32 [[TMP1]], 1
876 // CHECK4-NEXT: store i32 [[INC]], ptr [[TMP0]], align 4
877 // CHECK4-NEXT: [[BLOCK_CAPTURE_ADDR1:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, ptr [[DOTBLOCK_DESCRIPTOR]], i32 0, i32 8
878 // CHECK4-NEXT: [[TMP2:%.*]] = load i32, ptr [[BLOCK_CAPTURE_ADDR1]], align 8
879 // CHECK4-NEXT: [[DEC:%.*]] = add nsw i32 [[TMP2]], -1
880 // CHECK4-NEXT: store i32 [[DEC]], ptr [[BLOCK_CAPTURE_ADDR1]], align 8
881 // CHECK4-NEXT: [[BLOCK_CAPTURE_ADDR2:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>, ptr [[DOTBLOCK_DESCRIPTOR]], i32 0, i32 7
882 // CHECK4-NEXT: [[TMP3:%.*]] = load ptr, ptr [[BLOCK_CAPTURE_ADDR2]], align 8
883 // CHECK4-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
884 // CHECK4-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP4]], 1
885 // CHECK4-NEXT: store i32 [[DIV]], ptr [[TMP3]], align 4
886 // CHECK4-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @g_block_invoke_2.omp_outlined, ptr [[THIS]])
887 // CHECK4-NEXT: ret void
890 // CHECK4-LABEL: define {{[^@]+}}@g_block_invoke_2.omp_outlined
891 // CHECK4-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR3]] {
892 // CHECK4-NEXT: entry:
893 // CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
894 // CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
895 // CHECK4-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
896 // CHECK4-NEXT: [[A:%.*]] = alloca i32, align 4
897 // CHECK4-NEXT: [[TMP:%.*]] = alloca ptr, align 8
898 // CHECK4-NEXT: [[B:%.*]] = alloca i32, align 4
899 // CHECK4-NEXT: [[C:%.*]] = alloca i32, align 4
900 // CHECK4-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
901 // CHECK4-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
902 // CHECK4-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
903 // CHECK4-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
904 // CHECK4-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
905 // CHECK4-NEXT: store ptr [[A]], ptr [[TMP]], align 8
906 // CHECK4-NEXT: store ptr [[C]], ptr [[_TMP1]], align 8
907 // CHECK4-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP]], align 8
908 // CHECK4-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
909 // CHECK4-NEXT: [[INC:%.*]] = add nsw i32 [[TMP2]], 1
910 // CHECK4-NEXT: store i32 [[INC]], ptr [[TMP1]], align 4
911 // CHECK4-NEXT: [[TMP3:%.*]] = load i32, ptr [[B]], align 4
912 // CHECK4-NEXT: [[DEC:%.*]] = add nsw i32 [[TMP3]], -1
913 // CHECK4-NEXT: store i32 [[DEC]], ptr [[B]], align 4
914 // CHECK4-NEXT: [[TMP4:%.*]] = load ptr, ptr [[_TMP1]], align 8
915 // CHECK4-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP4]], align 4
916 // CHECK4-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP5]], 1
917 // CHECK4-NEXT: store i32 [[DIV]], ptr [[TMP4]], align 4
918 // CHECK4-NEXT: ret void