Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / for_reduction_codegen.cpp
blob893c606f8d7b9fb00fb5ced35e4864dc4b12697d
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --check-globals --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _ --global-value-regex ".gomp_critical_user[a-zA-Z_.]+"
2 // RUN: %clang_cc1 -verify -Wno-vla -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK1
3 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
4 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK1
5 // RUN: %clang_cc1 -verify -Wno-vla -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK3
6 // RUN: %clang_cc1 -verify -Wno-vla -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK4
8 // RUN: %clang_cc1 -verify -Wno-vla -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -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-apple-darwin10 -emit-pch -o %t %s
10 // RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
11 // RUN: %clang_cc1 -verify -Wno-vla -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
12 // RUN: %clang_cc1 -verify -Wno-vla -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
13 // expected-no-diagnostics
14 #ifndef HEADER
15 #define HEADER
17 volatile double g, g_orig;
18 volatile double &g1 = g_orig;
20 template <class T>
21 struct S {
22 T f;
23 S(T a) : f(a + g) {}
24 S() : f(g) {}
25 operator T() { return T(); }
26 S &operator&(const S &) { return *this; }
27 ~S() {}
31 template <typename T, int length>
32 T tmain() {
33 T t;
34 S<T> test;
35 T t_var = T(), t_var1;
36 T vec[] = {1, 2};
37 S<T> s_arr[] = {1, 2};
38 S<T> &var = test;
39 S<T> var1;
40 S<T> arr[length];
41 #pragma omp parallel
42 #pragma omp for reduction(+:t_var) reduction(&:var) reduction(&& : var1) reduction(min: t_var1) nowait
43 for (int i = 0; i < 2; ++i) {
44 vec[i] = t_var;
45 s_arr[i] = var;
47 #pragma omp parallel
48 #pragma omp for reduction(&& : t_var)
49 for (int i = 0; i < 2; ++i) {
50 vec[i] = t_var;
51 s_arr[i] = var;
53 #pragma omp parallel
54 #pragma omp for reduction(+ : arr[1:length-2])
55 for (int i = 0; i < 2; ++i) {
56 vec[i] = t_var;
57 s_arr[i] = var;
59 return T();
62 extern S<float> **foo();
64 int main() {
65 #ifdef LAMBDA
66 [&]() {
67 #pragma omp parallel
68 #pragma omp for reduction(+:g, g1)
69 for (int i = 0; i < 2; ++i) {
71 // Reduction list for runtime.
73 g = 1;
74 g1 = 1;
76 [&]() {
77 g = 2;
78 g1 = 2;
79 }();
81 }();
82 return 0;
83 #elif defined(BLOCKS)
85 #pragma omp parallel
86 #pragma omp for reduction(-:g, g1)
87 for (int i = 0; i < 2; ++i) {
89 // Reduction list for runtime.
91 g = 1;
92 g1 = 1;
95 g = 2;
96 g1 = 2;
97 }();
99 }();
100 return 0;
101 #else
102 S<float> test;
103 float t_var = 0, t_var1;
104 int vec[] = {1, 2};
105 S<float> s_arr[] = {1, 2, 3, 4};
106 S<float> &var = test;
107 S<float> var1, arrs[10][4];
108 S<float> **var2 = foo();
109 S<float> vvar2[5];
110 S<float> (&var3)[4] = s_arr;
111 #pragma omp parallel
112 #pragma omp for reduction(+:t_var) reduction(&:var) reduction(&& : var1) reduction(min: t_var1)
113 for (int i = 0; i < 2; ++i) {
114 vec[i] = t_var;
115 s_arr[i] = var;
117 int arr[10][vec[1]];
118 #pragma omp parallel for reduction(+:arr[1][:vec[1]]) reduction(&:arrs[1:vec[1]][1:2])
119 for (int i = 0; i < 10; ++i)
120 ++arr[1][i];
121 #pragma omp parallel
122 #pragma omp for reduction(+:arr) reduction(&:arrs)
123 for (int i = 0; i < 10; ++i)
124 ++arr[1][i];
125 // arr is a VLA, but the array section has constant length so we can generate a constant sized array!
126 #pragma omp parallel
127 #pragma omp for reduction(+:arr[1][0:2])
128 for (int i = 0; i < 10; ++i)
129 ++arr[1][i];
130 #pragma omp parallel
131 #pragma omp for reduction(& : var2[0 : 5][1 : 6])
132 for (int i = 0; i < 10; ++i)
134 #pragma omp parallel
135 #pragma omp for reduction(& : var2[1][1 : 6])
136 for (int i = 0; i < 10; ++i)
138 #pragma omp parallel
139 #pragma omp for reduction(& : var2[1 : 1][1 : 6])
140 for (int i = 0; i < 10; ++i)
142 #pragma omp parallel
143 #pragma omp for reduction(& : var2[1 : 1][1])
144 for (int i = 0; i < 10; ++i)
146 #pragma omp parallel
147 #pragma omp for reduction(& : vvar2[0 : 5])
148 for (int i = 0; i < 10; ++i)
150 #pragma omp parallel
151 #pragma omp for reduction(& : var3[1 : 2])
152 for (int i = 0; i < 10; ++i)
154 #pragma omp parallel
155 #pragma omp for reduction(& : var3[ : 2])
156 for (int i = 0; i < 10; ++i)
158 // TODO: The compiler should also be able to generate a constant sized array in this case!
159 #pragma omp parallel
160 #pragma omp for reduction(& : var3[2 : ])
161 for (int i = 0; i < 10; ++i)
163 #pragma omp parallel
164 #pragma omp for reduction(& : var3)
165 for (int i = 0; i < 10; ++i)
167 return tmain<int, 42>();
168 #endif
172 // Reduction list for runtime.
176 // For + reduction operation initial value of private variable is 0.
179 // For & reduction operation initial value of private variable is ones in all bits.
181 // For && reduction operation initial value of private variable is 1.0.
183 // For min reduction operation initial value of private variable is largest repesentable value.
186 // Skip checks for internal operations.
188 // ptr RedList[<n>] = {<ReductionVars>[0], ..., <ReductionVars>[<n>-1]};
191 // res = __kmpc_reduce(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>);
194 // switch(res)
196 // case 1:
197 // t_var += t_var_reduction;
199 // var = var.operator &(var_reduction);
201 // var1 = var1.operator &&(var1_reduction);
203 // t_var1 = min(t_var1, t_var1_reduction);
205 // __kmpc_end_reduce(<loc>, <gtid>, &<lock>);
207 // break;
209 // case 2:
210 // t_var += t_var_reduction;
212 // var = var.operator &(var_reduction);
214 // var1 = var1.operator &&(var1_reduction);
216 // t_var1 = min(t_var1, t_var1_reduction);
218 // __kmpc_end_reduce(<loc>, <gtid>, &<lock>);
220 // break;
223 // void reduce_func(ptr lhs[<n>], ptr rhs[<n>]) {
224 // *(Type0*)lhs[0] = ReductionOperation0(*(Type0*)lhs[0], *(Type0*)rhs[0]);
225 // ...
226 // *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
227 // *(Type<n>-1*)rhs[<n>-1]);
228 // }
229 // t_var_lhs = (ptr)lhs[0];
230 // t_var_rhs = (ptr)rhs[0];
232 // var_lhs = (Sptr)lhs[1];
233 // var_rhs = (Sptr)rhs[1];
235 // var1_lhs = (Sptr)lhs[2];
236 // var1_rhs = (Sptr)rhs[2];
238 // t_var1_lhs = (ptr)lhs[3];
239 // t_var1_rhs = (ptr)rhs[3];
241 // t_var_lhs += t_var_rhs;
243 // var_lhs = var_lhs.operator &(var_rhs);
245 // var1_lhs = var1_lhs.operator &&(var1_rhs);
247 // t_var1_lhs = min(t_var1_lhs, t_var1_rhs);
250 // Reduction list for runtime.
254 // Check initialization of private copy.
257 // Check initialization of private copy.
259 // Skip checks for internal operations.
261 // ptr RedList[<n>] = {<ReductionVars>[0], ..., <ReductionVars>[<n>-1]};
264 // res = __kmpc_reduce(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>);
267 // switch(res)
269 // case 1:
271 // arr[:] += arr_reduction[:];
273 // arrs[:] = var.operator &(arrs_reduction[:]);
275 // __kmpc_end_reduce(<loc>, <gtid>, &<lock>);
277 // break;
279 // case 2:
281 // arr[:] += arr_reduction[:];
283 // arrs[:] = var.operator &(arrs_reduction[:]);
285 // break;
287 // Check destruction of private copy.
290 // void reduce_func(ptr lhs[<n>], ptr rhs[<n>]) {
291 // *(Type0*)lhs[0] = ReductionOperation0(*(Type0*)lhs[0], *(Type0*)rhs[0]);
292 // ...
293 // *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
294 // *(Type<n>-1*)rhs[<n>-1]);
295 // }
296 // arr_rhs = (int*)rhs[0];
297 // arr_lhs = (int*)lhs[0];
299 // arr_size = (size_t)lhs[1];
301 // arrs_rhs = (Sptr)rhs[2];
302 // arrs_lhs = (Sptr)lhs[2];
304 // arrs_size = (size_t)lhs[3];
306 // arr_lhs[:] += arr_rhs[:];
308 // arrs_lhs = arrs_lhs.operator &(arrs_rhs);
313 // Reduction list for runtime.
317 // Check initialization of private copy.
319 // Check initialization of private copy.
321 // Skip checks for internal operations.
323 // ptr RedList[<n>] = {<ReductionVars>[0], ..., <ReductionVars>[<n>-1]};
326 // res = __kmpc_reduce(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>);
329 // switch(res)
331 // case 1:
333 // arr[:] += arr_reduction[:];
335 // arrs[:] = var.operator &(arrs_reduction[:]);
337 // __kmpc_end_reduce(<loc>, <gtid>, &<lock>);
339 // break;
341 // case 2:
343 // arr[:] += arr_reduction[:];
345 // arrs[:] = var.operator &(arrs_reduction[:]);
347 // break;
349 // Check destruction of private copy.
352 // void reduce_func(ptr lhs[<n>], ptr rhs[<n>]) {
353 // *(Type0*)lhs[0] = ReductionOperation0(*(Type0*)lhs[0], *(Type0*)rhs[0]);
354 // ...
355 // *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
356 // *(Type<n>-1*)rhs[<n>-1]);
357 // }
358 // arr_rhs = (int*)rhs[0];
359 // arr_lhs = (int*)lhs[0];
361 // arr_size = (size_t)lhs[1];
363 // arrs_rhs = (Sptr)rhs[2];
364 // arrs_lhs = (Sptr)lhs[2];
366 // arr_lhs[:] += arr_rhs[:];
368 // arrs_lhs = arrs_lhs.operator &(arrs_rhs);
373 // Reduction list for runtime.
381 // Reduction list for runtime.
387 // Reduction list for runtime.
394 // Reduction list for runtime.
401 // Reduction list for runtime.
408 // Reduction list for runtime.
414 // Reduction list for runtime.
424 // Reduction list for runtime.
434 // Reduction list for runtime.
442 // Reduction list for runtime.
448 // Not interested in this one:
450 // Reduction list for runtime.
454 // For + reduction operation initial value of private variable is 0.
456 // For & reduction operation initial value of private variable is ones in all bits.
458 // For && reduction operation initial value of private variable is 1.0.
460 // For min reduction operation initial value of private variable is largest repesentable value.
462 // Skip checks for internal operations.
464 // ptr RedList[<n>] = {<ReductionVars>[0], ..., <ReductionVars>[<n>-1]};
467 // res = __kmpc_reduce_nowait(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>);
470 // switch(res)
472 // case 1:
473 // t_var += t_var_reduction;
475 // var = var.operator &(var_reduction);
477 // var1 = var1.operator &&(var1_reduction);
479 // t_var1 = min(t_var1, t_var1_reduction);
481 // __kmpc_end_reduce_nowait(<loc>, <gtid>, &<lock>);
483 // break;
485 // case 2:
486 // t_var += t_var_reduction;
488 // var = var.operator &(var_reduction);
490 // var1 = var1.operator &&(var1_reduction);
492 // t_var1 = min(t_var1, t_var1_reduction);
494 // break;
496 // void reduce_func(ptr lhs[<n>], ptr rhs[<n>]) {
497 // *(Type0*)lhs[0] = ReductionOperation0(*(Type0*)lhs[0], *(Type0*)rhs[0]);
498 // ...
499 // *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
500 // *(Type<n>-1*)rhs[<n>-1]);
501 // }
502 // t_var_lhs = (iptr)lhs[0];
503 // t_var_rhs = (iptr)rhs[0];
505 // var_lhs = (Sptr)lhs[1];
506 // var_rhs = (Sptr)rhs[1];
508 // var1_lhs = (Sptr)lhs[2];
509 // var1_rhs = (Sptr)rhs[2];
511 // t_var1_lhs = (iptr)lhs[3];
512 // t_var1_rhs = (iptr)rhs[3];
514 // t_var_lhs += t_var_rhs;
516 // var_lhs = var_lhs.operator &(var_rhs);
518 // var1_lhs = var1_lhs.operator &&(var1_rhs);
520 // t_var1_lhs = min(t_var1_lhs, t_var1_rhs);
524 // Reduction list for runtime.
529 #endif
531 // CHECK1: @.gomp_critical_user_.reduction.var = common global [8 x i32] zeroinitializer, align 8
532 // CHECK1: @.gomp_critical_user_.atomic_reduction.var = common global [8 x i32] zeroinitializer, align 8
534 // CHECK3: @.gomp_critical_user_.reduction.var = common global [8 x i32] zeroinitializer, align 8
536 // CHECK4: @.gomp_critical_user_.reduction.var = common global [8 x i32] zeroinitializer, align 8
538 // CHECK1-LABEL: define {{[^@]+}}@main
539 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
540 // CHECK1-NEXT: entry:
541 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
542 // CHECK1-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S:%.*]], align 4
543 // CHECK1-NEXT: [[T_VAR:%.*]] = alloca float, align 4
544 // CHECK1-NEXT: [[T_VAR1:%.*]] = alloca float, align 4
545 // CHECK1-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
546 // CHECK1-NEXT: [[S_ARR:%.*]] = alloca [4 x %struct.S], align 16
547 // CHECK1-NEXT: [[VAR:%.*]] = alloca ptr, align 8
548 // CHECK1-NEXT: [[VAR1:%.*]] = alloca [[STRUCT_S]], align 4
549 // CHECK1-NEXT: [[ARRS:%.*]] = alloca [10 x [4 x %struct.S]], align 16
550 // CHECK1-NEXT: [[VAR2:%.*]] = alloca ptr, align 8
551 // CHECK1-NEXT: [[VVAR2:%.*]] = alloca [5 x %struct.S], align 16
552 // CHECK1-NEXT: [[VAR3:%.*]] = alloca ptr, align 8
553 // CHECK1-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
554 // CHECK1-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
555 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
556 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
557 // CHECK1-NEXT: store float 0.000000e+00, ptr [[T_VAR]], align 4
558 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VEC]], ptr align 4 @__const.main.vec, i64 8, i1 false)
559 // CHECK1-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [4 x %struct.S], ptr [[S_ARR]], i64 0, i64 0
560 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], float noundef 1.000000e+00)
561 // CHECK1-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYINIT_BEGIN]], i64 1
562 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], float noundef 2.000000e+00)
563 // CHECK1-NEXT: [[ARRAYINIT_ELEMENT1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYINIT_ELEMENT]], i64 1
564 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT1]], float noundef 3.000000e+00)
565 // CHECK1-NEXT: [[ARRAYINIT_ELEMENT2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYINIT_ELEMENT1]], i64 1
566 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT2]], float noundef 4.000000e+00)
567 // CHECK1-NEXT: store ptr [[TEST]], ptr [[VAR]], align 8
568 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR1]])
569 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [10 x [4 x %struct.S]], ptr [[ARRS]], i32 0, i32 0, i32 0
570 // CHECK1-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i64 40
571 // CHECK1-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
572 // CHECK1: arrayctor.loop:
573 // CHECK1-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
574 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
575 // CHECK1-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYCTOR_CUR]], i64 1
576 // CHECK1-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
577 // CHECK1-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
578 // CHECK1: arrayctor.cont:
579 // CHECK1-NEXT: [[CALL:%.*]] = call noundef ptr @_Z3foov()
580 // CHECK1-NEXT: store ptr [[CALL]], ptr [[VAR2]], align 8
581 // CHECK1-NEXT: [[ARRAY_BEGIN3:%.*]] = getelementptr inbounds [5 x %struct.S], ptr [[VVAR2]], i32 0, i32 0
582 // CHECK1-NEXT: [[ARRAYCTOR_END4:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN3]], i64 5
583 // CHECK1-NEXT: br label [[ARRAYCTOR_LOOP5:%.*]]
584 // CHECK1: arrayctor.loop5:
585 // CHECK1-NEXT: [[ARRAYCTOR_CUR6:%.*]] = phi ptr [ [[ARRAY_BEGIN3]], [[ARRAYCTOR_CONT]] ], [ [[ARRAYCTOR_NEXT7:%.*]], [[ARRAYCTOR_LOOP5]] ]
586 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR6]])
587 // CHECK1-NEXT: [[ARRAYCTOR_NEXT7]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYCTOR_CUR6]], i64 1
588 // CHECK1-NEXT: [[ARRAYCTOR_DONE8:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT7]], [[ARRAYCTOR_END4]]
589 // CHECK1-NEXT: br i1 [[ARRAYCTOR_DONE8]], label [[ARRAYCTOR_CONT9:%.*]], label [[ARRAYCTOR_LOOP5]]
590 // CHECK1: arrayctor.cont9:
591 // CHECK1-NEXT: store ptr [[S_ARR]], ptr [[VAR3]], align 8
592 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR]], align 8
593 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3:[0-9]+]], i32 6, ptr @main.omp_outlined, ptr [[T_VAR]], ptr [[TMP0]], ptr [[VAR1]], ptr [[T_VAR1]], ptr [[VEC]], ptr [[S_ARR]])
594 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[VEC]], i64 0, i64 1
595 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
596 // CHECK1-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
597 // CHECK1-NEXT: [[TMP3:%.*]] = call ptr @llvm.stacksave.p0()
598 // CHECK1-NEXT: store ptr [[TMP3]], ptr [[SAVED_STACK]], align 8
599 // CHECK1-NEXT: [[TMP4:%.*]] = mul nuw i64 10, [[TMP2]]
600 // CHECK1-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP4]], align 16
601 // CHECK1-NEXT: store i64 [[TMP2]], ptr [[__VLA_EXPR0]], align 8
602 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 5, ptr @main.omp_outlined.1, i64 10, i64 [[TMP2]], ptr [[VLA]], ptr [[VEC]], ptr [[ARRS]])
603 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 4, ptr @main.omp_outlined.2, i64 10, i64 [[TMP2]], ptr [[VLA]], ptr [[ARRS]])
604 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 3, ptr @main.omp_outlined.3, i64 10, i64 [[TMP2]], ptr [[VLA]])
605 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 1, ptr @main.omp_outlined.4, ptr [[VAR2]])
606 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 1, ptr @main.omp_outlined.5, ptr [[VAR2]])
607 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 1, ptr @main.omp_outlined.6, ptr [[VAR2]])
608 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 1, ptr @main.omp_outlined.7, ptr [[VAR2]])
609 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 1, ptr @main.omp_outlined.8, ptr [[VVAR2]])
610 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[VAR3]], align 8
611 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 1, ptr @main.omp_outlined.9, ptr [[TMP5]])
612 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[VAR3]], align 8
613 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 1, ptr @main.omp_outlined.10, ptr [[TMP6]])
614 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[VAR3]], align 8
615 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 1, ptr @main.omp_outlined.11, ptr [[TMP7]])
616 // CHECK1-NEXT: [[TMP8:%.*]] = load ptr, ptr [[VAR3]], align 8
617 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 1, ptr @main.omp_outlined.12, ptr [[TMP8]])
618 // CHECK1-NEXT: [[CALL10:%.*]] = call noundef i32 @_Z5tmainIiLi42EET_v()
619 // CHECK1-NEXT: store i32 [[CALL10]], ptr [[RETVAL]], align 4
620 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
621 // CHECK1-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP9]])
622 // CHECK1-NEXT: [[ARRAY_BEGIN11:%.*]] = getelementptr inbounds [5 x %struct.S], ptr [[VVAR2]], i32 0, i32 0
623 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN11]], i64 5
624 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
625 // CHECK1: arraydestroy.body:
626 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP10]], [[ARRAYCTOR_CONT9]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
627 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
628 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR5:[0-9]+]]
629 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN11]]
630 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE12:%.*]], label [[ARRAYDESTROY_BODY]]
631 // CHECK1: arraydestroy.done12:
632 // CHECK1-NEXT: [[ARRAY_BEGIN13:%.*]] = getelementptr inbounds [10 x [4 x %struct.S]], ptr [[ARRS]], i32 0, i32 0, i32 0
633 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN13]], i64 40
634 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY14:%.*]]
635 // CHECK1: arraydestroy.body14:
636 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST15:%.*]] = phi ptr [ [[TMP11]], [[ARRAYDESTROY_DONE12]] ], [ [[ARRAYDESTROY_ELEMENT16:%.*]], [[ARRAYDESTROY_BODY14]] ]
637 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT16]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST15]], i64 -1
638 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT16]]) #[[ATTR5]]
639 // CHECK1-NEXT: [[ARRAYDESTROY_DONE17:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT16]], [[ARRAY_BEGIN13]]
640 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE17]], label [[ARRAYDESTROY_DONE18:%.*]], label [[ARRAYDESTROY_BODY14]]
641 // CHECK1: arraydestroy.done18:
642 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR1]]) #[[ATTR5]]
643 // CHECK1-NEXT: [[ARRAY_BEGIN19:%.*]] = getelementptr inbounds [4 x %struct.S], ptr [[S_ARR]], i32 0, i32 0
644 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN19]], i64 4
645 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY20:%.*]]
646 // CHECK1: arraydestroy.body20:
647 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST21:%.*]] = phi ptr [ [[TMP12]], [[ARRAYDESTROY_DONE18]] ], [ [[ARRAYDESTROY_ELEMENT22:%.*]], [[ARRAYDESTROY_BODY20]] ]
648 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT22]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST21]], i64 -1
649 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT22]]) #[[ATTR5]]
650 // CHECK1-NEXT: [[ARRAYDESTROY_DONE23:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT22]], [[ARRAY_BEGIN19]]
651 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE23]], label [[ARRAYDESTROY_DONE24:%.*]], label [[ARRAYDESTROY_BODY20]]
652 // CHECK1: arraydestroy.done24:
653 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR5]]
654 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[RETVAL]], align 4
655 // CHECK1-NEXT: ret i32 [[TMP13]]
658 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ev
659 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] align 2 {
660 // CHECK1-NEXT: entry:
661 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
662 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
663 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
664 // CHECK1-NEXT: call void @_ZN1SIfEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
665 // CHECK1-NEXT: ret void
668 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC1Ef
669 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] align 2 {
670 // CHECK1-NEXT: entry:
671 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
672 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
673 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
674 // CHECK1-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
675 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
676 // CHECK1-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
677 // CHECK1-NEXT: call void @_ZN1SIfEC2Ef(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], float noundef [[TMP0]])
678 // CHECK1-NEXT: ret void
681 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined
682 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[T_VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR1:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[T_VAR1:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[VEC:%.*]], ptr noundef nonnull align 4 dereferenceable(16) [[S_ARR:%.*]]) #[[ATTR4:[0-9]+]] {
683 // CHECK1-NEXT: entry:
684 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
685 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
686 // CHECK1-NEXT: [[T_VAR_ADDR:%.*]] = alloca ptr, align 8
687 // CHECK1-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 8
688 // CHECK1-NEXT: [[VAR1_ADDR:%.*]] = alloca ptr, align 8
689 // CHECK1-NEXT: [[T_VAR1_ADDR:%.*]] = alloca ptr, align 8
690 // CHECK1-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 8
691 // CHECK1-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 8
692 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
693 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
694 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
695 // CHECK1-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
696 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
697 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
698 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
699 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
700 // CHECK1-NEXT: [[T_VAR3:%.*]] = alloca float, align 4
701 // CHECK1-NEXT: [[VAR4:%.*]] = alloca [[STRUCT_S:%.*]], align 4
702 // CHECK1-NEXT: [[_TMP5:%.*]] = alloca ptr, align 8
703 // CHECK1-NEXT: [[VAR16:%.*]] = alloca [[STRUCT_S]], align 4
704 // CHECK1-NEXT: [[T_VAR17:%.*]] = alloca float, align 4
705 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
706 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [4 x ptr], align 8
707 // CHECK1-NEXT: [[REF_TMP:%.*]] = alloca [[STRUCT_S]], align 4
708 // CHECK1-NEXT: [[REF_TMP23:%.*]] = alloca [[STRUCT_S]], align 4
709 // CHECK1-NEXT: [[ATOMIC_TEMP:%.*]] = alloca float, align 4
710 // CHECK1-NEXT: [[_TMP31:%.*]] = alloca float, align 4
711 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
712 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
713 // CHECK1-NEXT: store ptr [[T_VAR]], ptr [[T_VAR_ADDR]], align 8
714 // CHECK1-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 8
715 // CHECK1-NEXT: store ptr [[VAR1]], ptr [[VAR1_ADDR]], align 8
716 // CHECK1-NEXT: store ptr [[T_VAR1]], ptr [[T_VAR1_ADDR]], align 8
717 // CHECK1-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 8
718 // CHECK1-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 8
719 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[T_VAR_ADDR]], align 8
720 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[VAR_ADDR]], align 8
721 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR1_ADDR]], align 8
722 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[T_VAR1_ADDR]], align 8
723 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[VEC_ADDR]], align 8
724 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 8
725 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[TMP]], align 8
726 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[TMP]], align 8
727 // CHECK1-NEXT: store ptr [[TMP6]], ptr [[_TMP1]], align 8
728 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
729 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
730 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
731 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
732 // CHECK1-NEXT: store float 0.000000e+00, ptr [[T_VAR3]], align 4
733 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[_TMP1]], align 8
734 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR4]])
735 // CHECK1-NEXT: store ptr [[VAR4]], ptr [[_TMP5]], align 8
736 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR16]])
737 // CHECK1-NEXT: store float 0x47EFFFFFE0000000, ptr [[T_VAR17]], align 4
738 // CHECK1-NEXT: [[TMP8:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
739 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP8]], align 4
740 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP9]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
741 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
742 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP10]], 1
743 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
744 // CHECK1: cond.true:
745 // CHECK1-NEXT: br label [[COND_END:%.*]]
746 // CHECK1: cond.false:
747 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
748 // CHECK1-NEXT: br label [[COND_END]]
749 // CHECK1: cond.end:
750 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP11]], [[COND_FALSE]] ]
751 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
752 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
753 // CHECK1-NEXT: store i32 [[TMP12]], ptr [[DOTOMP_IV]], align 4
754 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
755 // CHECK1: omp.inner.for.cond:
756 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
757 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
758 // CHECK1-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
759 // CHECK1-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
760 // CHECK1: omp.inner.for.cond.cleanup:
761 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
762 // CHECK1: omp.inner.for.body:
763 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
764 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP15]], 1
765 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
766 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
767 // CHECK1-NEXT: [[TMP16:%.*]] = load float, ptr [[T_VAR3]], align 4
768 // CHECK1-NEXT: [[CONV:%.*]] = fptosi float [[TMP16]] to i32
769 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[I]], align 4
770 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP17]] to i64
771 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[TMP4]], i64 0, i64 [[IDXPROM]]
772 // CHECK1-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4
773 // CHECK1-NEXT: [[TMP18:%.*]] = load ptr, ptr [[_TMP5]], align 8
774 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[I]], align 4
775 // CHECK1-NEXT: [[IDXPROM9:%.*]] = sext i32 [[TMP19]] to i64
776 // CHECK1-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds [4 x %struct.S], ptr [[TMP5]], i64 0, i64 [[IDXPROM9]]
777 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX10]], ptr align 4 [[TMP18]], i64 4, i1 false)
778 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
779 // CHECK1: omp.body.continue:
780 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
781 // CHECK1: omp.inner.for.inc:
782 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
783 // CHECK1-NEXT: [[ADD11:%.*]] = add nsw i32 [[TMP20]], 1
784 // CHECK1-NEXT: store i32 [[ADD11]], ptr [[DOTOMP_IV]], align 4
785 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
786 // CHECK1: omp.inner.for.end:
787 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
788 // CHECK1: omp.loop.exit:
789 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP9]])
790 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
791 // CHECK1-NEXT: store ptr [[T_VAR3]], ptr [[TMP21]], align 8
792 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
793 // CHECK1-NEXT: store ptr [[VAR4]], ptr [[TMP22]], align 8
794 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 2
795 // CHECK1-NEXT: store ptr [[VAR16]], ptr [[TMP23]], align 8
796 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 3
797 // CHECK1-NEXT: store ptr [[T_VAR17]], ptr [[TMP24]], align 8
798 // CHECK1-NEXT: [[TMP25:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2:[0-9]+]], i32 [[TMP9]], i32 4, i64 32, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @main.omp_outlined.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
799 // CHECK1-NEXT: switch i32 [[TMP25]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
800 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
801 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
802 // CHECK1-NEXT: ]
803 // CHECK1: .omp.reduction.case1:
804 // CHECK1-NEXT: [[TMP26:%.*]] = load float, ptr [[TMP0]], align 4
805 // CHECK1-NEXT: [[TMP27:%.*]] = load float, ptr [[T_VAR3]], align 4
806 // CHECK1-NEXT: [[ADD12:%.*]] = fadd float [[TMP26]], [[TMP27]]
807 // CHECK1-NEXT: store float [[ADD12]], ptr [[TMP0]], align 4
808 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[TMP7]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR4]])
809 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP7]], ptr align 4 [[CALL]], i64 4, i1 false)
810 // CHECK1-NEXT: [[CALL13:%.*]] = call noundef float @_ZN1SIfEcvfEv(ptr noundef nonnull align 4 dereferenceable(4) [[TMP2]])
811 // CHECK1-NEXT: [[TOBOOL:%.*]] = fcmp une float [[CALL13]], 0.000000e+00
812 // CHECK1-NEXT: br i1 [[TOBOOL]], label [[LAND_RHS:%.*]], label [[LAND_END:%.*]]
813 // CHECK1: land.rhs:
814 // CHECK1-NEXT: [[CALL14:%.*]] = call noundef float @_ZN1SIfEcvfEv(ptr noundef nonnull align 4 dereferenceable(4) [[VAR16]])
815 // CHECK1-NEXT: [[TOBOOL15:%.*]] = fcmp une float [[CALL14]], 0.000000e+00
816 // CHECK1-NEXT: br label [[LAND_END]]
817 // CHECK1: land.end:
818 // CHECK1-NEXT: [[TMP28:%.*]] = phi i1 [ false, [[DOTOMP_REDUCTION_CASE1]] ], [ [[TOBOOL15]], [[LAND_RHS]] ]
819 // CHECK1-NEXT: [[CONV16:%.*]] = uitofp i1 [[TMP28]] to float
820 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP]], float noundef [[CONV16]])
821 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP2]], ptr align 4 [[REF_TMP]], i64 4, i1 false)
822 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP]]) #[[ATTR5]]
823 // CHECK1-NEXT: [[TMP29:%.*]] = load float, ptr [[TMP3]], align 4
824 // CHECK1-NEXT: [[TMP30:%.*]] = load float, ptr [[T_VAR17]], align 4
825 // CHECK1-NEXT: [[CMP17:%.*]] = fcmp olt float [[TMP29]], [[TMP30]]
826 // CHECK1-NEXT: br i1 [[CMP17]], label [[COND_TRUE18:%.*]], label [[COND_FALSE19:%.*]]
827 // CHECK1: cond.true18:
828 // CHECK1-NEXT: [[TMP31:%.*]] = load float, ptr [[TMP3]], align 4
829 // CHECK1-NEXT: br label [[COND_END20:%.*]]
830 // CHECK1: cond.false19:
831 // CHECK1-NEXT: [[TMP32:%.*]] = load float, ptr [[T_VAR17]], align 4
832 // CHECK1-NEXT: br label [[COND_END20]]
833 // CHECK1: cond.end20:
834 // CHECK1-NEXT: [[COND21:%.*]] = phi float [ [[TMP31]], [[COND_TRUE18]] ], [ [[TMP32]], [[COND_FALSE19]] ]
835 // CHECK1-NEXT: store float [[COND21]], ptr [[TMP3]], align 4
836 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP9]], ptr @.gomp_critical_user_.reduction.var)
837 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
838 // CHECK1: .omp.reduction.case2:
839 // CHECK1-NEXT: [[TMP33:%.*]] = load float, ptr [[T_VAR3]], align 4
840 // CHECK1-NEXT: [[TMP34:%.*]] = atomicrmw fadd ptr [[TMP0]], float [[TMP33]] monotonic, align 4
841 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP9]], ptr @.gomp_critical_user_.atomic_reduction.var)
842 // CHECK1-NEXT: [[CALL22:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[TMP7]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR4]])
843 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP7]], ptr align 4 [[CALL22]], i64 4, i1 false)
844 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP9]], ptr @.gomp_critical_user_.atomic_reduction.var)
845 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP9]], ptr @.gomp_critical_user_.atomic_reduction.var)
846 // CHECK1-NEXT: [[CALL24:%.*]] = call noundef float @_ZN1SIfEcvfEv(ptr noundef nonnull align 4 dereferenceable(4) [[TMP2]])
847 // CHECK1-NEXT: [[TOBOOL25:%.*]] = fcmp une float [[CALL24]], 0.000000e+00
848 // CHECK1-NEXT: br i1 [[TOBOOL25]], label [[LAND_RHS26:%.*]], label [[LAND_END29:%.*]]
849 // CHECK1: land.rhs26:
850 // CHECK1-NEXT: [[CALL27:%.*]] = call noundef float @_ZN1SIfEcvfEv(ptr noundef nonnull align 4 dereferenceable(4) [[VAR16]])
851 // CHECK1-NEXT: [[TOBOOL28:%.*]] = fcmp une float [[CALL27]], 0.000000e+00
852 // CHECK1-NEXT: br label [[LAND_END29]]
853 // CHECK1: land.end29:
854 // CHECK1-NEXT: [[TMP35:%.*]] = phi i1 [ false, [[DOTOMP_REDUCTION_CASE2]] ], [ [[TOBOOL28]], [[LAND_RHS26]] ]
855 // CHECK1-NEXT: [[CONV30:%.*]] = uitofp i1 [[TMP35]] to float
856 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP23]], float noundef [[CONV30]])
857 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP2]], ptr align 4 [[REF_TMP23]], i64 4, i1 false)
858 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP23]]) #[[ATTR5]]
859 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP9]], ptr @.gomp_critical_user_.atomic_reduction.var)
860 // CHECK1-NEXT: [[TMP36:%.*]] = load float, ptr [[T_VAR17]], align 4
861 // CHECK1-NEXT: [[ATOMIC_LOAD:%.*]] = load atomic i32, ptr [[TMP3]] monotonic, align 4
862 // CHECK1-NEXT: br label [[ATOMIC_CONT:%.*]]
863 // CHECK1: atomic_cont:
864 // CHECK1-NEXT: [[TMP37:%.*]] = phi i32 [ [[ATOMIC_LOAD]], [[LAND_END29]] ], [ [[TMP45:%.*]], [[COND_END35:%.*]] ]
865 // CHECK1-NEXT: [[TMP38:%.*]] = bitcast i32 [[TMP37]] to float
866 // CHECK1-NEXT: store float [[TMP38]], ptr [[_TMP31]], align 4
867 // CHECK1-NEXT: [[TMP39:%.*]] = load float, ptr [[_TMP31]], align 4
868 // CHECK1-NEXT: [[TMP40:%.*]] = load float, ptr [[T_VAR17]], align 4
869 // CHECK1-NEXT: [[CMP32:%.*]] = fcmp olt float [[TMP39]], [[TMP40]]
870 // CHECK1-NEXT: br i1 [[CMP32]], label [[COND_TRUE33:%.*]], label [[COND_FALSE34:%.*]]
871 // CHECK1: cond.true33:
872 // CHECK1-NEXT: [[TMP41:%.*]] = load float, ptr [[_TMP31]], align 4
873 // CHECK1-NEXT: br label [[COND_END35]]
874 // CHECK1: cond.false34:
875 // CHECK1-NEXT: [[TMP42:%.*]] = load float, ptr [[T_VAR17]], align 4
876 // CHECK1-NEXT: br label [[COND_END35]]
877 // CHECK1: cond.end35:
878 // CHECK1-NEXT: [[COND36:%.*]] = phi float [ [[TMP41]], [[COND_TRUE33]] ], [ [[TMP42]], [[COND_FALSE34]] ]
879 // CHECK1-NEXT: store float [[COND36]], ptr [[ATOMIC_TEMP]], align 4
880 // CHECK1-NEXT: [[TMP43:%.*]] = load i32, ptr [[ATOMIC_TEMP]], align 4
881 // CHECK1-NEXT: [[TMP44:%.*]] = cmpxchg ptr [[TMP3]], i32 [[TMP37]], i32 [[TMP43]] monotonic monotonic, align 4
882 // CHECK1-NEXT: [[TMP45]] = extractvalue { i32, i1 } [[TMP44]], 0
883 // CHECK1-NEXT: [[TMP46:%.*]] = extractvalue { i32, i1 } [[TMP44]], 1
884 // CHECK1-NEXT: br i1 [[TMP46]], label [[ATOMIC_EXIT:%.*]], label [[ATOMIC_CONT]]
885 // CHECK1: atomic_exit:
886 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP9]], ptr @.gomp_critical_user_.reduction.var)
887 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
888 // CHECK1: .omp.reduction.default:
889 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR16]]) #[[ATTR5]]
890 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR4]]) #[[ATTR5]]
891 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4:[0-9]+]], i32 [[TMP9]])
892 // CHECK1-NEXT: ret void
895 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.omp.reduction.reduction_func
896 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] {
897 // CHECK1-NEXT: entry:
898 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
899 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
900 // CHECK1-NEXT: [[REF_TMP:%.*]] = alloca [[STRUCT_S:%.*]], align 4
901 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
902 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
903 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
904 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
905 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP3]], i64 0, i64 0
906 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
907 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP2]], i64 0, i64 0
908 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
909 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP3]], i64 0, i64 1
910 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 8
911 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP2]], i64 0, i64 1
912 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 8
913 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP3]], i64 0, i64 2
914 // CHECK1-NEXT: [[TMP13:%.*]] = load ptr, ptr [[TMP12]], align 8
915 // CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP2]], i64 0, i64 2
916 // CHECK1-NEXT: [[TMP15:%.*]] = load ptr, ptr [[TMP14]], align 8
917 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP3]], i64 0, i64 3
918 // CHECK1-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 8
919 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP2]], i64 0, i64 3
920 // CHECK1-NEXT: [[TMP19:%.*]] = load ptr, ptr [[TMP18]], align 8
921 // CHECK1-NEXT: [[TMP20:%.*]] = load float, ptr [[TMP7]], align 4
922 // CHECK1-NEXT: [[TMP21:%.*]] = load float, ptr [[TMP5]], align 4
923 // CHECK1-NEXT: [[ADD:%.*]] = fadd float [[TMP20]], [[TMP21]]
924 // CHECK1-NEXT: store float [[ADD]], ptr [[TMP7]], align 4
925 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[TMP11]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP9]])
926 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP11]], ptr align 4 [[CALL]], i64 4, i1 false)
927 // CHECK1-NEXT: [[CALL2:%.*]] = call noundef float @_ZN1SIfEcvfEv(ptr noundef nonnull align 4 dereferenceable(4) [[TMP15]])
928 // CHECK1-NEXT: [[TOBOOL:%.*]] = fcmp une float [[CALL2]], 0.000000e+00
929 // CHECK1-NEXT: br i1 [[TOBOOL]], label [[LAND_RHS:%.*]], label [[LAND_END:%.*]]
930 // CHECK1: land.rhs:
931 // CHECK1-NEXT: [[CALL3:%.*]] = call noundef float @_ZN1SIfEcvfEv(ptr noundef nonnull align 4 dereferenceable(4) [[TMP13]])
932 // CHECK1-NEXT: [[TOBOOL4:%.*]] = fcmp une float [[CALL3]], 0.000000e+00
933 // CHECK1-NEXT: br label [[LAND_END]]
934 // CHECK1: land.end:
935 // CHECK1-NEXT: [[TMP22:%.*]] = phi i1 [ false, [[ENTRY:%.*]] ], [ [[TOBOOL4]], [[LAND_RHS]] ]
936 // CHECK1-NEXT: [[CONV:%.*]] = uitofp i1 [[TMP22]] to float
937 // CHECK1-NEXT: call void @_ZN1SIfEC1Ef(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP]], float noundef [[CONV]])
938 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP15]], ptr align 4 [[REF_TMP]], i64 4, i1 false)
939 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP]]) #[[ATTR5]]
940 // CHECK1-NEXT: [[TMP23:%.*]] = load float, ptr [[TMP19]], align 4
941 // CHECK1-NEXT: [[TMP24:%.*]] = load float, ptr [[TMP17]], align 4
942 // CHECK1-NEXT: [[CMP:%.*]] = fcmp olt float [[TMP23]], [[TMP24]]
943 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
944 // CHECK1: cond.true:
945 // CHECK1-NEXT: [[TMP25:%.*]] = load float, ptr [[TMP19]], align 4
946 // CHECK1-NEXT: br label [[COND_END:%.*]]
947 // CHECK1: cond.false:
948 // CHECK1-NEXT: [[TMP26:%.*]] = load float, ptr [[TMP17]], align 4
949 // CHECK1-NEXT: br label [[COND_END]]
950 // CHECK1: cond.end:
951 // CHECK1-NEXT: [[COND:%.*]] = phi float [ [[TMP25]], [[COND_TRUE]] ], [ [[TMP26]], [[COND_FALSE]] ]
952 // CHECK1-NEXT: store float [[COND]], ptr [[TMP19]], align 4
953 // CHECK1-NEXT: ret void
956 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEanERKS0_
957 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP0:%.*]]) #[[ATTR7:[0-9]+]] align 2 {
958 // CHECK1-NEXT: entry:
959 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
960 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
961 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
962 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
963 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
964 // CHECK1-NEXT: ret ptr [[THIS1]]
967 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEcvfEv
968 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) #[[ATTR7]] align 2 {
969 // CHECK1-NEXT: entry:
970 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
971 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
972 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
973 // CHECK1-NEXT: ret float 0.000000e+00
976 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfED1Ev
977 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] align 2 {
978 // CHECK1-NEXT: entry:
979 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
980 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
981 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
982 // CHECK1-NEXT: call void @_ZN1SIfED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR5]]
983 // CHECK1-NEXT: ret void
986 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.1
987 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], i64 noundef [[VLA1:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[ARR:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[VEC:%.*]], ptr noundef nonnull align 4 dereferenceable(160) [[ARRS:%.*]]) #[[ATTR4]] {
988 // CHECK1-NEXT: entry:
989 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
990 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
991 // CHECK1-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
992 // CHECK1-NEXT: [[VLA_ADDR2:%.*]] = alloca i64, align 8
993 // CHECK1-NEXT: [[ARR_ADDR:%.*]] = alloca ptr, align 8
994 // CHECK1-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 8
995 // CHECK1-NEXT: [[ARRS_ADDR:%.*]] = alloca ptr, align 8
996 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
997 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
998 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
999 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1000 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1001 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1002 // CHECK1-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
1003 // CHECK1-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
1004 // CHECK1-NEXT: [[__VLA_EXPR1:%.*]] = alloca i64, align 8
1005 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1006 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [4 x ptr], align 8
1007 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1008 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1009 // CHECK1-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1010 // CHECK1-NEXT: store i64 [[VLA1]], ptr [[VLA_ADDR2]], align 8
1011 // CHECK1-NEXT: store ptr [[ARR]], ptr [[ARR_ADDR]], align 8
1012 // CHECK1-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 8
1013 // CHECK1-NEXT: store ptr [[ARRS]], ptr [[ARRS_ADDR]], align 8
1014 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1015 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR2]], align 8
1016 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[ARR_ADDR]], align 8
1017 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[VEC_ADDR]], align 8
1018 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[ARRS_ADDR]], align 8
1019 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1020 // CHECK1-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
1021 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1022 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1023 // CHECK1-NEXT: [[TMP5:%.*]] = mul nsw i64 1, [[TMP1]]
1024 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[TMP5]]
1025 // CHECK1-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i32, ptr [[ARRAYIDX]], i64 0
1026 // CHECK1-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds [2 x i32], ptr [[TMP3]], i64 0, i64 1
1027 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[ARRAYIDX4]], align 4
1028 // CHECK1-NEXT: [[TMP7:%.*]] = sext i32 [[TMP6]] to i64
1029 // CHECK1-NEXT: [[LB_ADD_LEN:%.*]] = add nsw i64 -1, [[TMP7]]
1030 // CHECK1-NEXT: [[TMP8:%.*]] = mul nsw i64 1, [[TMP1]]
1031 // CHECK1-NEXT: [[ARRAYIDX5:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[TMP8]]
1032 // CHECK1-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds i32, ptr [[ARRAYIDX5]], i64 [[LB_ADD_LEN]]
1033 // CHECK1-NEXT: [[TMP9:%.*]] = ptrtoint ptr [[ARRAYIDX6]] to i64
1034 // CHECK1-NEXT: [[TMP10:%.*]] = ptrtoint ptr [[ARRAYIDX3]] to i64
1035 // CHECK1-NEXT: [[TMP11:%.*]] = sub i64 [[TMP9]], [[TMP10]]
1036 // CHECK1-NEXT: [[TMP12:%.*]] = sdiv exact i64 [[TMP11]], ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64)
1037 // CHECK1-NEXT: [[TMP13:%.*]] = add nuw i64 [[TMP12]], 1
1038 // CHECK1-NEXT: [[TMP14:%.*]] = mul nuw i64 [[TMP13]], ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64)
1039 // CHECK1-NEXT: [[TMP15:%.*]] = call ptr @llvm.stacksave.p0()
1040 // CHECK1-NEXT: store ptr [[TMP15]], ptr [[SAVED_STACK]], align 8
1041 // CHECK1-NEXT: [[VLA7:%.*]] = alloca i32, i64 [[TMP13]], align 16
1042 // CHECK1-NEXT: store i64 [[TMP13]], ptr [[__VLA_EXPR0]], align 8
1043 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr i32, ptr [[VLA7]], i64 [[TMP13]]
1044 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq ptr [[VLA7]], [[TMP16]]
1045 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
1046 // CHECK1: omp.arrayinit.body:
1047 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[VLA7]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
1048 // CHECK1-NEXT: store i32 0, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 4
1049 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1050 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP16]]
1051 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
1052 // CHECK1: omp.arrayinit.done:
1053 // CHECK1-NEXT: [[TMP17:%.*]] = ptrtoint ptr [[TMP2]] to i64
1054 // CHECK1-NEXT: [[TMP18:%.*]] = ptrtoint ptr [[ARRAYIDX3]] to i64
1055 // CHECK1-NEXT: [[TMP19:%.*]] = sub i64 [[TMP17]], [[TMP18]]
1056 // CHECK1-NEXT: [[TMP20:%.*]] = sdiv exact i64 [[TMP19]], ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64)
1057 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr i32, ptr [[VLA7]], i64 [[TMP20]]
1058 // CHECK1-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds [10 x [4 x %struct.S]], ptr [[TMP4]], i64 0, i64 1
1059 // CHECK1-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [4 x %struct.S], ptr [[ARRAYIDX8]], i64 0, i64 0
1060 // CHECK1-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[ARRAYDECAY]], i64 1
1061 // CHECK1-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds [2 x i32], ptr [[TMP3]], i64 0, i64 1
1062 // CHECK1-NEXT: [[TMP22:%.*]] = load i32, ptr [[ARRAYIDX10]], align 4
1063 // CHECK1-NEXT: [[TMP23:%.*]] = sext i32 [[TMP22]] to i64
1064 // CHECK1-NEXT: [[LB_ADD_LEN11:%.*]] = add nsw i64 0, [[TMP23]]
1065 // CHECK1-NEXT: [[ARRAYIDX12:%.*]] = getelementptr inbounds [10 x [4 x %struct.S]], ptr [[TMP4]], i64 0, i64 [[LB_ADD_LEN11]]
1066 // CHECK1-NEXT: [[ARRAYDECAY13:%.*]] = getelementptr inbounds [4 x %struct.S], ptr [[ARRAYIDX12]], i64 0, i64 0
1067 // CHECK1-NEXT: [[ARRAYIDX14:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDECAY13]], i64 2
1068 // CHECK1-NEXT: [[TMP24:%.*]] = ptrtoint ptr [[ARRAYIDX14]] to i64
1069 // CHECK1-NEXT: [[TMP25:%.*]] = ptrtoint ptr [[ARRAYIDX9]] to i64
1070 // CHECK1-NEXT: [[TMP26:%.*]] = sub i64 [[TMP24]], [[TMP25]]
1071 // CHECK1-NEXT: [[TMP27:%.*]] = sdiv exact i64 [[TMP26]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
1072 // CHECK1-NEXT: [[TMP28:%.*]] = add nuw i64 [[TMP27]], 1
1073 // CHECK1-NEXT: [[TMP29:%.*]] = mul nuw i64 [[TMP28]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
1074 // CHECK1-NEXT: [[VLA15:%.*]] = alloca [[STRUCT_S]], i64 [[TMP28]], align 16
1075 // CHECK1-NEXT: store i64 [[TMP28]], ptr [[__VLA_EXPR1]], align 8
1076 // CHECK1-NEXT: [[TMP30:%.*]] = getelementptr [[STRUCT_S]], ptr [[VLA15]], i64 [[TMP28]]
1077 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY16:%.*]] = icmp eq ptr [[VLA15]], [[TMP30]]
1078 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY16]], label [[OMP_ARRAYINIT_DONE21:%.*]], label [[OMP_ARRAYINIT_BODY17:%.*]]
1079 // CHECK1: omp.arrayinit.body17:
1080 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST18:%.*]] = phi ptr [ [[VLA15]], [[OMP_ARRAYINIT_DONE]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT19:%.*]], [[OMP_ARRAYINIT_BODY17]] ]
1081 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST18]])
1082 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT19]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST18]], i32 1
1083 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE20:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT19]], [[TMP30]]
1084 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE20]], label [[OMP_ARRAYINIT_DONE21]], label [[OMP_ARRAYINIT_BODY17]]
1085 // CHECK1: omp.arrayinit.done21:
1086 // CHECK1-NEXT: [[TMP31:%.*]] = ptrtoint ptr [[TMP4]] to i64
1087 // CHECK1-NEXT: [[TMP32:%.*]] = ptrtoint ptr [[ARRAYIDX9]] to i64
1088 // CHECK1-NEXT: [[TMP33:%.*]] = sub i64 [[TMP31]], [[TMP32]]
1089 // CHECK1-NEXT: [[TMP34:%.*]] = sdiv exact i64 [[TMP33]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
1090 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr [[STRUCT_S]], ptr [[VLA15]], i64 [[TMP34]]
1091 // CHECK1-NEXT: [[TMP36:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1092 // CHECK1-NEXT: [[TMP37:%.*]] = load i32, ptr [[TMP36]], align 4
1093 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP37]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1094 // CHECK1-NEXT: [[TMP38:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1095 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP38]], 9
1096 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1097 // CHECK1: cond.true:
1098 // CHECK1-NEXT: br label [[COND_END:%.*]]
1099 // CHECK1: cond.false:
1100 // CHECK1-NEXT: [[TMP39:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1101 // CHECK1-NEXT: br label [[COND_END]]
1102 // CHECK1: cond.end:
1103 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP39]], [[COND_FALSE]] ]
1104 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1105 // CHECK1-NEXT: [[TMP40:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1106 // CHECK1-NEXT: store i32 [[TMP40]], ptr [[DOTOMP_IV]], align 4
1107 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1108 // CHECK1: omp.inner.for.cond:
1109 // CHECK1-NEXT: [[TMP41:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1110 // CHECK1-NEXT: [[TMP42:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1111 // CHECK1-NEXT: [[CMP22:%.*]] = icmp sle i32 [[TMP41]], [[TMP42]]
1112 // CHECK1-NEXT: br i1 [[CMP22]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1113 // CHECK1: omp.inner.for.cond.cleanup:
1114 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1115 // CHECK1: omp.inner.for.body:
1116 // CHECK1-NEXT: [[TMP43:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1117 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP43]], 1
1118 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1119 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1120 // CHECK1-NEXT: [[TMP44:%.*]] = mul nsw i64 1, [[TMP1]]
1121 // CHECK1-NEXT: [[ARRAYIDX23:%.*]] = getelementptr inbounds i32, ptr [[TMP21]], i64 [[TMP44]]
1122 // CHECK1-NEXT: [[TMP45:%.*]] = load i32, ptr [[I]], align 4
1123 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP45]] to i64
1124 // CHECK1-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i32, ptr [[ARRAYIDX23]], i64 [[IDXPROM]]
1125 // CHECK1-NEXT: [[TMP46:%.*]] = load i32, ptr [[ARRAYIDX24]], align 4
1126 // CHECK1-NEXT: [[INC:%.*]] = add nsw i32 [[TMP46]], 1
1127 // CHECK1-NEXT: store i32 [[INC]], ptr [[ARRAYIDX24]], align 4
1128 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1129 // CHECK1: omp.body.continue:
1130 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1131 // CHECK1: omp.inner.for.inc:
1132 // CHECK1-NEXT: [[TMP47:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1133 // CHECK1-NEXT: [[ADD25:%.*]] = add nsw i32 [[TMP47]], 1
1134 // CHECK1-NEXT: store i32 [[ADD25]], ptr [[DOTOMP_IV]], align 4
1135 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1136 // CHECK1: omp.inner.for.end:
1137 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1138 // CHECK1: omp.loop.exit:
1139 // CHECK1-NEXT: [[TMP48:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1140 // CHECK1-NEXT: [[TMP49:%.*]] = load i32, ptr [[TMP48]], align 4
1141 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP49]])
1142 // CHECK1-NEXT: [[TMP50:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
1143 // CHECK1-NEXT: store ptr [[VLA7]], ptr [[TMP50]], align 8
1144 // CHECK1-NEXT: [[TMP51:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
1145 // CHECK1-NEXT: [[TMP52:%.*]] = inttoptr i64 [[TMP13]] to ptr
1146 // CHECK1-NEXT: store ptr [[TMP52]], ptr [[TMP51]], align 8
1147 // CHECK1-NEXT: [[TMP53:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 2
1148 // CHECK1-NEXT: store ptr [[VLA15]], ptr [[TMP53]], align 8
1149 // CHECK1-NEXT: [[TMP54:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 3
1150 // CHECK1-NEXT: [[TMP55:%.*]] = inttoptr i64 [[TMP28]] to ptr
1151 // CHECK1-NEXT: store ptr [[TMP55]], ptr [[TMP54]], align 8
1152 // CHECK1-NEXT: [[TMP56:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1153 // CHECK1-NEXT: [[TMP57:%.*]] = load i32, ptr [[TMP56]], align 4
1154 // CHECK1-NEXT: [[TMP58:%.*]] = call i32 @__kmpc_reduce_nowait(ptr @[[GLOB2]], i32 [[TMP57]], i32 2, i64 32, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @main.omp_outlined.1.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
1155 // CHECK1-NEXT: switch i32 [[TMP58]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
1156 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
1157 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
1158 // CHECK1-NEXT: ]
1159 // CHECK1: .omp.reduction.case1:
1160 // CHECK1-NEXT: [[TMP59:%.*]] = getelementptr i32, ptr [[ARRAYIDX3]], i64 [[TMP13]]
1161 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAYIDX3]], [[TMP59]]
1162 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE30:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1163 // CHECK1: omp.arraycpy.body:
1164 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[VLA7]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1165 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST26:%.*]] = phi ptr [ [[ARRAYIDX3]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT28:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1166 // CHECK1-NEXT: [[TMP60:%.*]] = load i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST26]], align 4
1167 // CHECK1-NEXT: [[TMP61:%.*]] = load i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 4
1168 // CHECK1-NEXT: [[ADD27:%.*]] = add nsw i32 [[TMP60]], [[TMP61]]
1169 // CHECK1-NEXT: store i32 [[ADD27]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST26]], align 4
1170 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT28]] = getelementptr i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST26]], i32 1
1171 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1172 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE29:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT28]], [[TMP59]]
1173 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE29]], label [[OMP_ARRAYCPY_DONE30]], label [[OMP_ARRAYCPY_BODY]]
1174 // CHECK1: omp.arraycpy.done30:
1175 // CHECK1-NEXT: [[TMP62:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX9]], i64 [[TMP28]]
1176 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY31:%.*]] = icmp eq ptr [[ARRAYIDX9]], [[TMP62]]
1177 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY31]], label [[OMP_ARRAYCPY_DONE38:%.*]], label [[OMP_ARRAYCPY_BODY32:%.*]]
1178 // CHECK1: omp.arraycpy.body32:
1179 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST33:%.*]] = phi ptr [ [[VLA15]], [[OMP_ARRAYCPY_DONE30]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT36:%.*]], [[OMP_ARRAYCPY_BODY32]] ]
1180 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST34:%.*]] = phi ptr [ [[ARRAYIDX9]], [[OMP_ARRAYCPY_DONE30]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT35:%.*]], [[OMP_ARRAYCPY_BODY32]] ]
1181 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST34]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST33]])
1182 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST34]], ptr align 4 [[CALL]], i64 4, i1 false)
1183 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT35]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST34]], i32 1
1184 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT36]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST33]], i32 1
1185 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE37:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT35]], [[TMP62]]
1186 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE37]], label [[OMP_ARRAYCPY_DONE38]], label [[OMP_ARRAYCPY_BODY32]]
1187 // CHECK1: omp.arraycpy.done38:
1188 // CHECK1-NEXT: call void @__kmpc_end_reduce_nowait(ptr @[[GLOB2]], i32 [[TMP57]], ptr @.gomp_critical_user_.reduction.var)
1189 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
1190 // CHECK1: .omp.reduction.case2:
1191 // CHECK1-NEXT: [[TMP63:%.*]] = getelementptr i32, ptr [[ARRAYIDX3]], i64 [[TMP13]]
1192 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY39:%.*]] = icmp eq ptr [[ARRAYIDX3]], [[TMP63]]
1193 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY39]], label [[OMP_ARRAYCPY_DONE46:%.*]], label [[OMP_ARRAYCPY_BODY40:%.*]]
1194 // CHECK1: omp.arraycpy.body40:
1195 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST41:%.*]] = phi ptr [ [[VLA7]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT44:%.*]], [[OMP_ARRAYCPY_BODY40]] ]
1196 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST42:%.*]] = phi ptr [ [[ARRAYIDX3]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT43:%.*]], [[OMP_ARRAYCPY_BODY40]] ]
1197 // CHECK1-NEXT: [[TMP64:%.*]] = load i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST41]], align 4
1198 // CHECK1-NEXT: [[TMP65:%.*]] = atomicrmw add ptr [[OMP_ARRAYCPY_DESTELEMENTPAST42]], i32 [[TMP64]] monotonic, align 4
1199 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT43]] = getelementptr i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST42]], i32 1
1200 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT44]] = getelementptr i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST41]], i32 1
1201 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE45:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT43]], [[TMP63]]
1202 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE45]], label [[OMP_ARRAYCPY_DONE46]], label [[OMP_ARRAYCPY_BODY40]]
1203 // CHECK1: omp.arraycpy.done46:
1204 // CHECK1-NEXT: [[TMP66:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX9]], i64 [[TMP28]]
1205 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY47:%.*]] = icmp eq ptr [[ARRAYIDX9]], [[TMP66]]
1206 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY47]], label [[OMP_ARRAYCPY_DONE55:%.*]], label [[OMP_ARRAYCPY_BODY48:%.*]]
1207 // CHECK1: omp.arraycpy.body48:
1208 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST49:%.*]] = phi ptr [ [[VLA15]], [[OMP_ARRAYCPY_DONE46]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT53:%.*]], [[OMP_ARRAYCPY_BODY48]] ]
1209 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST50:%.*]] = phi ptr [ [[ARRAYIDX9]], [[OMP_ARRAYCPY_DONE46]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT52:%.*]], [[OMP_ARRAYCPY_BODY48]] ]
1210 // CHECK1-NEXT: [[TMP67:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1211 // CHECK1-NEXT: [[TMP68:%.*]] = load i32, ptr [[TMP67]], align 4
1212 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP68]], ptr @.gomp_critical_user_.atomic_reduction.var)
1213 // CHECK1-NEXT: [[CALL51:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST50]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST49]])
1214 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST50]], ptr align 4 [[CALL51]], i64 4, i1 false)
1215 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP68]], ptr @.gomp_critical_user_.atomic_reduction.var)
1216 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT52]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST50]], i32 1
1217 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT53]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST49]], i32 1
1218 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE54:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT52]], [[TMP66]]
1219 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE54]], label [[OMP_ARRAYCPY_DONE55]], label [[OMP_ARRAYCPY_BODY48]]
1220 // CHECK1: omp.arraycpy.done55:
1221 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
1222 // CHECK1: .omp.reduction.default:
1223 // CHECK1-NEXT: [[TMP69:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[VLA15]], i64 [[TMP28]]
1224 // CHECK1-NEXT: [[ARRAYDESTROY_ISEMPTY:%.*]] = icmp eq ptr [[VLA15]], [[TMP69]]
1225 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_ISEMPTY]], label [[ARRAYDESTROY_DONE56:%.*]], label [[ARRAYDESTROY_BODY:%.*]]
1226 // CHECK1: arraydestroy.body:
1227 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP69]], [[DOTOMP_REDUCTION_DEFAULT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1228 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
1229 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR5]]
1230 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[VLA15]]
1231 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE56]], label [[ARRAYDESTROY_BODY]]
1232 // CHECK1: arraydestroy.done56:
1233 // CHECK1-NEXT: [[TMP70:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
1234 // CHECK1-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP70]])
1235 // CHECK1-NEXT: ret void
1238 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.1.omp.reduction.reduction_func
1239 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
1240 // CHECK1-NEXT: entry:
1241 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
1242 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
1243 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
1244 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
1245 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
1246 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
1247 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP3]], i64 0, i64 0
1248 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
1249 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP2]], i64 0, i64 0
1250 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
1251 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP2]], i64 0, i64 1
1252 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 8
1253 // CHECK1-NEXT: [[TMP10:%.*]] = ptrtoint ptr [[TMP9]] to i64
1254 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP3]], i64 0, i64 2
1255 // CHECK1-NEXT: [[TMP12:%.*]] = load ptr, ptr [[TMP11]], align 8
1256 // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP2]], i64 0, i64 2
1257 // CHECK1-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP13]], align 8
1258 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP2]], i64 0, i64 3
1259 // CHECK1-NEXT: [[TMP16:%.*]] = load ptr, ptr [[TMP15]], align 8
1260 // CHECK1-NEXT: [[TMP17:%.*]] = ptrtoint ptr [[TMP16]] to i64
1261 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr i32, ptr [[TMP7]], i64 [[TMP10]]
1262 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP7]], [[TMP18]]
1263 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE2:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1264 // CHECK1: omp.arraycpy.body:
1265 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP5]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1266 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[TMP7]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1267 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 4
1268 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 4
1269 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP19]], [[TMP20]]
1270 // CHECK1-NEXT: store i32 [[ADD]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 4
1271 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1272 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1273 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP18]]
1274 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE2]], label [[OMP_ARRAYCPY_BODY]]
1275 // CHECK1: omp.arraycpy.done2:
1276 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[TMP14]], i64 [[TMP17]]
1277 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY3:%.*]] = icmp eq ptr [[TMP14]], [[TMP21]]
1278 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY3]], label [[OMP_ARRAYCPY_DONE10:%.*]], label [[OMP_ARRAYCPY_BODY4:%.*]]
1279 // CHECK1: omp.arraycpy.body4:
1280 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST5:%.*]] = phi ptr [ [[TMP12]], [[OMP_ARRAYCPY_DONE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT8:%.*]], [[OMP_ARRAYCPY_BODY4]] ]
1281 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST6:%.*]] = phi ptr [ [[TMP14]], [[OMP_ARRAYCPY_DONE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT7:%.*]], [[OMP_ARRAYCPY_BODY4]] ]
1282 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST6]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST5]])
1283 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST6]], ptr align 4 [[CALL]], i64 4, i1 false)
1284 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT7]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST6]], i32 1
1285 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT8]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST5]], i32 1
1286 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE9:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT7]], [[TMP21]]
1287 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE9]], label [[OMP_ARRAYCPY_DONE10]], label [[OMP_ARRAYCPY_BODY4]]
1288 // CHECK1: omp.arraycpy.done10:
1289 // CHECK1-NEXT: ret void
1292 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.2
1293 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], i64 noundef [[VLA1:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[ARR:%.*]], ptr noundef nonnull align 4 dereferenceable(160) [[ARRS:%.*]]) #[[ATTR4]] {
1294 // CHECK1-NEXT: entry:
1295 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1296 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1297 // CHECK1-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1298 // CHECK1-NEXT: [[VLA_ADDR2:%.*]] = alloca i64, align 8
1299 // CHECK1-NEXT: [[ARR_ADDR:%.*]] = alloca ptr, align 8
1300 // CHECK1-NEXT: [[ARRS_ADDR:%.*]] = alloca ptr, align 8
1301 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1302 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1303 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1304 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1305 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1306 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1307 // CHECK1-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
1308 // CHECK1-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
1309 // CHECK1-NEXT: [[ARRS4:%.*]] = alloca [10 x [4 x %struct.S]], align 16
1310 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1311 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [3 x ptr], align 8
1312 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1313 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1314 // CHECK1-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1315 // CHECK1-NEXT: store i64 [[VLA1]], ptr [[VLA_ADDR2]], align 8
1316 // CHECK1-NEXT: store ptr [[ARR]], ptr [[ARR_ADDR]], align 8
1317 // CHECK1-NEXT: store ptr [[ARRS]], ptr [[ARRS_ADDR]], align 8
1318 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1319 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR2]], align 8
1320 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[ARR_ADDR]], align 8
1321 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[ARRS_ADDR]], align 8
1322 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1323 // CHECK1-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
1324 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1325 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1326 // CHECK1-NEXT: [[TMP4:%.*]] = mul nuw i64 [[TMP0]], [[TMP1]]
1327 // CHECK1-NEXT: [[TMP5:%.*]] = mul nuw i64 [[TMP4]], 4
1328 // CHECK1-NEXT: [[TMP6:%.*]] = udiv exact i64 [[TMP5]], ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64)
1329 // CHECK1-NEXT: [[TMP7:%.*]] = call ptr @llvm.stacksave.p0()
1330 // CHECK1-NEXT: store ptr [[TMP7]], ptr [[SAVED_STACK]], align 8
1331 // CHECK1-NEXT: [[VLA3:%.*]] = alloca i32, i64 [[TMP6]], align 16
1332 // CHECK1-NEXT: store i64 [[TMP6]], ptr [[__VLA_EXPR0]], align 8
1333 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr i32, ptr [[VLA3]], i64 [[TMP6]]
1334 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq ptr [[VLA3]], [[TMP8]]
1335 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
1336 // CHECK1: omp.arrayinit.body:
1337 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[VLA3]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
1338 // CHECK1-NEXT: store i32 0, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 4
1339 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1340 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP8]]
1341 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
1342 // CHECK1: omp.arrayinit.done:
1343 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [10 x [4 x %struct.S]], ptr [[ARRS4]], i32 0, i32 0, i32 0
1344 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[ARRAY_BEGIN]], i64 40
1345 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY5:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP9]]
1346 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY5]], label [[OMP_ARRAYINIT_DONE10:%.*]], label [[OMP_ARRAYINIT_BODY6:%.*]]
1347 // CHECK1: omp.arrayinit.body6:
1348 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST7:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[OMP_ARRAYINIT_DONE]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT8:%.*]], [[OMP_ARRAYINIT_BODY6]] ]
1349 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST7]])
1350 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT8]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST7]], i32 1
1351 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE9:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT8]], [[TMP9]]
1352 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE9]], label [[OMP_ARRAYINIT_DONE10]], label [[OMP_ARRAYINIT_BODY6]]
1353 // CHECK1: omp.arrayinit.done10:
1354 // CHECK1-NEXT: [[TMP10:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1355 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP10]], align 4
1356 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP11]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1357 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1358 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP12]], 9
1359 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1360 // CHECK1: cond.true:
1361 // CHECK1-NEXT: br label [[COND_END:%.*]]
1362 // CHECK1: cond.false:
1363 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1364 // CHECK1-NEXT: br label [[COND_END]]
1365 // CHECK1: cond.end:
1366 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP13]], [[COND_FALSE]] ]
1367 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1368 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1369 // CHECK1-NEXT: store i32 [[TMP14]], ptr [[DOTOMP_IV]], align 4
1370 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1371 // CHECK1: omp.inner.for.cond:
1372 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1373 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1374 // CHECK1-NEXT: [[CMP11:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
1375 // CHECK1-NEXT: br i1 [[CMP11]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1376 // CHECK1: omp.inner.for.cond.cleanup:
1377 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1378 // CHECK1: omp.inner.for.body:
1379 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1380 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP17]], 1
1381 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1382 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1383 // CHECK1-NEXT: [[TMP18:%.*]] = mul nsw i64 1, [[TMP1]]
1384 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA3]], i64 [[TMP18]]
1385 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[I]], align 4
1386 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP19]] to i64
1387 // CHECK1-NEXT: [[ARRAYIDX12:%.*]] = getelementptr inbounds i32, ptr [[ARRAYIDX]], i64 [[IDXPROM]]
1388 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[ARRAYIDX12]], align 4
1389 // CHECK1-NEXT: [[INC:%.*]] = add nsw i32 [[TMP20]], 1
1390 // CHECK1-NEXT: store i32 [[INC]], ptr [[ARRAYIDX12]], align 4
1391 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1392 // CHECK1: omp.body.continue:
1393 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1394 // CHECK1: omp.inner.for.inc:
1395 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1396 // CHECK1-NEXT: [[ADD13:%.*]] = add nsw i32 [[TMP21]], 1
1397 // CHECK1-NEXT: store i32 [[ADD13]], ptr [[DOTOMP_IV]], align 4
1398 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1399 // CHECK1: omp.inner.for.end:
1400 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1401 // CHECK1: omp.loop.exit:
1402 // CHECK1-NEXT: [[TMP22:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1403 // CHECK1-NEXT: [[TMP23:%.*]] = load i32, ptr [[TMP22]], align 4
1404 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP23]])
1405 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
1406 // CHECK1-NEXT: store ptr [[VLA3]], ptr [[TMP24]], align 8
1407 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
1408 // CHECK1-NEXT: [[TMP26:%.*]] = inttoptr i64 [[TMP6]] to ptr
1409 // CHECK1-NEXT: store ptr [[TMP26]], ptr [[TMP25]], align 8
1410 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 2
1411 // CHECK1-NEXT: store ptr [[ARRS4]], ptr [[TMP27]], align 8
1412 // CHECK1-NEXT: [[TMP28:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1413 // CHECK1-NEXT: [[TMP29:%.*]] = load i32, ptr [[TMP28]], align 4
1414 // CHECK1-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2]], i32 [[TMP29]], i32 2, i64 24, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @main.omp_outlined.2.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
1415 // CHECK1-NEXT: switch i32 [[TMP30]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
1416 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
1417 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
1418 // CHECK1-NEXT: ]
1419 // CHECK1: .omp.reduction.case1:
1420 // CHECK1-NEXT: [[TMP31:%.*]] = getelementptr i32, ptr [[TMP2]], i64 [[TMP6]]
1421 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP2]], [[TMP31]]
1422 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE18:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1423 // CHECK1: omp.arraycpy.body:
1424 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[VLA3]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1425 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST14:%.*]] = phi ptr [ [[TMP2]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT16:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1426 // CHECK1-NEXT: [[TMP32:%.*]] = load i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST14]], align 4
1427 // CHECK1-NEXT: [[TMP33:%.*]] = load i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 4
1428 // CHECK1-NEXT: [[ADD15:%.*]] = add nsw i32 [[TMP32]], [[TMP33]]
1429 // CHECK1-NEXT: store i32 [[ADD15]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST14]], align 4
1430 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT16]] = getelementptr i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST14]], i32 1
1431 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1432 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE17:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT16]], [[TMP31]]
1433 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE17]], label [[OMP_ARRAYCPY_DONE18]], label [[OMP_ARRAYCPY_BODY]]
1434 // CHECK1: omp.arraycpy.done18:
1435 // CHECK1-NEXT: [[TMP34:%.*]] = getelementptr [[STRUCT_S]], ptr [[TMP3]], i64 40
1436 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY19:%.*]] = icmp eq ptr [[TMP3]], [[TMP34]]
1437 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY19]], label [[OMP_ARRAYCPY_DONE26:%.*]], label [[OMP_ARRAYCPY_BODY20:%.*]]
1438 // CHECK1: omp.arraycpy.body20:
1439 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST21:%.*]] = phi ptr [ [[ARRS4]], [[OMP_ARRAYCPY_DONE18]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT24:%.*]], [[OMP_ARRAYCPY_BODY20]] ]
1440 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST22:%.*]] = phi ptr [ [[TMP3]], [[OMP_ARRAYCPY_DONE18]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT23:%.*]], [[OMP_ARRAYCPY_BODY20]] ]
1441 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST22]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST21]])
1442 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST22]], ptr align 4 [[CALL]], i64 4, i1 false)
1443 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT23]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST22]], i32 1
1444 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT24]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST21]], i32 1
1445 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE25:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT23]], [[TMP34]]
1446 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE25]], label [[OMP_ARRAYCPY_DONE26]], label [[OMP_ARRAYCPY_BODY20]]
1447 // CHECK1: omp.arraycpy.done26:
1448 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP29]], ptr @.gomp_critical_user_.reduction.var)
1449 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
1450 // CHECK1: .omp.reduction.case2:
1451 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr i32, ptr [[TMP2]], i64 [[TMP6]]
1452 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY27:%.*]] = icmp eq ptr [[TMP2]], [[TMP35]]
1453 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY27]], label [[OMP_ARRAYCPY_DONE34:%.*]], label [[OMP_ARRAYCPY_BODY28:%.*]]
1454 // CHECK1: omp.arraycpy.body28:
1455 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST29:%.*]] = phi ptr [ [[VLA3]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT32:%.*]], [[OMP_ARRAYCPY_BODY28]] ]
1456 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST30:%.*]] = phi ptr [ [[TMP2]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT31:%.*]], [[OMP_ARRAYCPY_BODY28]] ]
1457 // CHECK1-NEXT: [[TMP36:%.*]] = load i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST29]], align 4
1458 // CHECK1-NEXT: [[TMP37:%.*]] = atomicrmw add ptr [[OMP_ARRAYCPY_DESTELEMENTPAST30]], i32 [[TMP36]] monotonic, align 4
1459 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT31]] = getelementptr i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST30]], i32 1
1460 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT32]] = getelementptr i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST29]], i32 1
1461 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE33:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT31]], [[TMP35]]
1462 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE33]], label [[OMP_ARRAYCPY_DONE34]], label [[OMP_ARRAYCPY_BODY28]]
1463 // CHECK1: omp.arraycpy.done34:
1464 // CHECK1-NEXT: [[TMP38:%.*]] = getelementptr [[STRUCT_S]], ptr [[TMP3]], i64 40
1465 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY35:%.*]] = icmp eq ptr [[TMP3]], [[TMP38]]
1466 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY35]], label [[OMP_ARRAYCPY_DONE43:%.*]], label [[OMP_ARRAYCPY_BODY36:%.*]]
1467 // CHECK1: omp.arraycpy.body36:
1468 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST37:%.*]] = phi ptr [ [[ARRS4]], [[OMP_ARRAYCPY_DONE34]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT41:%.*]], [[OMP_ARRAYCPY_BODY36]] ]
1469 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST38:%.*]] = phi ptr [ [[TMP3]], [[OMP_ARRAYCPY_DONE34]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT40:%.*]], [[OMP_ARRAYCPY_BODY36]] ]
1470 // CHECK1-NEXT: [[TMP39:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1471 // CHECK1-NEXT: [[TMP40:%.*]] = load i32, ptr [[TMP39]], align 4
1472 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP40]], ptr @.gomp_critical_user_.atomic_reduction.var)
1473 // CHECK1-NEXT: [[CALL39:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST38]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST37]])
1474 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST38]], ptr align 4 [[CALL39]], i64 4, i1 false)
1475 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP40]], ptr @.gomp_critical_user_.atomic_reduction.var)
1476 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT40]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST38]], i32 1
1477 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT41]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST37]], i32 1
1478 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE42:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT40]], [[TMP38]]
1479 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE42]], label [[OMP_ARRAYCPY_DONE43]], label [[OMP_ARRAYCPY_BODY36]]
1480 // CHECK1: omp.arraycpy.done43:
1481 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP29]], ptr @.gomp_critical_user_.reduction.var)
1482 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
1483 // CHECK1: .omp.reduction.default:
1484 // CHECK1-NEXT: [[ARRAY_BEGIN44:%.*]] = getelementptr inbounds [10 x [4 x %struct.S]], ptr [[ARRS4]], i32 0, i32 0, i32 0
1485 // CHECK1-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN44]], i64 40
1486 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
1487 // CHECK1: arraydestroy.body:
1488 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP41]], [[DOTOMP_REDUCTION_DEFAULT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1489 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
1490 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR5]]
1491 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN44]]
1492 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE45:%.*]], label [[ARRAYDESTROY_BODY]]
1493 // CHECK1: arraydestroy.done45:
1494 // CHECK1-NEXT: [[TMP42:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
1495 // CHECK1-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP42]])
1496 // CHECK1-NEXT: [[TMP43:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1497 // CHECK1-NEXT: [[TMP44:%.*]] = load i32, ptr [[TMP43]], align 4
1498 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4]], i32 [[TMP44]])
1499 // CHECK1-NEXT: ret void
1502 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.2.omp.reduction.reduction_func
1503 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
1504 // CHECK1-NEXT: entry:
1505 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
1506 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
1507 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
1508 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
1509 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
1510 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
1511 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [3 x ptr], ptr [[TMP3]], i64 0, i64 0
1512 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
1513 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[TMP2]], i64 0, i64 0
1514 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
1515 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[TMP2]], i64 0, i64 1
1516 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 8
1517 // CHECK1-NEXT: [[TMP10:%.*]] = ptrtoint ptr [[TMP9]] to i64
1518 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[TMP3]], i64 0, i64 2
1519 // CHECK1-NEXT: [[TMP12:%.*]] = load ptr, ptr [[TMP11]], align 8
1520 // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[TMP2]], i64 0, i64 2
1521 // CHECK1-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP13]], align 8
1522 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr i32, ptr [[TMP7]], i64 [[TMP10]]
1523 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP7]], [[TMP15]]
1524 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE2:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1525 // CHECK1: omp.arraycpy.body:
1526 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP5]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1527 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[TMP7]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1528 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 4
1529 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 4
1530 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP16]], [[TMP17]]
1531 // CHECK1-NEXT: store i32 [[ADD]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 4
1532 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1533 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1534 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP15]]
1535 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE2]], label [[OMP_ARRAYCPY_BODY]]
1536 // CHECK1: omp.arraycpy.done2:
1537 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[TMP14]], i64 40
1538 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY3:%.*]] = icmp eq ptr [[TMP14]], [[TMP18]]
1539 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY3]], label [[OMP_ARRAYCPY_DONE10:%.*]], label [[OMP_ARRAYCPY_BODY4:%.*]]
1540 // CHECK1: omp.arraycpy.body4:
1541 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST5:%.*]] = phi ptr [ [[TMP12]], [[OMP_ARRAYCPY_DONE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT8:%.*]], [[OMP_ARRAYCPY_BODY4]] ]
1542 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST6:%.*]] = phi ptr [ [[TMP14]], [[OMP_ARRAYCPY_DONE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT7:%.*]], [[OMP_ARRAYCPY_BODY4]] ]
1543 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST6]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST5]])
1544 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST6]], ptr align 4 [[CALL]], i64 4, i1 false)
1545 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT7]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST6]], i32 1
1546 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT8]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST5]], i32 1
1547 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE9:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT7]], [[TMP18]]
1548 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE9]], label [[OMP_ARRAYCPY_DONE10]], label [[OMP_ARRAYCPY_BODY4]]
1549 // CHECK1: omp.arraycpy.done10:
1550 // CHECK1-NEXT: ret void
1553 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.3
1554 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], i64 noundef [[VLA1:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[ARR:%.*]]) #[[ATTR4]] {
1555 // CHECK1-NEXT: entry:
1556 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1557 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1558 // CHECK1-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1559 // CHECK1-NEXT: [[VLA_ADDR2:%.*]] = alloca i64, align 8
1560 // CHECK1-NEXT: [[ARR_ADDR:%.*]] = alloca ptr, align 8
1561 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1562 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1563 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1564 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1565 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1566 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1567 // CHECK1-NEXT: [[ARR6:%.*]] = alloca [1 x [2 x i32]], align 4
1568 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1569 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8
1570 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1571 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1572 // CHECK1-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1573 // CHECK1-NEXT: store i64 [[VLA1]], ptr [[VLA_ADDR2]], align 8
1574 // CHECK1-NEXT: store ptr [[ARR]], ptr [[ARR_ADDR]], align 8
1575 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1576 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR2]], align 8
1577 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[ARR_ADDR]], align 8
1578 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1579 // CHECK1-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
1580 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1581 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1582 // CHECK1-NEXT: [[TMP3:%.*]] = mul nsw i64 1, [[TMP1]]
1583 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[TMP3]]
1584 // CHECK1-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i32, ptr [[ARRAYIDX]], i64 0
1585 // CHECK1-NEXT: [[TMP4:%.*]] = mul nsw i64 1, [[TMP1]]
1586 // CHECK1-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[TMP4]]
1587 // CHECK1-NEXT: [[ARRAYIDX5:%.*]] = getelementptr inbounds i32, ptr [[ARRAYIDX4]], i64 1
1588 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [1 x [2 x i32]], ptr [[ARR6]], i32 0, i32 0, i32 0
1589 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr i32, ptr [[ARRAY_BEGIN]], i64 2
1590 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP5]]
1591 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
1592 // CHECK1: omp.arrayinit.body:
1593 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
1594 // CHECK1-NEXT: store i32 0, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 4
1595 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1596 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP5]]
1597 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
1598 // CHECK1: omp.arrayinit.done:
1599 // CHECK1-NEXT: [[TMP6:%.*]] = ptrtoint ptr [[TMP2]] to i64
1600 // CHECK1-NEXT: [[TMP7:%.*]] = ptrtoint ptr [[ARRAYIDX3]] to i64
1601 // CHECK1-NEXT: [[TMP8:%.*]] = sub i64 [[TMP6]], [[TMP7]]
1602 // CHECK1-NEXT: [[TMP9:%.*]] = sdiv exact i64 [[TMP8]], ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64)
1603 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr i32, ptr [[ARR6]], i64 [[TMP9]]
1604 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1605 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP11]], align 4
1606 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP12]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1607 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1608 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP13]], 9
1609 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1610 // CHECK1: cond.true:
1611 // CHECK1-NEXT: br label [[COND_END:%.*]]
1612 // CHECK1: cond.false:
1613 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1614 // CHECK1-NEXT: br label [[COND_END]]
1615 // CHECK1: cond.end:
1616 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP14]], [[COND_FALSE]] ]
1617 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1618 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1619 // CHECK1-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_IV]], align 4
1620 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1621 // CHECK1: omp.inner.for.cond:
1622 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1623 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1624 // CHECK1-NEXT: [[CMP7:%.*]] = icmp sle i32 [[TMP16]], [[TMP17]]
1625 // CHECK1-NEXT: br i1 [[CMP7]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1626 // CHECK1: omp.inner.for.body:
1627 // CHECK1-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1628 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP18]], 1
1629 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1630 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1631 // CHECK1-NEXT: [[TMP19:%.*]] = mul nsw i64 1, [[TMP1]]
1632 // CHECK1-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds i32, ptr [[TMP10]], i64 [[TMP19]]
1633 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[I]], align 4
1634 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP20]] to i64
1635 // CHECK1-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds i32, ptr [[ARRAYIDX8]], i64 [[IDXPROM]]
1636 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[ARRAYIDX9]], align 4
1637 // CHECK1-NEXT: [[INC:%.*]] = add nsw i32 [[TMP21]], 1
1638 // CHECK1-NEXT: store i32 [[INC]], ptr [[ARRAYIDX9]], align 4
1639 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1640 // CHECK1: omp.body.continue:
1641 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1642 // CHECK1: omp.inner.for.inc:
1643 // CHECK1-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1644 // CHECK1-NEXT: [[ADD10:%.*]] = add nsw i32 [[TMP22]], 1
1645 // CHECK1-NEXT: store i32 [[ADD10]], ptr [[DOTOMP_IV]], align 4
1646 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1647 // CHECK1: omp.inner.for.end:
1648 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1649 // CHECK1: omp.loop.exit:
1650 // CHECK1-NEXT: [[TMP23:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1651 // CHECK1-NEXT: [[TMP24:%.*]] = load i32, ptr [[TMP23]], align 4
1652 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP24]])
1653 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
1654 // CHECK1-NEXT: store ptr [[ARR6]], ptr [[TMP25]], align 8
1655 // CHECK1-NEXT: [[TMP26:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1656 // CHECK1-NEXT: [[TMP27:%.*]] = load i32, ptr [[TMP26]], align 4
1657 // CHECK1-NEXT: [[TMP28:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2]], i32 [[TMP27]], i32 1, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @main.omp_outlined.3.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
1658 // CHECK1-NEXT: switch i32 [[TMP28]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
1659 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
1660 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
1661 // CHECK1-NEXT: ]
1662 // CHECK1: .omp.reduction.case1:
1663 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr i32, ptr [[ARRAYIDX3]], i64 2
1664 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAYIDX3]], [[TMP29]]
1665 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE15:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1666 // CHECK1: omp.arraycpy.body:
1667 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[ARR6]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1668 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST11:%.*]] = phi ptr [ [[ARRAYIDX3]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT13:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1669 // CHECK1-NEXT: [[TMP30:%.*]] = load i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST11]], align 4
1670 // CHECK1-NEXT: [[TMP31:%.*]] = load i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 4
1671 // CHECK1-NEXT: [[ADD12:%.*]] = add nsw i32 [[TMP30]], [[TMP31]]
1672 // CHECK1-NEXT: store i32 [[ADD12]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST11]], align 4
1673 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT13]] = getelementptr i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST11]], i32 1
1674 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1675 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE14:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT13]], [[TMP29]]
1676 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE14]], label [[OMP_ARRAYCPY_DONE15]], label [[OMP_ARRAYCPY_BODY]]
1677 // CHECK1: omp.arraycpy.done15:
1678 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP27]], ptr @.gomp_critical_user_.reduction.var)
1679 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
1680 // CHECK1: .omp.reduction.case2:
1681 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr i32, ptr [[ARRAYIDX3]], i64 2
1682 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY16:%.*]] = icmp eq ptr [[ARRAYIDX3]], [[TMP32]]
1683 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY16]], label [[OMP_ARRAYCPY_DONE23:%.*]], label [[OMP_ARRAYCPY_BODY17:%.*]]
1684 // CHECK1: omp.arraycpy.body17:
1685 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST18:%.*]] = phi ptr [ [[ARR6]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT21:%.*]], [[OMP_ARRAYCPY_BODY17]] ]
1686 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST19:%.*]] = phi ptr [ [[ARRAYIDX3]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT20:%.*]], [[OMP_ARRAYCPY_BODY17]] ]
1687 // CHECK1-NEXT: [[TMP33:%.*]] = load i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST18]], align 4
1688 // CHECK1-NEXT: [[TMP34:%.*]] = atomicrmw add ptr [[OMP_ARRAYCPY_DESTELEMENTPAST19]], i32 [[TMP33]] monotonic, align 4
1689 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT20]] = getelementptr i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST19]], i32 1
1690 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT21]] = getelementptr i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST18]], i32 1
1691 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE22:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT20]], [[TMP32]]
1692 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE22]], label [[OMP_ARRAYCPY_DONE23]], label [[OMP_ARRAYCPY_BODY17]]
1693 // CHECK1: omp.arraycpy.done23:
1694 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP27]], ptr @.gomp_critical_user_.reduction.var)
1695 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
1696 // CHECK1: .omp.reduction.default:
1697 // CHECK1-NEXT: [[TMP35:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1698 // CHECK1-NEXT: [[TMP36:%.*]] = load i32, ptr [[TMP35]], align 4
1699 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4]], i32 [[TMP36]])
1700 // CHECK1-NEXT: ret void
1703 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.3.omp.reduction.reduction_func
1704 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
1705 // CHECK1-NEXT: entry:
1706 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
1707 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
1708 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
1709 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
1710 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
1711 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
1712 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i64 0, i64 0
1713 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
1714 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP2]], i64 0, i64 0
1715 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
1716 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr i32, ptr [[TMP7]], i64 2
1717 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP7]], [[TMP8]]
1718 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE2:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1719 // CHECK1: omp.arraycpy.body:
1720 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP5]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1721 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[TMP7]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1722 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 4
1723 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 4
1724 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP9]], [[TMP10]]
1725 // CHECK1-NEXT: store i32 [[ADD]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 4
1726 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i32, ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1727 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i32, ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1728 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP8]]
1729 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE2]], label [[OMP_ARRAYCPY_BODY]]
1730 // CHECK1: omp.arraycpy.done2:
1731 // CHECK1-NEXT: ret void
1734 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.4
1735 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[VAR2:%.*]]) #[[ATTR4]] {
1736 // CHECK1-NEXT: entry:
1737 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1738 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1739 // CHECK1-NEXT: [[VAR2_ADDR:%.*]] = alloca ptr, align 8
1740 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1741 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1742 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1743 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1744 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1745 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1746 // CHECK1-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
1747 // CHECK1-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
1748 // CHECK1-NEXT: [[_TMP4:%.*]] = alloca ptr, align 8
1749 // CHECK1-NEXT: [[_TMP5:%.*]] = alloca ptr, align 8
1750 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1751 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 8
1752 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1753 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1754 // CHECK1-NEXT: store ptr [[VAR2]], ptr [[VAR2_ADDR]], align 8
1755 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR2_ADDR]], align 8
1756 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1757 // CHECK1-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
1758 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1759 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1760 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP0]], align 8
1761 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds ptr, ptr [[TMP1]], i64 0
1762 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[ARRAYIDX]], align 8
1763 // CHECK1-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[TMP2]], i64 1
1764 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP0]], align 8
1765 // CHECK1-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds ptr, ptr [[TMP3]], i64 4
1766 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[ARRAYIDX2]], align 8
1767 // CHECK1-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[TMP4]], i64 6
1768 // CHECK1-NEXT: [[TMP5:%.*]] = ptrtoint ptr [[ARRAYIDX3]] to i64
1769 // CHECK1-NEXT: [[TMP6:%.*]] = ptrtoint ptr [[ARRAYIDX1]] to i64
1770 // CHECK1-NEXT: [[TMP7:%.*]] = sub i64 [[TMP5]], [[TMP6]]
1771 // CHECK1-NEXT: [[TMP8:%.*]] = sdiv exact i64 [[TMP7]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
1772 // CHECK1-NEXT: [[TMP9:%.*]] = add nuw i64 [[TMP8]], 1
1773 // CHECK1-NEXT: [[TMP10:%.*]] = mul nuw i64 [[TMP9]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
1774 // CHECK1-NEXT: [[TMP11:%.*]] = call ptr @llvm.stacksave.p0()
1775 // CHECK1-NEXT: store ptr [[TMP11]], ptr [[SAVED_STACK]], align 8
1776 // CHECK1-NEXT: [[VLA:%.*]] = alloca [[STRUCT_S]], i64 [[TMP9]], align 16
1777 // CHECK1-NEXT: store i64 [[TMP9]], ptr [[__VLA_EXPR0]], align 8
1778 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr [[STRUCT_S]], ptr [[VLA]], i64 [[TMP9]]
1779 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq ptr [[VLA]], [[TMP12]]
1780 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
1781 // CHECK1: omp.arrayinit.body:
1782 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[VLA]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
1783 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]])
1784 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1785 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP12]]
1786 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
1787 // CHECK1: omp.arrayinit.done:
1788 // CHECK1-NEXT: [[TMP13:%.*]] = load ptr, ptr [[TMP0]], align 8
1789 // CHECK1-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP13]], align 8
1790 // CHECK1-NEXT: [[TMP15:%.*]] = ptrtoint ptr [[TMP14]] to i64
1791 // CHECK1-NEXT: [[TMP16:%.*]] = ptrtoint ptr [[ARRAYIDX1]] to i64
1792 // CHECK1-NEXT: [[TMP17:%.*]] = sub i64 [[TMP15]], [[TMP16]]
1793 // CHECK1-NEXT: [[TMP18:%.*]] = sdiv exact i64 [[TMP17]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
1794 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr [[STRUCT_S]], ptr [[VLA]], i64 [[TMP18]]
1795 // CHECK1-NEXT: store ptr [[_TMP5]], ptr [[_TMP4]], align 8
1796 // CHECK1-NEXT: store ptr [[TMP19]], ptr [[_TMP5]], align 8
1797 // CHECK1-NEXT: [[TMP20:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1798 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP20]], align 4
1799 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP21]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1800 // CHECK1-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1801 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP22]], 9
1802 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1803 // CHECK1: cond.true:
1804 // CHECK1-NEXT: br label [[COND_END:%.*]]
1805 // CHECK1: cond.false:
1806 // CHECK1-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1807 // CHECK1-NEXT: br label [[COND_END]]
1808 // CHECK1: cond.end:
1809 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP23]], [[COND_FALSE]] ]
1810 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1811 // CHECK1-NEXT: [[TMP24:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1812 // CHECK1-NEXT: store i32 [[TMP24]], ptr [[DOTOMP_IV]], align 4
1813 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1814 // CHECK1: omp.inner.for.cond:
1815 // CHECK1-NEXT: [[TMP25:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1816 // CHECK1-NEXT: [[TMP26:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1817 // CHECK1-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP25]], [[TMP26]]
1818 // CHECK1-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
1819 // CHECK1: omp.inner.for.cond.cleanup:
1820 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
1821 // CHECK1: omp.inner.for.body:
1822 // CHECK1-NEXT: [[TMP27:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1823 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP27]], 1
1824 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1825 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1826 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1827 // CHECK1: omp.body.continue:
1828 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1829 // CHECK1: omp.inner.for.inc:
1830 // CHECK1-NEXT: [[TMP28:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1831 // CHECK1-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP28]], 1
1832 // CHECK1-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4
1833 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1834 // CHECK1: omp.inner.for.end:
1835 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1836 // CHECK1: omp.loop.exit:
1837 // CHECK1-NEXT: [[TMP29:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1838 // CHECK1-NEXT: [[TMP30:%.*]] = load i32, ptr [[TMP29]], align 4
1839 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP30]])
1840 // CHECK1-NEXT: [[TMP31:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
1841 // CHECK1-NEXT: store ptr [[VLA]], ptr [[TMP31]], align 8
1842 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
1843 // CHECK1-NEXT: [[TMP33:%.*]] = inttoptr i64 [[TMP9]] to ptr
1844 // CHECK1-NEXT: store ptr [[TMP33]], ptr [[TMP32]], align 8
1845 // CHECK1-NEXT: [[TMP34:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1846 // CHECK1-NEXT: [[TMP35:%.*]] = load i32, ptr [[TMP34]], align 4
1847 // CHECK1-NEXT: [[TMP36:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2]], i32 [[TMP35]], i32 1, i64 16, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @main.omp_outlined.4.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
1848 // CHECK1-NEXT: switch i32 [[TMP36]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
1849 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
1850 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
1851 // CHECK1-NEXT: ]
1852 // CHECK1: .omp.reduction.case1:
1853 // CHECK1-NEXT: [[TMP37:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX1]], i64 [[TMP9]]
1854 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAYIDX1]], [[TMP37]]
1855 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE11:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1856 // CHECK1: omp.arraycpy.body:
1857 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[VLA]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1858 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST8:%.*]] = phi ptr [ [[ARRAYIDX1]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT9:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1859 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST8]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
1860 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST8]], ptr align 4 [[CALL]], i64 4, i1 false)
1861 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT9]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST8]], i32 1
1862 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1863 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE10:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT9]], [[TMP37]]
1864 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE10]], label [[OMP_ARRAYCPY_DONE11]], label [[OMP_ARRAYCPY_BODY]]
1865 // CHECK1: omp.arraycpy.done11:
1866 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP35]], ptr @.gomp_critical_user_.reduction.var)
1867 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
1868 // CHECK1: .omp.reduction.case2:
1869 // CHECK1-NEXT: [[TMP38:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX1]], i64 [[TMP9]]
1870 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY12:%.*]] = icmp eq ptr [[ARRAYIDX1]], [[TMP38]]
1871 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY12]], label [[OMP_ARRAYCPY_DONE20:%.*]], label [[OMP_ARRAYCPY_BODY13:%.*]]
1872 // CHECK1: omp.arraycpy.body13:
1873 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST14:%.*]] = phi ptr [ [[VLA]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT18:%.*]], [[OMP_ARRAYCPY_BODY13]] ]
1874 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST15:%.*]] = phi ptr [ [[ARRAYIDX1]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT17:%.*]], [[OMP_ARRAYCPY_BODY13]] ]
1875 // CHECK1-NEXT: [[TMP39:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1876 // CHECK1-NEXT: [[TMP40:%.*]] = load i32, ptr [[TMP39]], align 4
1877 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP40]], ptr @.gomp_critical_user_.atomic_reduction.var)
1878 // CHECK1-NEXT: [[CALL16:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST15]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST14]])
1879 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST15]], ptr align 4 [[CALL16]], i64 4, i1 false)
1880 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP40]], ptr @.gomp_critical_user_.atomic_reduction.var)
1881 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT17]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST15]], i32 1
1882 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT18]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST14]], i32 1
1883 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE19:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT17]], [[TMP38]]
1884 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE19]], label [[OMP_ARRAYCPY_DONE20]], label [[OMP_ARRAYCPY_BODY13]]
1885 // CHECK1: omp.arraycpy.done20:
1886 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP35]], ptr @.gomp_critical_user_.reduction.var)
1887 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
1888 // CHECK1: .omp.reduction.default:
1889 // CHECK1-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[VLA]], i64 [[TMP9]]
1890 // CHECK1-NEXT: [[ARRAYDESTROY_ISEMPTY:%.*]] = icmp eq ptr [[VLA]], [[TMP41]]
1891 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_ISEMPTY]], label [[ARRAYDESTROY_DONE21:%.*]], label [[ARRAYDESTROY_BODY:%.*]]
1892 // CHECK1: arraydestroy.body:
1893 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP41]], [[DOTOMP_REDUCTION_DEFAULT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
1894 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
1895 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR5]]
1896 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[VLA]]
1897 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE21]], label [[ARRAYDESTROY_BODY]]
1898 // CHECK1: arraydestroy.done21:
1899 // CHECK1-NEXT: [[TMP42:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
1900 // CHECK1-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP42]])
1901 // CHECK1-NEXT: [[TMP43:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1902 // CHECK1-NEXT: [[TMP44:%.*]] = load i32, ptr [[TMP43]], align 4
1903 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4]], i32 [[TMP44]])
1904 // CHECK1-NEXT: ret void
1907 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.4.omp.reduction.reduction_func
1908 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
1909 // CHECK1-NEXT: entry:
1910 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
1911 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
1912 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
1913 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
1914 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
1915 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
1916 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i64 0, i64 0
1917 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
1918 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP2]], i64 0, i64 0
1919 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
1920 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP2]], i64 0, i64 1
1921 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 8
1922 // CHECK1-NEXT: [[TMP10:%.*]] = ptrtoint ptr [[TMP9]] to i64
1923 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[TMP7]], i64 [[TMP10]]
1924 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP7]], [[TMP11]]
1925 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE2:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1926 // CHECK1: omp.arraycpy.body:
1927 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP5]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1928 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[TMP7]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1929 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
1930 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr align 4 [[CALL]], i64 4, i1 false)
1931 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1932 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1933 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP11]]
1934 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE2]], label [[OMP_ARRAYCPY_BODY]]
1935 // CHECK1: omp.arraycpy.done2:
1936 // CHECK1-NEXT: ret void
1939 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.5
1940 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[VAR2:%.*]]) #[[ATTR4]] {
1941 // CHECK1-NEXT: entry:
1942 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1943 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1944 // CHECK1-NEXT: [[VAR2_ADDR:%.*]] = alloca ptr, align 8
1945 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1946 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1947 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1948 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1949 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1950 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1951 // CHECK1-NEXT: [[VAR24:%.*]] = alloca [1 x [6 x %struct.S]], align 16
1952 // CHECK1-NEXT: [[_TMP5:%.*]] = alloca ptr, align 8
1953 // CHECK1-NEXT: [[_TMP6:%.*]] = alloca ptr, align 8
1954 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1955 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8
1956 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1957 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1958 // CHECK1-NEXT: store ptr [[VAR2]], ptr [[VAR2_ADDR]], align 8
1959 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR2_ADDR]], align 8
1960 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1961 // CHECK1-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
1962 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1963 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1964 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP0]], align 8
1965 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds ptr, ptr [[TMP1]], i64 1
1966 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[ARRAYIDX]], align 8
1967 // CHECK1-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[TMP2]], i64 1
1968 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP0]], align 8
1969 // CHECK1-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds ptr, ptr [[TMP3]], i64 1
1970 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[ARRAYIDX2]], align 8
1971 // CHECK1-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[TMP4]], i64 6
1972 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [1 x [6 x %struct.S]], ptr [[VAR24]], i32 0, i32 0, i32 0
1973 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i64 6
1974 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP5]]
1975 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
1976 // CHECK1: omp.arrayinit.body:
1977 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
1978 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]])
1979 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1980 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP5]]
1981 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
1982 // CHECK1: omp.arrayinit.done:
1983 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[TMP0]], align 8
1984 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
1985 // CHECK1-NEXT: [[TMP8:%.*]] = ptrtoint ptr [[TMP7]] to i64
1986 // CHECK1-NEXT: [[TMP9:%.*]] = ptrtoint ptr [[ARRAYIDX1]] to i64
1987 // CHECK1-NEXT: [[TMP10:%.*]] = sub i64 [[TMP8]], [[TMP9]]
1988 // CHECK1-NEXT: [[TMP11:%.*]] = sdiv exact i64 [[TMP10]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
1989 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr [[STRUCT_S]], ptr [[VAR24]], i64 [[TMP11]]
1990 // CHECK1-NEXT: store ptr [[_TMP6]], ptr [[_TMP5]], align 8
1991 // CHECK1-NEXT: store ptr [[TMP12]], ptr [[_TMP6]], align 8
1992 // CHECK1-NEXT: [[TMP13:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1993 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP13]], align 4
1994 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP14]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1995 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1996 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP15]], 9
1997 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1998 // CHECK1: cond.true:
1999 // CHECK1-NEXT: br label [[COND_END:%.*]]
2000 // CHECK1: cond.false:
2001 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2002 // CHECK1-NEXT: br label [[COND_END]]
2003 // CHECK1: cond.end:
2004 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP16]], [[COND_FALSE]] ]
2005 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2006 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2007 // CHECK1-NEXT: store i32 [[TMP17]], ptr [[DOTOMP_IV]], align 4
2008 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2009 // CHECK1: omp.inner.for.cond:
2010 // CHECK1-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2011 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2012 // CHECK1-NEXT: [[CMP7:%.*]] = icmp sle i32 [[TMP18]], [[TMP19]]
2013 // CHECK1-NEXT: br i1 [[CMP7]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
2014 // CHECK1: omp.inner.for.cond.cleanup:
2015 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
2016 // CHECK1: omp.inner.for.body:
2017 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2018 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP20]], 1
2019 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2020 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2021 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2022 // CHECK1: omp.body.continue:
2023 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2024 // CHECK1: omp.inner.for.inc:
2025 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2026 // CHECK1-NEXT: [[ADD8:%.*]] = add nsw i32 [[TMP21]], 1
2027 // CHECK1-NEXT: store i32 [[ADD8]], ptr [[DOTOMP_IV]], align 4
2028 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
2029 // CHECK1: omp.inner.for.end:
2030 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2031 // CHECK1: omp.loop.exit:
2032 // CHECK1-NEXT: [[TMP22:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2033 // CHECK1-NEXT: [[TMP23:%.*]] = load i32, ptr [[TMP22]], align 4
2034 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP23]])
2035 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
2036 // CHECK1-NEXT: store ptr [[VAR24]], ptr [[TMP24]], align 8
2037 // CHECK1-NEXT: [[TMP25:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2038 // CHECK1-NEXT: [[TMP26:%.*]] = load i32, ptr [[TMP25]], align 4
2039 // CHECK1-NEXT: [[TMP27:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2]], i32 [[TMP26]], i32 1, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @main.omp_outlined.5.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
2040 // CHECK1-NEXT: switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
2041 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
2042 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
2043 // CHECK1-NEXT: ]
2044 // CHECK1: .omp.reduction.case1:
2045 // CHECK1-NEXT: [[TMP28:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX1]], i64 6
2046 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAYIDX1]], [[TMP28]]
2047 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE12:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
2048 // CHECK1: omp.arraycpy.body:
2049 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[VAR24]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2050 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST9:%.*]] = phi ptr [ [[ARRAYIDX1]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT10:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2051 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST9]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
2052 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST9]], ptr align 4 [[CALL]], i64 4, i1 false)
2053 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT10]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST9]], i32 1
2054 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
2055 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE11:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT10]], [[TMP28]]
2056 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE11]], label [[OMP_ARRAYCPY_DONE12]], label [[OMP_ARRAYCPY_BODY]]
2057 // CHECK1: omp.arraycpy.done12:
2058 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP26]], ptr @.gomp_critical_user_.reduction.var)
2059 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
2060 // CHECK1: .omp.reduction.case2:
2061 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX1]], i64 6
2062 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY13:%.*]] = icmp eq ptr [[ARRAYIDX1]], [[TMP29]]
2063 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY13]], label [[OMP_ARRAYCPY_DONE21:%.*]], label [[OMP_ARRAYCPY_BODY14:%.*]]
2064 // CHECK1: omp.arraycpy.body14:
2065 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST15:%.*]] = phi ptr [ [[VAR24]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT19:%.*]], [[OMP_ARRAYCPY_BODY14]] ]
2066 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST16:%.*]] = phi ptr [ [[ARRAYIDX1]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT18:%.*]], [[OMP_ARRAYCPY_BODY14]] ]
2067 // CHECK1-NEXT: [[TMP30:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2068 // CHECK1-NEXT: [[TMP31:%.*]] = load i32, ptr [[TMP30]], align 4
2069 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP31]], ptr @.gomp_critical_user_.atomic_reduction.var)
2070 // CHECK1-NEXT: [[CALL17:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST16]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST15]])
2071 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST16]], ptr align 4 [[CALL17]], i64 4, i1 false)
2072 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP31]], ptr @.gomp_critical_user_.atomic_reduction.var)
2073 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT18]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST16]], i32 1
2074 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT19]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST15]], i32 1
2075 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE20:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT18]], [[TMP29]]
2076 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE20]], label [[OMP_ARRAYCPY_DONE21]], label [[OMP_ARRAYCPY_BODY14]]
2077 // CHECK1: omp.arraycpy.done21:
2078 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP26]], ptr @.gomp_critical_user_.reduction.var)
2079 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
2080 // CHECK1: .omp.reduction.default:
2081 // CHECK1-NEXT: [[ARRAY_BEGIN22:%.*]] = getelementptr inbounds [1 x [6 x %struct.S]], ptr [[VAR24]], i32 0, i32 0, i32 0
2082 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN22]], i64 6
2083 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
2084 // CHECK1: arraydestroy.body:
2085 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP32]], [[DOTOMP_REDUCTION_DEFAULT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
2086 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
2087 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR5]]
2088 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN22]]
2089 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE23:%.*]], label [[ARRAYDESTROY_BODY]]
2090 // CHECK1: arraydestroy.done23:
2091 // CHECK1-NEXT: [[TMP33:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2092 // CHECK1-NEXT: [[TMP34:%.*]] = load i32, ptr [[TMP33]], align 4
2093 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4]], i32 [[TMP34]])
2094 // CHECK1-NEXT: ret void
2097 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.5.omp.reduction.reduction_func
2098 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
2099 // CHECK1-NEXT: entry:
2100 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
2101 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
2102 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
2103 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
2104 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
2105 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
2106 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i64 0, i64 0
2107 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
2108 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP2]], i64 0, i64 0
2109 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
2110 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[TMP7]], i64 6
2111 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP7]], [[TMP8]]
2112 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE2:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
2113 // CHECK1: omp.arraycpy.body:
2114 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP5]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2115 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[TMP7]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2116 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
2117 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr align 4 [[CALL]], i64 4, i1 false)
2118 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
2119 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
2120 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP8]]
2121 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE2]], label [[OMP_ARRAYCPY_BODY]]
2122 // CHECK1: omp.arraycpy.done2:
2123 // CHECK1-NEXT: ret void
2126 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.6
2127 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[VAR2:%.*]]) #[[ATTR4]] {
2128 // CHECK1-NEXT: entry:
2129 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2130 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2131 // CHECK1-NEXT: [[VAR2_ADDR:%.*]] = alloca ptr, align 8
2132 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2133 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
2134 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2135 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2136 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2137 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2138 // CHECK1-NEXT: [[VAR24:%.*]] = alloca [1 x [6 x %struct.S]], align 16
2139 // CHECK1-NEXT: [[_TMP5:%.*]] = alloca ptr, align 8
2140 // CHECK1-NEXT: [[_TMP6:%.*]] = alloca ptr, align 8
2141 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
2142 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8
2143 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2144 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2145 // CHECK1-NEXT: store ptr [[VAR2]], ptr [[VAR2_ADDR]], align 8
2146 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR2_ADDR]], align 8
2147 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2148 // CHECK1-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
2149 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2150 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2151 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP0]], align 8
2152 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds ptr, ptr [[TMP1]], i64 1
2153 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[ARRAYIDX]], align 8
2154 // CHECK1-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[TMP2]], i64 1
2155 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP0]], align 8
2156 // CHECK1-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds ptr, ptr [[TMP3]], i64 1
2157 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[ARRAYIDX2]], align 8
2158 // CHECK1-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[TMP4]], i64 6
2159 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [1 x [6 x %struct.S]], ptr [[VAR24]], i32 0, i32 0, i32 0
2160 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAY_BEGIN]], i64 6
2161 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP5]]
2162 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
2163 // CHECK1: omp.arrayinit.body:
2164 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
2165 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]])
2166 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
2167 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP5]]
2168 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
2169 // CHECK1: omp.arrayinit.done:
2170 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[TMP0]], align 8
2171 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
2172 // CHECK1-NEXT: [[TMP8:%.*]] = ptrtoint ptr [[TMP7]] to i64
2173 // CHECK1-NEXT: [[TMP9:%.*]] = ptrtoint ptr [[ARRAYIDX1]] to i64
2174 // CHECK1-NEXT: [[TMP10:%.*]] = sub i64 [[TMP8]], [[TMP9]]
2175 // CHECK1-NEXT: [[TMP11:%.*]] = sdiv exact i64 [[TMP10]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
2176 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr [[STRUCT_S]], ptr [[VAR24]], i64 [[TMP11]]
2177 // CHECK1-NEXT: store ptr [[_TMP6]], ptr [[_TMP5]], align 8
2178 // CHECK1-NEXT: store ptr [[TMP12]], ptr [[_TMP6]], align 8
2179 // CHECK1-NEXT: [[TMP13:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2180 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP13]], align 4
2181 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP14]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2182 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2183 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP15]], 9
2184 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2185 // CHECK1: cond.true:
2186 // CHECK1-NEXT: br label [[COND_END:%.*]]
2187 // CHECK1: cond.false:
2188 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2189 // CHECK1-NEXT: br label [[COND_END]]
2190 // CHECK1: cond.end:
2191 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP16]], [[COND_FALSE]] ]
2192 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2193 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2194 // CHECK1-NEXT: store i32 [[TMP17]], ptr [[DOTOMP_IV]], align 4
2195 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2196 // CHECK1: omp.inner.for.cond:
2197 // CHECK1-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2198 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2199 // CHECK1-NEXT: [[CMP7:%.*]] = icmp sle i32 [[TMP18]], [[TMP19]]
2200 // CHECK1-NEXT: br i1 [[CMP7]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
2201 // CHECK1: omp.inner.for.cond.cleanup:
2202 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
2203 // CHECK1: omp.inner.for.body:
2204 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2205 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP20]], 1
2206 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2207 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2208 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2209 // CHECK1: omp.body.continue:
2210 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2211 // CHECK1: omp.inner.for.inc:
2212 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2213 // CHECK1-NEXT: [[ADD8:%.*]] = add nsw i32 [[TMP21]], 1
2214 // CHECK1-NEXT: store i32 [[ADD8]], ptr [[DOTOMP_IV]], align 4
2215 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
2216 // CHECK1: omp.inner.for.end:
2217 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2218 // CHECK1: omp.loop.exit:
2219 // CHECK1-NEXT: [[TMP22:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2220 // CHECK1-NEXT: [[TMP23:%.*]] = load i32, ptr [[TMP22]], align 4
2221 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP23]])
2222 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
2223 // CHECK1-NEXT: store ptr [[VAR24]], ptr [[TMP24]], align 8
2224 // CHECK1-NEXT: [[TMP25:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2225 // CHECK1-NEXT: [[TMP26:%.*]] = load i32, ptr [[TMP25]], align 4
2226 // CHECK1-NEXT: [[TMP27:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2]], i32 [[TMP26]], i32 1, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @main.omp_outlined.6.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
2227 // CHECK1-NEXT: switch i32 [[TMP27]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
2228 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
2229 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
2230 // CHECK1-NEXT: ]
2231 // CHECK1: .omp.reduction.case1:
2232 // CHECK1-NEXT: [[TMP28:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX1]], i64 6
2233 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAYIDX1]], [[TMP28]]
2234 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE12:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
2235 // CHECK1: omp.arraycpy.body:
2236 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[VAR24]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2237 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST9:%.*]] = phi ptr [ [[ARRAYIDX1]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT10:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2238 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST9]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
2239 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST9]], ptr align 4 [[CALL]], i64 4, i1 false)
2240 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT10]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST9]], i32 1
2241 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
2242 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE11:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT10]], [[TMP28]]
2243 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE11]], label [[OMP_ARRAYCPY_DONE12]], label [[OMP_ARRAYCPY_BODY]]
2244 // CHECK1: omp.arraycpy.done12:
2245 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP26]], ptr @.gomp_critical_user_.reduction.var)
2246 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
2247 // CHECK1: .omp.reduction.case2:
2248 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX1]], i64 6
2249 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY13:%.*]] = icmp eq ptr [[ARRAYIDX1]], [[TMP29]]
2250 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY13]], label [[OMP_ARRAYCPY_DONE21:%.*]], label [[OMP_ARRAYCPY_BODY14:%.*]]
2251 // CHECK1: omp.arraycpy.body14:
2252 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST15:%.*]] = phi ptr [ [[VAR24]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT19:%.*]], [[OMP_ARRAYCPY_BODY14]] ]
2253 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST16:%.*]] = phi ptr [ [[ARRAYIDX1]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT18:%.*]], [[OMP_ARRAYCPY_BODY14]] ]
2254 // CHECK1-NEXT: [[TMP30:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2255 // CHECK1-NEXT: [[TMP31:%.*]] = load i32, ptr [[TMP30]], align 4
2256 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP31]], ptr @.gomp_critical_user_.atomic_reduction.var)
2257 // CHECK1-NEXT: [[CALL17:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST16]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST15]])
2258 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST16]], ptr align 4 [[CALL17]], i64 4, i1 false)
2259 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP31]], ptr @.gomp_critical_user_.atomic_reduction.var)
2260 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT18]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST16]], i32 1
2261 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT19]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST15]], i32 1
2262 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE20:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT18]], [[TMP29]]
2263 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE20]], label [[OMP_ARRAYCPY_DONE21]], label [[OMP_ARRAYCPY_BODY14]]
2264 // CHECK1: omp.arraycpy.done21:
2265 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP26]], ptr @.gomp_critical_user_.reduction.var)
2266 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
2267 // CHECK1: .omp.reduction.default:
2268 // CHECK1-NEXT: [[ARRAY_BEGIN22:%.*]] = getelementptr inbounds [1 x [6 x %struct.S]], ptr [[VAR24]], i32 0, i32 0, i32 0
2269 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN22]], i64 6
2270 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
2271 // CHECK1: arraydestroy.body:
2272 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP32]], [[DOTOMP_REDUCTION_DEFAULT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
2273 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
2274 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR5]]
2275 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN22]]
2276 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE23:%.*]], label [[ARRAYDESTROY_BODY]]
2277 // CHECK1: arraydestroy.done23:
2278 // CHECK1-NEXT: [[TMP33:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2279 // CHECK1-NEXT: [[TMP34:%.*]] = load i32, ptr [[TMP33]], align 4
2280 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4]], i32 [[TMP34]])
2281 // CHECK1-NEXT: ret void
2284 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.6.omp.reduction.reduction_func
2285 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
2286 // CHECK1-NEXT: entry:
2287 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
2288 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
2289 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
2290 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
2291 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
2292 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
2293 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i64 0, i64 0
2294 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
2295 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP2]], i64 0, i64 0
2296 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
2297 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[TMP7]], i64 6
2298 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP7]], [[TMP8]]
2299 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE2:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
2300 // CHECK1: omp.arraycpy.body:
2301 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP5]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2302 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[TMP7]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2303 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
2304 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr align 4 [[CALL]], i64 4, i1 false)
2305 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
2306 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
2307 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP8]]
2308 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE2]], label [[OMP_ARRAYCPY_BODY]]
2309 // CHECK1: omp.arraycpy.done2:
2310 // CHECK1-NEXT: ret void
2313 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.7
2314 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[VAR2:%.*]]) #[[ATTR4]] {
2315 // CHECK1-NEXT: entry:
2316 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2317 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2318 // CHECK1-NEXT: [[VAR2_ADDR:%.*]] = alloca ptr, align 8
2319 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2320 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
2321 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2322 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2323 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2324 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2325 // CHECK1-NEXT: [[VAR24:%.*]] = alloca [[STRUCT_S:%.*]], align 4
2326 // CHECK1-NEXT: [[_TMP5:%.*]] = alloca ptr, align 8
2327 // CHECK1-NEXT: [[_TMP6:%.*]] = alloca ptr, align 8
2328 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
2329 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8
2330 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2331 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2332 // CHECK1-NEXT: store ptr [[VAR2]], ptr [[VAR2_ADDR]], align 8
2333 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR2_ADDR]], align 8
2334 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2335 // CHECK1-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
2336 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2337 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2338 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP0]], align 8
2339 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds ptr, ptr [[TMP1]], i64 1
2340 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[ARRAYIDX]], align 8
2341 // CHECK1-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[TMP2]], i64 1
2342 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP0]], align 8
2343 // CHECK1-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds ptr, ptr [[TMP3]], i64 1
2344 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[ARRAYIDX2]], align 8
2345 // CHECK1-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[TMP4]], i64 1
2346 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR24]])
2347 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP0]], align 8
2348 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[TMP5]], align 8
2349 // CHECK1-NEXT: [[TMP7:%.*]] = ptrtoint ptr [[TMP6]] to i64
2350 // CHECK1-NEXT: [[TMP8:%.*]] = ptrtoint ptr [[ARRAYIDX1]] to i64
2351 // CHECK1-NEXT: [[TMP9:%.*]] = sub i64 [[TMP7]], [[TMP8]]
2352 // CHECK1-NEXT: [[TMP10:%.*]] = sdiv exact i64 [[TMP9]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
2353 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr [[STRUCT_S]], ptr [[VAR24]], i64 [[TMP10]]
2354 // CHECK1-NEXT: store ptr [[_TMP6]], ptr [[_TMP5]], align 8
2355 // CHECK1-NEXT: store ptr [[TMP11]], ptr [[_TMP6]], align 8
2356 // CHECK1-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2357 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP12]], align 4
2358 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP13]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2359 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2360 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP14]], 9
2361 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2362 // CHECK1: cond.true:
2363 // CHECK1-NEXT: br label [[COND_END:%.*]]
2364 // CHECK1: cond.false:
2365 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2366 // CHECK1-NEXT: br label [[COND_END]]
2367 // CHECK1: cond.end:
2368 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP15]], [[COND_FALSE]] ]
2369 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2370 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2371 // CHECK1-NEXT: store i32 [[TMP16]], ptr [[DOTOMP_IV]], align 4
2372 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2373 // CHECK1: omp.inner.for.cond:
2374 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2375 // CHECK1-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2376 // CHECK1-NEXT: [[CMP7:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
2377 // CHECK1-NEXT: br i1 [[CMP7]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
2378 // CHECK1: omp.inner.for.cond.cleanup:
2379 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
2380 // CHECK1: omp.inner.for.body:
2381 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2382 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP19]], 1
2383 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2384 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2385 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2386 // CHECK1: omp.body.continue:
2387 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2388 // CHECK1: omp.inner.for.inc:
2389 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2390 // CHECK1-NEXT: [[ADD8:%.*]] = add nsw i32 [[TMP20]], 1
2391 // CHECK1-NEXT: store i32 [[ADD8]], ptr [[DOTOMP_IV]], align 4
2392 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
2393 // CHECK1: omp.inner.for.end:
2394 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2395 // CHECK1: omp.loop.exit:
2396 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP13]])
2397 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
2398 // CHECK1-NEXT: store ptr [[VAR24]], ptr [[TMP21]], align 8
2399 // CHECK1-NEXT: [[TMP22:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2]], i32 [[TMP13]], i32 1, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @main.omp_outlined.7.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
2400 // CHECK1-NEXT: switch i32 [[TMP22]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
2401 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
2402 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
2403 // CHECK1-NEXT: ]
2404 // CHECK1: .omp.reduction.case1:
2405 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYIDX1]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR24]])
2406 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX1]], ptr align 4 [[CALL]], i64 4, i1 false)
2407 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP13]], ptr @.gomp_critical_user_.reduction.var)
2408 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
2409 // CHECK1: .omp.reduction.case2:
2410 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP13]], ptr @.gomp_critical_user_.atomic_reduction.var)
2411 // CHECK1-NEXT: [[CALL9:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYIDX1]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR24]])
2412 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX1]], ptr align 4 [[CALL9]], i64 4, i1 false)
2413 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP13]], ptr @.gomp_critical_user_.atomic_reduction.var)
2414 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP13]], ptr @.gomp_critical_user_.reduction.var)
2415 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
2416 // CHECK1: .omp.reduction.default:
2417 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR24]]) #[[ATTR5]]
2418 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4]], i32 [[TMP13]])
2419 // CHECK1-NEXT: ret void
2422 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.7.omp.reduction.reduction_func
2423 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
2424 // CHECK1-NEXT: entry:
2425 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
2426 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
2427 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
2428 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
2429 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
2430 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
2431 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i64 0, i64 0
2432 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
2433 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP2]], i64 0, i64 0
2434 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
2435 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[TMP7]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP5]])
2436 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP7]], ptr align 4 [[CALL]], i64 4, i1 false)
2437 // CHECK1-NEXT: ret void
2440 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.8
2441 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(20) [[VVAR2:%.*]]) #[[ATTR4]] {
2442 // CHECK1-NEXT: entry:
2443 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2444 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2445 // CHECK1-NEXT: [[VVAR2_ADDR:%.*]] = alloca ptr, align 8
2446 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2447 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
2448 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2449 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2450 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2451 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2452 // CHECK1-NEXT: [[VVAR22:%.*]] = alloca [5 x %struct.S], align 16
2453 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
2454 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8
2455 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2456 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2457 // CHECK1-NEXT: store ptr [[VVAR2]], ptr [[VVAR2_ADDR]], align 8
2458 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VVAR2_ADDR]], align 8
2459 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2460 // CHECK1-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
2461 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2462 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2463 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [5 x %struct.S], ptr [[TMP0]], i64 0, i64 0
2464 // CHECK1-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [5 x %struct.S], ptr [[TMP0]], i64 0, i64 4
2465 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [5 x %struct.S], ptr [[VVAR22]], i32 0, i32 0
2466 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[ARRAY_BEGIN]], i64 5
2467 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP1]]
2468 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
2469 // CHECK1: omp.arrayinit.body:
2470 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
2471 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]])
2472 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
2473 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP1]]
2474 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
2475 // CHECK1: omp.arrayinit.done:
2476 // CHECK1-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[TMP0]] to i64
2477 // CHECK1-NEXT: [[TMP3:%.*]] = ptrtoint ptr [[ARRAYIDX]] to i64
2478 // CHECK1-NEXT: [[TMP4:%.*]] = sub i64 [[TMP2]], [[TMP3]]
2479 // CHECK1-NEXT: [[TMP5:%.*]] = sdiv exact i64 [[TMP4]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
2480 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr [[STRUCT_S]], ptr [[VVAR22]], i64 [[TMP5]]
2481 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2482 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
2483 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP8]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2484 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2485 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP9]], 9
2486 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2487 // CHECK1: cond.true:
2488 // CHECK1-NEXT: br label [[COND_END:%.*]]
2489 // CHECK1: cond.false:
2490 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2491 // CHECK1-NEXT: br label [[COND_END]]
2492 // CHECK1: cond.end:
2493 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP10]], [[COND_FALSE]] ]
2494 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2495 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2496 // CHECK1-NEXT: store i32 [[TMP11]], ptr [[DOTOMP_IV]], align 4
2497 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2498 // CHECK1: omp.inner.for.cond:
2499 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2500 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2501 // CHECK1-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP12]], [[TMP13]]
2502 // CHECK1-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
2503 // CHECK1: omp.inner.for.cond.cleanup:
2504 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
2505 // CHECK1: omp.inner.for.body:
2506 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2507 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP14]], 1
2508 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2509 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2510 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2511 // CHECK1: omp.body.continue:
2512 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2513 // CHECK1: omp.inner.for.inc:
2514 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2515 // CHECK1-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP15]], 1
2516 // CHECK1-NEXT: store i32 [[ADD4]], ptr [[DOTOMP_IV]], align 4
2517 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
2518 // CHECK1: omp.inner.for.end:
2519 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2520 // CHECK1: omp.loop.exit:
2521 // CHECK1-NEXT: [[TMP16:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2522 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[TMP16]], align 4
2523 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP17]])
2524 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
2525 // CHECK1-NEXT: store ptr [[VVAR22]], ptr [[TMP18]], align 8
2526 // CHECK1-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2527 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
2528 // CHECK1-NEXT: [[TMP21:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2]], i32 [[TMP20]], i32 1, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @main.omp_outlined.8.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
2529 // CHECK1-NEXT: switch i32 [[TMP21]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
2530 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
2531 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
2532 // CHECK1-NEXT: ]
2533 // CHECK1: .omp.reduction.case1:
2534 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX]], i64 5
2535 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAYIDX]], [[TMP22]]
2536 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE8:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
2537 // CHECK1: omp.arraycpy.body:
2538 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[VVAR22]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2539 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST5:%.*]] = phi ptr [ [[ARRAYIDX]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT6:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2540 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST5]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
2541 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST5]], ptr align 4 [[CALL]], i64 4, i1 false)
2542 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT6]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST5]], i32 1
2543 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
2544 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE7:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT6]], [[TMP22]]
2545 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE7]], label [[OMP_ARRAYCPY_DONE8]], label [[OMP_ARRAYCPY_BODY]]
2546 // CHECK1: omp.arraycpy.done8:
2547 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP20]], ptr @.gomp_critical_user_.reduction.var)
2548 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
2549 // CHECK1: .omp.reduction.case2:
2550 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX]], i64 5
2551 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY9:%.*]] = icmp eq ptr [[ARRAYIDX]], [[TMP23]]
2552 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY9]], label [[OMP_ARRAYCPY_DONE17:%.*]], label [[OMP_ARRAYCPY_BODY10:%.*]]
2553 // CHECK1: omp.arraycpy.body10:
2554 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST11:%.*]] = phi ptr [ [[VVAR22]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT15:%.*]], [[OMP_ARRAYCPY_BODY10]] ]
2555 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST12:%.*]] = phi ptr [ [[ARRAYIDX]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT14:%.*]], [[OMP_ARRAYCPY_BODY10]] ]
2556 // CHECK1-NEXT: [[TMP24:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2557 // CHECK1-NEXT: [[TMP25:%.*]] = load i32, ptr [[TMP24]], align 4
2558 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP25]], ptr @.gomp_critical_user_.atomic_reduction.var)
2559 // CHECK1-NEXT: [[CALL13:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST12]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST11]])
2560 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST12]], ptr align 4 [[CALL13]], i64 4, i1 false)
2561 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP25]], ptr @.gomp_critical_user_.atomic_reduction.var)
2562 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT14]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST12]], i32 1
2563 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT15]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST11]], i32 1
2564 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE16:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT14]], [[TMP23]]
2565 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE16]], label [[OMP_ARRAYCPY_DONE17]], label [[OMP_ARRAYCPY_BODY10]]
2566 // CHECK1: omp.arraycpy.done17:
2567 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP20]], ptr @.gomp_critical_user_.reduction.var)
2568 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
2569 // CHECK1: .omp.reduction.default:
2570 // CHECK1-NEXT: [[ARRAY_BEGIN18:%.*]] = getelementptr inbounds [5 x %struct.S], ptr [[VVAR22]], i32 0, i32 0
2571 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN18]], i64 5
2572 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
2573 // CHECK1: arraydestroy.body:
2574 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP26]], [[DOTOMP_REDUCTION_DEFAULT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
2575 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
2576 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR5]]
2577 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN18]]
2578 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE19:%.*]], label [[ARRAYDESTROY_BODY]]
2579 // CHECK1: arraydestroy.done19:
2580 // CHECK1-NEXT: [[TMP27:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2581 // CHECK1-NEXT: [[TMP28:%.*]] = load i32, ptr [[TMP27]], align 4
2582 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4]], i32 [[TMP28]])
2583 // CHECK1-NEXT: ret void
2586 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.8.omp.reduction.reduction_func
2587 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
2588 // CHECK1-NEXT: entry:
2589 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
2590 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
2591 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
2592 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
2593 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
2594 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
2595 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i64 0, i64 0
2596 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
2597 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP2]], i64 0, i64 0
2598 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
2599 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[TMP7]], i64 5
2600 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP7]], [[TMP8]]
2601 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE2:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
2602 // CHECK1: omp.arraycpy.body:
2603 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP5]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2604 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[TMP7]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2605 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
2606 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr align 4 [[CALL]], i64 4, i1 false)
2607 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
2608 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
2609 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP8]]
2610 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE2]], label [[OMP_ARRAYCPY_BODY]]
2611 // CHECK1: omp.arraycpy.done2:
2612 // CHECK1-NEXT: ret void
2615 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.9
2616 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(16) [[VAR3:%.*]]) #[[ATTR4]] {
2617 // CHECK1-NEXT: entry:
2618 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2619 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2620 // CHECK1-NEXT: [[VAR3_ADDR:%.*]] = alloca ptr, align 8
2621 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
2622 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
2623 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2624 // CHECK1-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
2625 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2626 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2627 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2628 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2629 // CHECK1-NEXT: [[VAR34:%.*]] = alloca [2 x %struct.S], align 4
2630 // CHECK1-NEXT: [[_TMP5:%.*]] = alloca ptr, align 8
2631 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
2632 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8
2633 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2634 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2635 // CHECK1-NEXT: store ptr [[VAR3]], ptr [[VAR3_ADDR]], align 8
2636 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR3_ADDR]], align 8
2637 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[TMP]], align 8
2638 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP]], align 8
2639 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[_TMP1]], align 8
2640 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2641 // CHECK1-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
2642 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2643 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2644 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[_TMP1]], align 8
2645 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [4 x %struct.S], ptr [[TMP2]], i64 0, i64 1
2646 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[_TMP1]], align 8
2647 // CHECK1-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds [4 x %struct.S], ptr [[TMP3]], i64 0, i64 2
2648 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[VAR34]], i32 0, i32 0
2649 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[ARRAY_BEGIN]], i64 2
2650 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP4]]
2651 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
2652 // CHECK1: omp.arrayinit.body:
2653 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
2654 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]])
2655 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
2656 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP4]]
2657 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
2658 // CHECK1: omp.arrayinit.done:
2659 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[_TMP1]], align 8
2660 // CHECK1-NEXT: [[TMP6:%.*]] = ptrtoint ptr [[TMP5]] to i64
2661 // CHECK1-NEXT: [[TMP7:%.*]] = ptrtoint ptr [[ARRAYIDX]] to i64
2662 // CHECK1-NEXT: [[TMP8:%.*]] = sub i64 [[TMP6]], [[TMP7]]
2663 // CHECK1-NEXT: [[TMP9:%.*]] = sdiv exact i64 [[TMP8]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
2664 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr [[STRUCT_S]], ptr [[VAR34]], i64 [[TMP9]]
2665 // CHECK1-NEXT: store ptr [[TMP10]], ptr [[_TMP5]], align 8
2666 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2667 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP11]], align 4
2668 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP12]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2669 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2670 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP13]], 9
2671 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2672 // CHECK1: cond.true:
2673 // CHECK1-NEXT: br label [[COND_END:%.*]]
2674 // CHECK1: cond.false:
2675 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2676 // CHECK1-NEXT: br label [[COND_END]]
2677 // CHECK1: cond.end:
2678 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP14]], [[COND_FALSE]] ]
2679 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2680 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2681 // CHECK1-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_IV]], align 4
2682 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2683 // CHECK1: omp.inner.for.cond:
2684 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2685 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2686 // CHECK1-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP16]], [[TMP17]]
2687 // CHECK1-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
2688 // CHECK1: omp.inner.for.cond.cleanup:
2689 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
2690 // CHECK1: omp.inner.for.body:
2691 // CHECK1-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2692 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP18]], 1
2693 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2694 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2695 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2696 // CHECK1: omp.body.continue:
2697 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2698 // CHECK1: omp.inner.for.inc:
2699 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2700 // CHECK1-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP19]], 1
2701 // CHECK1-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4
2702 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
2703 // CHECK1: omp.inner.for.end:
2704 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2705 // CHECK1: omp.loop.exit:
2706 // CHECK1-NEXT: [[TMP20:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2707 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP20]], align 4
2708 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP21]])
2709 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
2710 // CHECK1-NEXT: store ptr [[VAR34]], ptr [[TMP22]], align 8
2711 // CHECK1-NEXT: [[TMP23:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2712 // CHECK1-NEXT: [[TMP24:%.*]] = load i32, ptr [[TMP23]], align 4
2713 // CHECK1-NEXT: [[TMP25:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2]], i32 [[TMP24]], i32 1, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @main.omp_outlined.9.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
2714 // CHECK1-NEXT: switch i32 [[TMP25]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
2715 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
2716 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
2717 // CHECK1-NEXT: ]
2718 // CHECK1: .omp.reduction.case1:
2719 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX]], i64 2
2720 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAYIDX]], [[TMP26]]
2721 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE11:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
2722 // CHECK1: omp.arraycpy.body:
2723 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[VAR34]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2724 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST8:%.*]] = phi ptr [ [[ARRAYIDX]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT9:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2725 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST8]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
2726 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST8]], ptr align 4 [[CALL]], i64 4, i1 false)
2727 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT9]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST8]], i32 1
2728 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
2729 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE10:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT9]], [[TMP26]]
2730 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE10]], label [[OMP_ARRAYCPY_DONE11]], label [[OMP_ARRAYCPY_BODY]]
2731 // CHECK1: omp.arraycpy.done11:
2732 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP24]], ptr @.gomp_critical_user_.reduction.var)
2733 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
2734 // CHECK1: .omp.reduction.case2:
2735 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX]], i64 2
2736 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY12:%.*]] = icmp eq ptr [[ARRAYIDX]], [[TMP27]]
2737 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY12]], label [[OMP_ARRAYCPY_DONE20:%.*]], label [[OMP_ARRAYCPY_BODY13:%.*]]
2738 // CHECK1: omp.arraycpy.body13:
2739 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST14:%.*]] = phi ptr [ [[VAR34]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT18:%.*]], [[OMP_ARRAYCPY_BODY13]] ]
2740 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST15:%.*]] = phi ptr [ [[ARRAYIDX]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT17:%.*]], [[OMP_ARRAYCPY_BODY13]] ]
2741 // CHECK1-NEXT: [[TMP28:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2742 // CHECK1-NEXT: [[TMP29:%.*]] = load i32, ptr [[TMP28]], align 4
2743 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP29]], ptr @.gomp_critical_user_.atomic_reduction.var)
2744 // CHECK1-NEXT: [[CALL16:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST15]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST14]])
2745 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST15]], ptr align 4 [[CALL16]], i64 4, i1 false)
2746 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP29]], ptr @.gomp_critical_user_.atomic_reduction.var)
2747 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT17]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST15]], i32 1
2748 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT18]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST14]], i32 1
2749 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE19:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT17]], [[TMP27]]
2750 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE19]], label [[OMP_ARRAYCPY_DONE20]], label [[OMP_ARRAYCPY_BODY13]]
2751 // CHECK1: omp.arraycpy.done20:
2752 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP24]], ptr @.gomp_critical_user_.reduction.var)
2753 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
2754 // CHECK1: .omp.reduction.default:
2755 // CHECK1-NEXT: [[ARRAY_BEGIN21:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[VAR34]], i32 0, i32 0
2756 // CHECK1-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN21]], i64 2
2757 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
2758 // CHECK1: arraydestroy.body:
2759 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP30]], [[DOTOMP_REDUCTION_DEFAULT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
2760 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
2761 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR5]]
2762 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN21]]
2763 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE22:%.*]], label [[ARRAYDESTROY_BODY]]
2764 // CHECK1: arraydestroy.done22:
2765 // CHECK1-NEXT: [[TMP31:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2766 // CHECK1-NEXT: [[TMP32:%.*]] = load i32, ptr [[TMP31]], align 4
2767 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4]], i32 [[TMP32]])
2768 // CHECK1-NEXT: ret void
2771 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.9.omp.reduction.reduction_func
2772 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
2773 // CHECK1-NEXT: entry:
2774 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
2775 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
2776 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
2777 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
2778 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
2779 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
2780 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i64 0, i64 0
2781 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
2782 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP2]], i64 0, i64 0
2783 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
2784 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[TMP7]], i64 2
2785 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP7]], [[TMP8]]
2786 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE2:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
2787 // CHECK1: omp.arraycpy.body:
2788 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP5]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2789 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[TMP7]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2790 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
2791 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr align 4 [[CALL]], i64 4, i1 false)
2792 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
2793 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
2794 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP8]]
2795 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE2]], label [[OMP_ARRAYCPY_BODY]]
2796 // CHECK1: omp.arraycpy.done2:
2797 // CHECK1-NEXT: ret void
2800 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.10
2801 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(16) [[VAR3:%.*]]) #[[ATTR4]] {
2802 // CHECK1-NEXT: entry:
2803 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2804 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2805 // CHECK1-NEXT: [[VAR3_ADDR:%.*]] = alloca ptr, align 8
2806 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
2807 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
2808 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2809 // CHECK1-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
2810 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2811 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2812 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2813 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2814 // CHECK1-NEXT: [[VAR34:%.*]] = alloca [2 x %struct.S], align 4
2815 // CHECK1-NEXT: [[_TMP5:%.*]] = alloca ptr, align 8
2816 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
2817 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8
2818 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2819 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2820 // CHECK1-NEXT: store ptr [[VAR3]], ptr [[VAR3_ADDR]], align 8
2821 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR3_ADDR]], align 8
2822 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[TMP]], align 8
2823 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP]], align 8
2824 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[_TMP1]], align 8
2825 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2826 // CHECK1-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
2827 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2828 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2829 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[_TMP1]], align 8
2830 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [4 x %struct.S], ptr [[TMP2]], i64 0, i64 0
2831 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[_TMP1]], align 8
2832 // CHECK1-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds [4 x %struct.S], ptr [[TMP3]], i64 0, i64 1
2833 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[VAR34]], i32 0, i32 0
2834 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[ARRAY_BEGIN]], i64 2
2835 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP4]]
2836 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
2837 // CHECK1: omp.arrayinit.body:
2838 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
2839 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]])
2840 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
2841 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP4]]
2842 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
2843 // CHECK1: omp.arrayinit.done:
2844 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[_TMP1]], align 8
2845 // CHECK1-NEXT: [[TMP6:%.*]] = ptrtoint ptr [[TMP5]] to i64
2846 // CHECK1-NEXT: [[TMP7:%.*]] = ptrtoint ptr [[ARRAYIDX]] to i64
2847 // CHECK1-NEXT: [[TMP8:%.*]] = sub i64 [[TMP6]], [[TMP7]]
2848 // CHECK1-NEXT: [[TMP9:%.*]] = sdiv exact i64 [[TMP8]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
2849 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr [[STRUCT_S]], ptr [[VAR34]], i64 [[TMP9]]
2850 // CHECK1-NEXT: store ptr [[TMP10]], ptr [[_TMP5]], align 8
2851 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2852 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP11]], align 4
2853 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP12]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2854 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2855 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP13]], 9
2856 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2857 // CHECK1: cond.true:
2858 // CHECK1-NEXT: br label [[COND_END:%.*]]
2859 // CHECK1: cond.false:
2860 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2861 // CHECK1-NEXT: br label [[COND_END]]
2862 // CHECK1: cond.end:
2863 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP14]], [[COND_FALSE]] ]
2864 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2865 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2866 // CHECK1-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_IV]], align 4
2867 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2868 // CHECK1: omp.inner.for.cond:
2869 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2870 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2871 // CHECK1-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP16]], [[TMP17]]
2872 // CHECK1-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
2873 // CHECK1: omp.inner.for.cond.cleanup:
2874 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
2875 // CHECK1: omp.inner.for.body:
2876 // CHECK1-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2877 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP18]], 1
2878 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2879 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2880 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2881 // CHECK1: omp.body.continue:
2882 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2883 // CHECK1: omp.inner.for.inc:
2884 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2885 // CHECK1-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP19]], 1
2886 // CHECK1-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4
2887 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
2888 // CHECK1: omp.inner.for.end:
2889 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2890 // CHECK1: omp.loop.exit:
2891 // CHECK1-NEXT: [[TMP20:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2892 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP20]], align 4
2893 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP21]])
2894 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
2895 // CHECK1-NEXT: store ptr [[VAR34]], ptr [[TMP22]], align 8
2896 // CHECK1-NEXT: [[TMP23:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2897 // CHECK1-NEXT: [[TMP24:%.*]] = load i32, ptr [[TMP23]], align 4
2898 // CHECK1-NEXT: [[TMP25:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2]], i32 [[TMP24]], i32 1, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @main.omp_outlined.10.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
2899 // CHECK1-NEXT: switch i32 [[TMP25]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
2900 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
2901 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
2902 // CHECK1-NEXT: ]
2903 // CHECK1: .omp.reduction.case1:
2904 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX]], i64 2
2905 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAYIDX]], [[TMP26]]
2906 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE11:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
2907 // CHECK1: omp.arraycpy.body:
2908 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[VAR34]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2909 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST8:%.*]] = phi ptr [ [[ARRAYIDX]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT9:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2910 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST8]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
2911 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST8]], ptr align 4 [[CALL]], i64 4, i1 false)
2912 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT9]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST8]], i32 1
2913 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
2914 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE10:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT9]], [[TMP26]]
2915 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE10]], label [[OMP_ARRAYCPY_DONE11]], label [[OMP_ARRAYCPY_BODY]]
2916 // CHECK1: omp.arraycpy.done11:
2917 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP24]], ptr @.gomp_critical_user_.reduction.var)
2918 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
2919 // CHECK1: .omp.reduction.case2:
2920 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX]], i64 2
2921 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY12:%.*]] = icmp eq ptr [[ARRAYIDX]], [[TMP27]]
2922 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY12]], label [[OMP_ARRAYCPY_DONE20:%.*]], label [[OMP_ARRAYCPY_BODY13:%.*]]
2923 // CHECK1: omp.arraycpy.body13:
2924 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST14:%.*]] = phi ptr [ [[VAR34]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT18:%.*]], [[OMP_ARRAYCPY_BODY13]] ]
2925 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST15:%.*]] = phi ptr [ [[ARRAYIDX]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT17:%.*]], [[OMP_ARRAYCPY_BODY13]] ]
2926 // CHECK1-NEXT: [[TMP28:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2927 // CHECK1-NEXT: [[TMP29:%.*]] = load i32, ptr [[TMP28]], align 4
2928 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP29]], ptr @.gomp_critical_user_.atomic_reduction.var)
2929 // CHECK1-NEXT: [[CALL16:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST15]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST14]])
2930 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST15]], ptr align 4 [[CALL16]], i64 4, i1 false)
2931 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP29]], ptr @.gomp_critical_user_.atomic_reduction.var)
2932 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT17]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST15]], i32 1
2933 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT18]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST14]], i32 1
2934 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE19:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT17]], [[TMP27]]
2935 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE19]], label [[OMP_ARRAYCPY_DONE20]], label [[OMP_ARRAYCPY_BODY13]]
2936 // CHECK1: omp.arraycpy.done20:
2937 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP24]], ptr @.gomp_critical_user_.reduction.var)
2938 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
2939 // CHECK1: .omp.reduction.default:
2940 // CHECK1-NEXT: [[ARRAY_BEGIN21:%.*]] = getelementptr inbounds [2 x %struct.S], ptr [[VAR34]], i32 0, i32 0
2941 // CHECK1-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN21]], i64 2
2942 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
2943 // CHECK1: arraydestroy.body:
2944 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP30]], [[DOTOMP_REDUCTION_DEFAULT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
2945 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
2946 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR5]]
2947 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN21]]
2948 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE22:%.*]], label [[ARRAYDESTROY_BODY]]
2949 // CHECK1: arraydestroy.done22:
2950 // CHECK1-NEXT: [[TMP31:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2951 // CHECK1-NEXT: [[TMP32:%.*]] = load i32, ptr [[TMP31]], align 4
2952 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4]], i32 [[TMP32]])
2953 // CHECK1-NEXT: ret void
2956 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.10.omp.reduction.reduction_func
2957 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
2958 // CHECK1-NEXT: entry:
2959 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
2960 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
2961 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
2962 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
2963 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
2964 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
2965 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i64 0, i64 0
2966 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
2967 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP2]], i64 0, i64 0
2968 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
2969 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[TMP7]], i64 2
2970 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP7]], [[TMP8]]
2971 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE2:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
2972 // CHECK1: omp.arraycpy.body:
2973 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP5]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2974 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[TMP7]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
2975 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
2976 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr align 4 [[CALL]], i64 4, i1 false)
2977 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
2978 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
2979 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP8]]
2980 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE2]], label [[OMP_ARRAYCPY_BODY]]
2981 // CHECK1: omp.arraycpy.done2:
2982 // CHECK1-NEXT: ret void
2985 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.11
2986 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(16) [[VAR3:%.*]]) #[[ATTR4]] {
2987 // CHECK1-NEXT: entry:
2988 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2989 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2990 // CHECK1-NEXT: [[VAR3_ADDR:%.*]] = alloca ptr, align 8
2991 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
2992 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
2993 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2994 // CHECK1-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
2995 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2996 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2997 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2998 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2999 // CHECK1-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
3000 // CHECK1-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
3001 // CHECK1-NEXT: [[_TMP4:%.*]] = alloca ptr, align 8
3002 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
3003 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 8
3004 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3005 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3006 // CHECK1-NEXT: store ptr [[VAR3]], ptr [[VAR3_ADDR]], align 8
3007 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR3_ADDR]], align 8
3008 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[TMP]], align 8
3009 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP]], align 8
3010 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[_TMP1]], align 8
3011 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3012 // CHECK1-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
3013 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3014 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3015 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[_TMP1]], align 8
3016 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [4 x %struct.S], ptr [[TMP2]], i64 0, i64 2
3017 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[_TMP1]], align 8
3018 // CHECK1-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds [4 x %struct.S], ptr [[TMP3]], i64 0, i64 3
3019 // CHECK1-NEXT: [[TMP4:%.*]] = ptrtoint ptr [[ARRAYIDX3]] to i64
3020 // CHECK1-NEXT: [[TMP5:%.*]] = ptrtoint ptr [[ARRAYIDX]] to i64
3021 // CHECK1-NEXT: [[TMP6:%.*]] = sub i64 [[TMP4]], [[TMP5]]
3022 // CHECK1-NEXT: [[TMP7:%.*]] = sdiv exact i64 [[TMP6]], ptrtoint (ptr getelementptr ([[STRUCT_S:%.*]], ptr null, i32 1) to i64)
3023 // CHECK1-NEXT: [[TMP8:%.*]] = add nuw i64 [[TMP7]], 1
3024 // CHECK1-NEXT: [[TMP9:%.*]] = mul nuw i64 [[TMP8]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
3025 // CHECK1-NEXT: [[TMP10:%.*]] = call ptr @llvm.stacksave.p0()
3026 // CHECK1-NEXT: store ptr [[TMP10]], ptr [[SAVED_STACK]], align 8
3027 // CHECK1-NEXT: [[VLA:%.*]] = alloca [[STRUCT_S]], i64 [[TMP8]], align 16
3028 // CHECK1-NEXT: store i64 [[TMP8]], ptr [[__VLA_EXPR0]], align 8
3029 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr [[STRUCT_S]], ptr [[VLA]], i64 [[TMP8]]
3030 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq ptr [[VLA]], [[TMP11]]
3031 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
3032 // CHECK1: omp.arrayinit.body:
3033 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[VLA]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
3034 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]])
3035 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
3036 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP11]]
3037 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
3038 // CHECK1: omp.arrayinit.done:
3039 // CHECK1-NEXT: [[TMP12:%.*]] = load ptr, ptr [[_TMP1]], align 8
3040 // CHECK1-NEXT: [[TMP13:%.*]] = ptrtoint ptr [[TMP12]] to i64
3041 // CHECK1-NEXT: [[TMP14:%.*]] = ptrtoint ptr [[ARRAYIDX]] to i64
3042 // CHECK1-NEXT: [[TMP15:%.*]] = sub i64 [[TMP13]], [[TMP14]]
3043 // CHECK1-NEXT: [[TMP16:%.*]] = sdiv exact i64 [[TMP15]], ptrtoint (ptr getelementptr ([[STRUCT_S]], ptr null, i32 1) to i64)
3044 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr [[STRUCT_S]], ptr [[VLA]], i64 [[TMP16]]
3045 // CHECK1-NEXT: store ptr [[TMP17]], ptr [[_TMP4]], align 8
3046 // CHECK1-NEXT: [[TMP18:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3047 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP18]], align 4
3048 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP19]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3049 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3050 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP20]], 9
3051 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3052 // CHECK1: cond.true:
3053 // CHECK1-NEXT: br label [[COND_END:%.*]]
3054 // CHECK1: cond.false:
3055 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3056 // CHECK1-NEXT: br label [[COND_END]]
3057 // CHECK1: cond.end:
3058 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP21]], [[COND_FALSE]] ]
3059 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3060 // CHECK1-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3061 // CHECK1-NEXT: store i32 [[TMP22]], ptr [[DOTOMP_IV]], align 4
3062 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3063 // CHECK1: omp.inner.for.cond:
3064 // CHECK1-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3065 // CHECK1-NEXT: [[TMP24:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3066 // CHECK1-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP23]], [[TMP24]]
3067 // CHECK1-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
3068 // CHECK1: omp.inner.for.cond.cleanup:
3069 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
3070 // CHECK1: omp.inner.for.body:
3071 // CHECK1-NEXT: [[TMP25:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3072 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP25]], 1
3073 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3074 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
3075 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3076 // CHECK1: omp.body.continue:
3077 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3078 // CHECK1: omp.inner.for.inc:
3079 // CHECK1-NEXT: [[TMP26:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3080 // CHECK1-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP26]], 1
3081 // CHECK1-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
3082 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
3083 // CHECK1: omp.inner.for.end:
3084 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3085 // CHECK1: omp.loop.exit:
3086 // CHECK1-NEXT: [[TMP27:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3087 // CHECK1-NEXT: [[TMP28:%.*]] = load i32, ptr [[TMP27]], align 4
3088 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP28]])
3089 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
3090 // CHECK1-NEXT: store ptr [[VLA]], ptr [[TMP29]], align 8
3091 // CHECK1-NEXT: [[TMP30:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
3092 // CHECK1-NEXT: [[TMP31:%.*]] = inttoptr i64 [[TMP8]] to ptr
3093 // CHECK1-NEXT: store ptr [[TMP31]], ptr [[TMP30]], align 8
3094 // CHECK1-NEXT: [[TMP32:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3095 // CHECK1-NEXT: [[TMP33:%.*]] = load i32, ptr [[TMP32]], align 4
3096 // CHECK1-NEXT: [[TMP34:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2]], i32 [[TMP33]], i32 1, i64 16, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @main.omp_outlined.11.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
3097 // CHECK1-NEXT: switch i32 [[TMP34]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
3098 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
3099 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
3100 // CHECK1-NEXT: ]
3101 // CHECK1: .omp.reduction.case1:
3102 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX]], i64 [[TMP8]]
3103 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAYIDX]], [[TMP35]]
3104 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE10:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
3105 // CHECK1: omp.arraycpy.body:
3106 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[VLA]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
3107 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST7:%.*]] = phi ptr [ [[ARRAYIDX]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT8:%.*]], [[OMP_ARRAYCPY_BODY]] ]
3108 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST7]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
3109 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST7]], ptr align 4 [[CALL]], i64 4, i1 false)
3110 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT8]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST7]], i32 1
3111 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
3112 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE9:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT8]], [[TMP35]]
3113 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE9]], label [[OMP_ARRAYCPY_DONE10]], label [[OMP_ARRAYCPY_BODY]]
3114 // CHECK1: omp.arraycpy.done10:
3115 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP33]], ptr @.gomp_critical_user_.reduction.var)
3116 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
3117 // CHECK1: .omp.reduction.case2:
3118 // CHECK1-NEXT: [[TMP36:%.*]] = getelementptr [[STRUCT_S]], ptr [[ARRAYIDX]], i64 [[TMP8]]
3119 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY11:%.*]] = icmp eq ptr [[ARRAYIDX]], [[TMP36]]
3120 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY11]], label [[OMP_ARRAYCPY_DONE19:%.*]], label [[OMP_ARRAYCPY_BODY12:%.*]]
3121 // CHECK1: omp.arraycpy.body12:
3122 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST13:%.*]] = phi ptr [ [[VLA]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT17:%.*]], [[OMP_ARRAYCPY_BODY12]] ]
3123 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST14:%.*]] = phi ptr [ [[ARRAYIDX]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT16:%.*]], [[OMP_ARRAYCPY_BODY12]] ]
3124 // CHECK1-NEXT: [[TMP37:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3125 // CHECK1-NEXT: [[TMP38:%.*]] = load i32, ptr [[TMP37]], align 4
3126 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP38]], ptr @.gomp_critical_user_.atomic_reduction.var)
3127 // CHECK1-NEXT: [[CALL15:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST14]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST13]])
3128 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST14]], ptr align 4 [[CALL15]], i64 4, i1 false)
3129 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP38]], ptr @.gomp_critical_user_.atomic_reduction.var)
3130 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT16]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST14]], i32 1
3131 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT17]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST13]], i32 1
3132 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE18:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT16]], [[TMP36]]
3133 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE18]], label [[OMP_ARRAYCPY_DONE19]], label [[OMP_ARRAYCPY_BODY12]]
3134 // CHECK1: omp.arraycpy.done19:
3135 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP33]], ptr @.gomp_critical_user_.reduction.var)
3136 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
3137 // CHECK1: .omp.reduction.default:
3138 // CHECK1-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[VLA]], i64 [[TMP8]]
3139 // CHECK1-NEXT: [[ARRAYDESTROY_ISEMPTY:%.*]] = icmp eq ptr [[VLA]], [[TMP39]]
3140 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_ISEMPTY]], label [[ARRAYDESTROY_DONE20:%.*]], label [[ARRAYDESTROY_BODY:%.*]]
3141 // CHECK1: arraydestroy.body:
3142 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP39]], [[DOTOMP_REDUCTION_DEFAULT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
3143 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
3144 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR5]]
3145 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[VLA]]
3146 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE20]], label [[ARRAYDESTROY_BODY]]
3147 // CHECK1: arraydestroy.done20:
3148 // CHECK1-NEXT: [[TMP40:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
3149 // CHECK1-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP40]])
3150 // CHECK1-NEXT: [[TMP41:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3151 // CHECK1-NEXT: [[TMP42:%.*]] = load i32, ptr [[TMP41]], align 4
3152 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4]], i32 [[TMP42]])
3153 // CHECK1-NEXT: ret void
3156 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.11.omp.reduction.reduction_func
3157 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
3158 // CHECK1-NEXT: entry:
3159 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
3160 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
3161 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
3162 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
3163 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
3164 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
3165 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i64 0, i64 0
3166 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
3167 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP2]], i64 0, i64 0
3168 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
3169 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP2]], i64 0, i64 1
3170 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 8
3171 // CHECK1-NEXT: [[TMP10:%.*]] = ptrtoint ptr [[TMP9]] to i64
3172 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[TMP7]], i64 [[TMP10]]
3173 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP7]], [[TMP11]]
3174 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE2:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
3175 // CHECK1: omp.arraycpy.body:
3176 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP5]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
3177 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[TMP7]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
3178 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
3179 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr align 4 [[CALL]], i64 4, i1 false)
3180 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
3181 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
3182 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP11]]
3183 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE2]], label [[OMP_ARRAYCPY_BODY]]
3184 // CHECK1: omp.arraycpy.done2:
3185 // CHECK1-NEXT: ret void
3188 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.12
3189 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(16) [[VAR3:%.*]]) #[[ATTR4]] {
3190 // CHECK1-NEXT: entry:
3191 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3192 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3193 // CHECK1-NEXT: [[VAR3_ADDR:%.*]] = alloca ptr, align 8
3194 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
3195 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
3196 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3197 // CHECK1-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3198 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3199 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3200 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3201 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3202 // CHECK1-NEXT: [[VAR33:%.*]] = alloca [4 x %struct.S], align 16
3203 // CHECK1-NEXT: [[_TMP4:%.*]] = alloca ptr, align 8
3204 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
3205 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8
3206 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3207 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3208 // CHECK1-NEXT: store ptr [[VAR3]], ptr [[VAR3_ADDR]], align 8
3209 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR3_ADDR]], align 8
3210 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[TMP]], align 8
3211 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP]], align 8
3212 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[_TMP1]], align 8
3213 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3214 // CHECK1-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
3215 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3216 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3217 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[_TMP1]], align 8
3218 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [4 x %struct.S], ptr [[VAR33]], i32 0, i32 0
3219 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[ARRAY_BEGIN]], i64 4
3220 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP3]]
3221 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
3222 // CHECK1: omp.arrayinit.body:
3223 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
3224 // CHECK1-NEXT: call void @_ZN1SIfEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]])
3225 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
3226 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP3]]
3227 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
3228 // CHECK1: omp.arrayinit.done:
3229 // CHECK1-NEXT: store ptr [[VAR33]], ptr [[_TMP4]], align 8
3230 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3231 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP4]], align 4
3232 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP5]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3233 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3234 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP6]], 9
3235 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3236 // CHECK1: cond.true:
3237 // CHECK1-NEXT: br label [[COND_END:%.*]]
3238 // CHECK1: cond.false:
3239 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3240 // CHECK1-NEXT: br label [[COND_END]]
3241 // CHECK1: cond.end:
3242 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP7]], [[COND_FALSE]] ]
3243 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3244 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3245 // CHECK1-NEXT: store i32 [[TMP8]], ptr [[DOTOMP_IV]], align 4
3246 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3247 // CHECK1: omp.inner.for.cond:
3248 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3249 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3250 // CHECK1-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
3251 // CHECK1-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
3252 // CHECK1: omp.inner.for.cond.cleanup:
3253 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
3254 // CHECK1: omp.inner.for.body:
3255 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3256 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
3257 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3258 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
3259 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3260 // CHECK1: omp.body.continue:
3261 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3262 // CHECK1: omp.inner.for.inc:
3263 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3264 // CHECK1-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP12]], 1
3265 // CHECK1-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
3266 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
3267 // CHECK1: omp.inner.for.end:
3268 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3269 // CHECK1: omp.loop.exit:
3270 // CHECK1-NEXT: [[TMP13:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3271 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP13]], align 4
3272 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP14]])
3273 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
3274 // CHECK1-NEXT: store ptr [[VAR33]], ptr [[TMP15]], align 8
3275 // CHECK1-NEXT: [[TMP16:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3276 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[TMP16]], align 4
3277 // CHECK1-NEXT: [[TMP18:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2]], i32 [[TMP17]], i32 1, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @main.omp_outlined.12.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
3278 // CHECK1-NEXT: switch i32 [[TMP18]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
3279 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
3280 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
3281 // CHECK1-NEXT: ]
3282 // CHECK1: .omp.reduction.case1:
3283 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr [[STRUCT_S]], ptr [[TMP2]], i64 4
3284 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP2]], [[TMP19]]
3285 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE10:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
3286 // CHECK1: omp.arraycpy.body:
3287 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[VAR33]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
3288 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST7:%.*]] = phi ptr [ [[TMP2]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT8:%.*]], [[OMP_ARRAYCPY_BODY]] ]
3289 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST7]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
3290 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST7]], ptr align 4 [[CALL]], i64 4, i1 false)
3291 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT8]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST7]], i32 1
3292 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
3293 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE9:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT8]], [[TMP19]]
3294 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE9]], label [[OMP_ARRAYCPY_DONE10]], label [[OMP_ARRAYCPY_BODY]]
3295 // CHECK1: omp.arraycpy.done10:
3296 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP17]], ptr @.gomp_critical_user_.reduction.var)
3297 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
3298 // CHECK1: .omp.reduction.case2:
3299 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr [[STRUCT_S]], ptr [[TMP2]], i64 4
3300 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY11:%.*]] = icmp eq ptr [[TMP2]], [[TMP20]]
3301 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY11]], label [[OMP_ARRAYCPY_DONE19:%.*]], label [[OMP_ARRAYCPY_BODY12:%.*]]
3302 // CHECK1: omp.arraycpy.body12:
3303 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST13:%.*]] = phi ptr [ [[VAR33]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT17:%.*]], [[OMP_ARRAYCPY_BODY12]] ]
3304 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST14:%.*]] = phi ptr [ [[TMP2]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT16:%.*]], [[OMP_ARRAYCPY_BODY12]] ]
3305 // CHECK1-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3306 // CHECK1-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
3307 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP22]], ptr @.gomp_critical_user_.atomic_reduction.var)
3308 // CHECK1-NEXT: [[CALL15:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST14]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST13]])
3309 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST14]], ptr align 4 [[CALL15]], i64 4, i1 false)
3310 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP22]], ptr @.gomp_critical_user_.atomic_reduction.var)
3311 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT16]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST14]], i32 1
3312 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT17]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST13]], i32 1
3313 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE18:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT16]], [[TMP20]]
3314 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE18]], label [[OMP_ARRAYCPY_DONE19]], label [[OMP_ARRAYCPY_BODY12]]
3315 // CHECK1: omp.arraycpy.done19:
3316 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP17]], ptr @.gomp_critical_user_.reduction.var)
3317 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
3318 // CHECK1: .omp.reduction.default:
3319 // CHECK1-NEXT: [[ARRAY_BEGIN20:%.*]] = getelementptr inbounds [4 x %struct.S], ptr [[VAR33]], i32 0, i32 0
3320 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAY_BEGIN20]], i64 4
3321 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
3322 // CHECK1: arraydestroy.body:
3323 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP23]], [[DOTOMP_REDUCTION_DEFAULT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
3324 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
3325 // CHECK1-NEXT: call void @_ZN1SIfED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR5]]
3326 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN20]]
3327 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE21:%.*]], label [[ARRAYDESTROY_BODY]]
3328 // CHECK1: arraydestroy.done21:
3329 // CHECK1-NEXT: [[TMP24:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3330 // CHECK1-NEXT: [[TMP25:%.*]] = load i32, ptr [[TMP24]], align 4
3331 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4]], i32 [[TMP25]])
3332 // CHECK1-NEXT: ret void
3335 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.12.omp.reduction.reduction_func
3336 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
3337 // CHECK1-NEXT: entry:
3338 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
3339 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
3340 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
3341 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
3342 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
3343 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
3344 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i64 0, i64 0
3345 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
3346 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP2]], i64 0, i64 0
3347 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
3348 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr [[STRUCT_S:%.*]], ptr [[TMP7]], i64 4
3349 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP7]], [[TMP8]]
3350 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE2:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
3351 // CHECK1: omp.arraycpy.body:
3352 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP5]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
3353 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[TMP7]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
3354 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIfEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
3355 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr align 4 [[CALL]], i64 4, i1 false)
3356 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
3357 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
3358 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP8]]
3359 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE2]], label [[OMP_ARRAYCPY_BODY]]
3360 // CHECK1: omp.arraycpy.done2:
3361 // CHECK1-NEXT: ret void
3364 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiLi42EET_v
3365 // CHECK1-SAME: () #[[ATTR7]] {
3366 // CHECK1-NEXT: entry:
3367 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
3368 // CHECK1-NEXT: [[T:%.*]] = alloca i32, align 4
3369 // CHECK1-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
3370 // CHECK1-NEXT: [[T_VAR:%.*]] = alloca i32, align 4
3371 // CHECK1-NEXT: [[T_VAR1:%.*]] = alloca i32, align 4
3372 // CHECK1-NEXT: [[VEC:%.*]] = alloca [2 x i32], align 4
3373 // CHECK1-NEXT: [[S_ARR:%.*]] = alloca [2 x %struct.S.0], align 4
3374 // CHECK1-NEXT: [[VAR:%.*]] = alloca ptr, align 8
3375 // CHECK1-NEXT: [[VAR1:%.*]] = alloca [[STRUCT_S_0]], align 4
3376 // CHECK1-NEXT: [[ARR:%.*]] = alloca [42 x %struct.S.0], align 16
3377 // CHECK1-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]])
3378 // CHECK1-NEXT: store i32 0, ptr [[T_VAR]], align 4
3379 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[VEC]], ptr align 4 @__const._Z5tmainIiLi42EET_v.vec, i64 8, i1 false)
3380 // CHECK1-NEXT: [[ARRAYINIT_BEGIN:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i64 0, i64 0
3381 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_BEGIN]], i32 noundef 1)
3382 // CHECK1-NEXT: [[ARRAYINIT_ELEMENT:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYINIT_BEGIN]], i64 1
3383 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYINIT_ELEMENT]], i32 noundef 2)
3384 // CHECK1-NEXT: store ptr [[TEST]], ptr [[VAR]], align 8
3385 // CHECK1-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR1]])
3386 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [42 x %struct.S.0], ptr [[ARR]], i32 0, i32 0
3387 // CHECK1-NEXT: [[ARRAYCTOR_END:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i64 42
3388 // CHECK1-NEXT: br label [[ARRAYCTOR_LOOP:%.*]]
3389 // CHECK1: arrayctor.loop:
3390 // CHECK1-NEXT: [[ARRAYCTOR_CUR:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[ARRAYCTOR_NEXT:%.*]], [[ARRAYCTOR_LOOP]] ]
3391 // CHECK1-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYCTOR_CUR]])
3392 // CHECK1-NEXT: [[ARRAYCTOR_NEXT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYCTOR_CUR]], i64 1
3393 // CHECK1-NEXT: [[ARRAYCTOR_DONE:%.*]] = icmp eq ptr [[ARRAYCTOR_NEXT]], [[ARRAYCTOR_END]]
3394 // CHECK1-NEXT: br i1 [[ARRAYCTOR_DONE]], label [[ARRAYCTOR_CONT:%.*]], label [[ARRAYCTOR_LOOP]]
3395 // CHECK1: arrayctor.cont:
3396 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[VAR]], align 8
3397 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 6, ptr @_Z5tmainIiLi42EET_v.omp_outlined, ptr [[T_VAR]], ptr [[TMP0]], ptr [[VAR1]], ptr [[T_VAR1]], ptr [[VEC]], ptr [[S_ARR]])
3398 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[VAR]], align 8
3399 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 4, ptr @_Z5tmainIiLi42EET_v.omp_outlined.13, ptr [[T_VAR]], ptr [[VEC]], ptr [[S_ARR]], ptr [[TMP1]])
3400 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR]], align 8
3401 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 5, ptr @_Z5tmainIiLi42EET_v.omp_outlined.14, ptr [[ARR]], ptr [[VEC]], ptr [[T_VAR]], ptr [[S_ARR]], ptr [[TMP2]])
3402 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
3403 // CHECK1-NEXT: [[ARRAY_BEGIN1:%.*]] = getelementptr inbounds [42 x %struct.S.0], ptr [[ARR]], i32 0, i32 0
3404 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN1]], i64 42
3405 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
3406 // CHECK1: arraydestroy.body:
3407 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP3]], [[ARRAYCTOR_CONT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
3408 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
3409 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR5]]
3410 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN1]]
3411 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE2:%.*]], label [[ARRAYDESTROY_BODY]]
3412 // CHECK1: arraydestroy.done2:
3413 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR1]]) #[[ATTR5]]
3414 // CHECK1-NEXT: [[ARRAY_BEGIN3:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[S_ARR]], i32 0, i32 0
3415 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN3]], i64 2
3416 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY4:%.*]]
3417 // CHECK1: arraydestroy.body4:
3418 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST5:%.*]] = phi ptr [ [[TMP4]], [[ARRAYDESTROY_DONE2]] ], [ [[ARRAYDESTROY_ELEMENT6:%.*]], [[ARRAYDESTROY_BODY4]] ]
3419 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT6]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST5]], i64 -1
3420 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT6]]) #[[ATTR5]]
3421 // CHECK1-NEXT: [[ARRAYDESTROY_DONE7:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT6]], [[ARRAY_BEGIN3]]
3422 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE7]], label [[ARRAYDESTROY_DONE8:%.*]], label [[ARRAYDESTROY_BODY4]]
3423 // CHECK1: arraydestroy.done8:
3424 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[TEST]]) #[[ATTR5]]
3425 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[RETVAL]], align 4
3426 // CHECK1-NEXT: ret i32 [[TMP5]]
3429 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ev
3430 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] align 2 {
3431 // CHECK1-NEXT: entry:
3432 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
3433 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
3434 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
3435 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
3436 // CHECK1-NEXT: [[TMP0:%.*]] = load volatile double, ptr @g, align 8
3437 // CHECK1-NEXT: [[CONV:%.*]] = fptrunc double [[TMP0]] to float
3438 // CHECK1-NEXT: store float [[CONV]], ptr [[F]], align 4
3439 // CHECK1-NEXT: ret void
3442 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfEC2Ef
3443 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], float noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] align 2 {
3444 // CHECK1-NEXT: entry:
3445 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
3446 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca float, align 4
3447 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
3448 // CHECK1-NEXT: store float [[A]], ptr [[A_ADDR]], align 4
3449 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
3450 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
3451 // CHECK1-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR]], align 4
3452 // CHECK1-NEXT: [[CONV:%.*]] = fpext float [[TMP0]] to double
3453 // CHECK1-NEXT: [[TMP1:%.*]] = load volatile double, ptr @g, align 8
3454 // CHECK1-NEXT: [[ADD:%.*]] = fadd double [[CONV]], [[TMP1]]
3455 // CHECK1-NEXT: [[CONV2:%.*]] = fptrunc double [[ADD]] to float
3456 // CHECK1-NEXT: store float [[CONV2]], ptr [[F]], align 4
3457 // CHECK1-NEXT: ret void
3460 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIfED2Ev
3461 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] align 2 {
3462 // CHECK1-NEXT: entry:
3463 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
3464 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
3465 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
3466 // CHECK1-NEXT: ret void
3469 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ev
3470 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] align 2 {
3471 // CHECK1-NEXT: entry:
3472 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
3473 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
3474 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
3475 // CHECK1-NEXT: call void @_ZN1SIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]])
3476 // CHECK1-NEXT: ret void
3479 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC1Ei
3480 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] align 2 {
3481 // CHECK1-NEXT: entry:
3482 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
3483 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3484 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
3485 // CHECK1-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3486 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
3487 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
3488 // CHECK1-NEXT: call void @_ZN1SIiEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]], i32 noundef [[TMP0]])
3489 // CHECK1-NEXT: ret void
3492 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiLi42EET_v.omp_outlined
3493 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[T_VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR1:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[T_VAR1:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[VEC:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[S_ARR:%.*]]) #[[ATTR4]] {
3494 // CHECK1-NEXT: entry:
3495 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3496 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3497 // CHECK1-NEXT: [[T_VAR_ADDR:%.*]] = alloca ptr, align 8
3498 // CHECK1-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 8
3499 // CHECK1-NEXT: [[VAR1_ADDR:%.*]] = alloca ptr, align 8
3500 // CHECK1-NEXT: [[T_VAR1_ADDR:%.*]] = alloca ptr, align 8
3501 // CHECK1-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 8
3502 // CHECK1-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 8
3503 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
3504 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
3505 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3506 // CHECK1-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3507 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3508 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3509 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3510 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3511 // CHECK1-NEXT: [[T_VAR3:%.*]] = alloca i32, align 4
3512 // CHECK1-NEXT: [[VAR4:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
3513 // CHECK1-NEXT: [[_TMP5:%.*]] = alloca ptr, align 8
3514 // CHECK1-NEXT: [[VAR16:%.*]] = alloca [[STRUCT_S_0]], align 4
3515 // CHECK1-NEXT: [[T_VAR17:%.*]] = alloca i32, align 4
3516 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
3517 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [4 x ptr], align 8
3518 // CHECK1-NEXT: [[REF_TMP:%.*]] = alloca [[STRUCT_S_0]], align 4
3519 // CHECK1-NEXT: [[REF_TMP22:%.*]] = alloca [[STRUCT_S_0]], align 4
3520 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3521 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3522 // CHECK1-NEXT: store ptr [[T_VAR]], ptr [[T_VAR_ADDR]], align 8
3523 // CHECK1-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 8
3524 // CHECK1-NEXT: store ptr [[VAR1]], ptr [[VAR1_ADDR]], align 8
3525 // CHECK1-NEXT: store ptr [[T_VAR1]], ptr [[T_VAR1_ADDR]], align 8
3526 // CHECK1-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 8
3527 // CHECK1-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 8
3528 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[T_VAR_ADDR]], align 8
3529 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[VAR_ADDR]], align 8
3530 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[VAR1_ADDR]], align 8
3531 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[T_VAR1_ADDR]], align 8
3532 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[VEC_ADDR]], align 8
3533 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 8
3534 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[TMP]], align 8
3535 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[TMP]], align 8
3536 // CHECK1-NEXT: store ptr [[TMP6]], ptr [[_TMP1]], align 8
3537 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3538 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
3539 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3540 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3541 // CHECK1-NEXT: store i32 0, ptr [[T_VAR3]], align 4
3542 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[_TMP1]], align 8
3543 // CHECK1-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR4]])
3544 // CHECK1-NEXT: store ptr [[VAR4]], ptr [[_TMP5]], align 8
3545 // CHECK1-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR16]])
3546 // CHECK1-NEXT: store i32 2147483647, ptr [[T_VAR17]], align 4
3547 // CHECK1-NEXT: [[TMP8:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3548 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP8]], align 4
3549 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP9]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3550 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3551 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP10]], 1
3552 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3553 // CHECK1: cond.true:
3554 // CHECK1-NEXT: br label [[COND_END:%.*]]
3555 // CHECK1: cond.false:
3556 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3557 // CHECK1-NEXT: br label [[COND_END]]
3558 // CHECK1: cond.end:
3559 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP11]], [[COND_FALSE]] ]
3560 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3561 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3562 // CHECK1-NEXT: store i32 [[TMP12]], ptr [[DOTOMP_IV]], align 4
3563 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3564 // CHECK1: omp.inner.for.cond:
3565 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3566 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3567 // CHECK1-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
3568 // CHECK1-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
3569 // CHECK1: omp.inner.for.cond.cleanup:
3570 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
3571 // CHECK1: omp.inner.for.body:
3572 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3573 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP15]], 1
3574 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3575 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
3576 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[T_VAR3]], align 4
3577 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[I]], align 4
3578 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP17]] to i64
3579 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[TMP4]], i64 0, i64 [[IDXPROM]]
3580 // CHECK1-NEXT: store i32 [[TMP16]], ptr [[ARRAYIDX]], align 4
3581 // CHECK1-NEXT: [[TMP18:%.*]] = load ptr, ptr [[_TMP5]], align 8
3582 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[I]], align 4
3583 // CHECK1-NEXT: [[IDXPROM9:%.*]] = sext i32 [[TMP19]] to i64
3584 // CHECK1-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[TMP5]], i64 0, i64 [[IDXPROM9]]
3585 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX10]], ptr align 4 [[TMP18]], i64 4, i1 false)
3586 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3587 // CHECK1: omp.body.continue:
3588 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3589 // CHECK1: omp.inner.for.inc:
3590 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3591 // CHECK1-NEXT: [[ADD11:%.*]] = add nsw i32 [[TMP20]], 1
3592 // CHECK1-NEXT: store i32 [[ADD11]], ptr [[DOTOMP_IV]], align 4
3593 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
3594 // CHECK1: omp.inner.for.end:
3595 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3596 // CHECK1: omp.loop.exit:
3597 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP9]])
3598 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
3599 // CHECK1-NEXT: store ptr [[T_VAR3]], ptr [[TMP21]], align 8
3600 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
3601 // CHECK1-NEXT: store ptr [[VAR4]], ptr [[TMP22]], align 8
3602 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 2
3603 // CHECK1-NEXT: store ptr [[VAR16]], ptr [[TMP23]], align 8
3604 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 3
3605 // CHECK1-NEXT: store ptr [[T_VAR17]], ptr [[TMP24]], align 8
3606 // CHECK1-NEXT: [[TMP25:%.*]] = call i32 @__kmpc_reduce_nowait(ptr @[[GLOB2]], i32 [[TMP9]], i32 4, i64 32, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_Z5tmainIiLi42EET_v.omp_outlined.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
3607 // CHECK1-NEXT: switch i32 [[TMP25]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
3608 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
3609 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
3610 // CHECK1-NEXT: ]
3611 // CHECK1: .omp.reduction.case1:
3612 // CHECK1-NEXT: [[TMP26:%.*]] = load i32, ptr [[TMP0]], align 4
3613 // CHECK1-NEXT: [[TMP27:%.*]] = load i32, ptr [[T_VAR3]], align 4
3614 // CHECK1-NEXT: [[ADD12:%.*]] = add nsw i32 [[TMP26]], [[TMP27]]
3615 // CHECK1-NEXT: store i32 [[ADD12]], ptr [[TMP0]], align 4
3616 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIiEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[TMP7]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR4]])
3617 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP7]], ptr align 4 [[CALL]], i64 4, i1 false)
3618 // CHECK1-NEXT: [[CALL13:%.*]] = call noundef i32 @_ZN1SIiEcviEv(ptr noundef nonnull align 4 dereferenceable(4) [[TMP2]])
3619 // CHECK1-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[CALL13]], 0
3620 // CHECK1-NEXT: br i1 [[TOBOOL]], label [[LAND_RHS:%.*]], label [[LAND_END:%.*]]
3621 // CHECK1: land.rhs:
3622 // CHECK1-NEXT: [[CALL14:%.*]] = call noundef i32 @_ZN1SIiEcviEv(ptr noundef nonnull align 4 dereferenceable(4) [[VAR16]])
3623 // CHECK1-NEXT: [[TOBOOL15:%.*]] = icmp ne i32 [[CALL14]], 0
3624 // CHECK1-NEXT: br label [[LAND_END]]
3625 // CHECK1: land.end:
3626 // CHECK1-NEXT: [[TMP28:%.*]] = phi i1 [ false, [[DOTOMP_REDUCTION_CASE1]] ], [ [[TOBOOL15]], [[LAND_RHS]] ]
3627 // CHECK1-NEXT: [[CONV:%.*]] = zext i1 [[TMP28]] to i32
3628 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP]], i32 noundef [[CONV]])
3629 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP2]], ptr align 4 [[REF_TMP]], i64 4, i1 false)
3630 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP]]) #[[ATTR5]]
3631 // CHECK1-NEXT: [[TMP29:%.*]] = load i32, ptr [[TMP3]], align 4
3632 // CHECK1-NEXT: [[TMP30:%.*]] = load i32, ptr [[T_VAR17]], align 4
3633 // CHECK1-NEXT: [[CMP16:%.*]] = icmp slt i32 [[TMP29]], [[TMP30]]
3634 // CHECK1-NEXT: br i1 [[CMP16]], label [[COND_TRUE17:%.*]], label [[COND_FALSE18:%.*]]
3635 // CHECK1: cond.true17:
3636 // CHECK1-NEXT: [[TMP31:%.*]] = load i32, ptr [[TMP3]], align 4
3637 // CHECK1-NEXT: br label [[COND_END19:%.*]]
3638 // CHECK1: cond.false18:
3639 // CHECK1-NEXT: [[TMP32:%.*]] = load i32, ptr [[T_VAR17]], align 4
3640 // CHECK1-NEXT: br label [[COND_END19]]
3641 // CHECK1: cond.end19:
3642 // CHECK1-NEXT: [[COND20:%.*]] = phi i32 [ [[TMP31]], [[COND_TRUE17]] ], [ [[TMP32]], [[COND_FALSE18]] ]
3643 // CHECK1-NEXT: store i32 [[COND20]], ptr [[TMP3]], align 4
3644 // CHECK1-NEXT: call void @__kmpc_end_reduce_nowait(ptr @[[GLOB2]], i32 [[TMP9]], ptr @.gomp_critical_user_.reduction.var)
3645 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
3646 // CHECK1: .omp.reduction.case2:
3647 // CHECK1-NEXT: [[TMP33:%.*]] = load i32, ptr [[T_VAR3]], align 4
3648 // CHECK1-NEXT: [[TMP34:%.*]] = atomicrmw add ptr [[TMP0]], i32 [[TMP33]] monotonic, align 4
3649 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP9]], ptr @.gomp_critical_user_.atomic_reduction.var)
3650 // CHECK1-NEXT: [[CALL21:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIiEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[TMP7]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR4]])
3651 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP7]], ptr align 4 [[CALL21]], i64 4, i1 false)
3652 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP9]], ptr @.gomp_critical_user_.atomic_reduction.var)
3653 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP9]], ptr @.gomp_critical_user_.atomic_reduction.var)
3654 // CHECK1-NEXT: [[CALL23:%.*]] = call noundef i32 @_ZN1SIiEcviEv(ptr noundef nonnull align 4 dereferenceable(4) [[TMP2]])
3655 // CHECK1-NEXT: [[TOBOOL24:%.*]] = icmp ne i32 [[CALL23]], 0
3656 // CHECK1-NEXT: br i1 [[TOBOOL24]], label [[LAND_RHS25:%.*]], label [[LAND_END28:%.*]]
3657 // CHECK1: land.rhs25:
3658 // CHECK1-NEXT: [[CALL26:%.*]] = call noundef i32 @_ZN1SIiEcviEv(ptr noundef nonnull align 4 dereferenceable(4) [[VAR16]])
3659 // CHECK1-NEXT: [[TOBOOL27:%.*]] = icmp ne i32 [[CALL26]], 0
3660 // CHECK1-NEXT: br label [[LAND_END28]]
3661 // CHECK1: land.end28:
3662 // CHECK1-NEXT: [[TMP35:%.*]] = phi i1 [ false, [[DOTOMP_REDUCTION_CASE2]] ], [ [[TOBOOL27]], [[LAND_RHS25]] ]
3663 // CHECK1-NEXT: [[CONV29:%.*]] = zext i1 [[TMP35]] to i32
3664 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP22]], i32 noundef [[CONV29]])
3665 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP2]], ptr align 4 [[REF_TMP22]], i64 4, i1 false)
3666 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP22]]) #[[ATTR5]]
3667 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP9]], ptr @.gomp_critical_user_.atomic_reduction.var)
3668 // CHECK1-NEXT: [[TMP36:%.*]] = load i32, ptr [[T_VAR17]], align 4
3669 // CHECK1-NEXT: [[TMP37:%.*]] = atomicrmw min ptr [[TMP3]], i32 [[TMP36]] monotonic, align 4
3670 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
3671 // CHECK1: .omp.reduction.default:
3672 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR16]]) #[[ATTR5]]
3673 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[VAR4]]) #[[ATTR5]]
3674 // CHECK1-NEXT: ret void
3677 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiLi42EET_v.omp_outlined.omp.reduction.reduction_func
3678 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
3679 // CHECK1-NEXT: entry:
3680 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
3681 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
3682 // CHECK1-NEXT: [[REF_TMP:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
3683 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
3684 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
3685 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
3686 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
3687 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP3]], i64 0, i64 0
3688 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
3689 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP2]], i64 0, i64 0
3690 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
3691 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP3]], i64 0, i64 1
3692 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 8
3693 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP2]], i64 0, i64 1
3694 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 8
3695 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP3]], i64 0, i64 2
3696 // CHECK1-NEXT: [[TMP13:%.*]] = load ptr, ptr [[TMP12]], align 8
3697 // CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP2]], i64 0, i64 2
3698 // CHECK1-NEXT: [[TMP15:%.*]] = load ptr, ptr [[TMP14]], align 8
3699 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP3]], i64 0, i64 3
3700 // CHECK1-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 8
3701 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [4 x ptr], ptr [[TMP2]], i64 0, i64 3
3702 // CHECK1-NEXT: [[TMP19:%.*]] = load ptr, ptr [[TMP18]], align 8
3703 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP7]], align 4
3704 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP5]], align 4
3705 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP20]], [[TMP21]]
3706 // CHECK1-NEXT: store i32 [[ADD]], ptr [[TMP7]], align 4
3707 // CHECK1-NEXT: [[CALL:%.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN1SIiEanERKS0_(ptr noundef nonnull align 4 dereferenceable(4) [[TMP11]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP9]])
3708 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP11]], ptr align 4 [[CALL]], i64 4, i1 false)
3709 // CHECK1-NEXT: [[CALL2:%.*]] = call noundef i32 @_ZN1SIiEcviEv(ptr noundef nonnull align 4 dereferenceable(4) [[TMP15]])
3710 // CHECK1-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[CALL2]], 0
3711 // CHECK1-NEXT: br i1 [[TOBOOL]], label [[LAND_RHS:%.*]], label [[LAND_END:%.*]]
3712 // CHECK1: land.rhs:
3713 // CHECK1-NEXT: [[CALL3:%.*]] = call noundef i32 @_ZN1SIiEcviEv(ptr noundef nonnull align 4 dereferenceable(4) [[TMP13]])
3714 // CHECK1-NEXT: [[TOBOOL4:%.*]] = icmp ne i32 [[CALL3]], 0
3715 // CHECK1-NEXT: br label [[LAND_END]]
3716 // CHECK1: land.end:
3717 // CHECK1-NEXT: [[TMP22:%.*]] = phi i1 [ false, [[ENTRY:%.*]] ], [ [[TOBOOL4]], [[LAND_RHS]] ]
3718 // CHECK1-NEXT: [[CONV:%.*]] = zext i1 [[TMP22]] to i32
3719 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP]], i32 noundef [[CONV]])
3720 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[TMP15]], ptr align 4 [[REF_TMP]], i64 4, i1 false)
3721 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP]]) #[[ATTR5]]
3722 // CHECK1-NEXT: [[TMP23:%.*]] = load i32, ptr [[TMP19]], align 4
3723 // CHECK1-NEXT: [[TMP24:%.*]] = load i32, ptr [[TMP17]], align 4
3724 // CHECK1-NEXT: [[CMP:%.*]] = icmp slt i32 [[TMP23]], [[TMP24]]
3725 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3726 // CHECK1: cond.true:
3727 // CHECK1-NEXT: [[TMP25:%.*]] = load i32, ptr [[TMP19]], align 4
3728 // CHECK1-NEXT: br label [[COND_END:%.*]]
3729 // CHECK1: cond.false:
3730 // CHECK1-NEXT: [[TMP26:%.*]] = load i32, ptr [[TMP17]], align 4
3731 // CHECK1-NEXT: br label [[COND_END]]
3732 // CHECK1: cond.end:
3733 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ [[TMP25]], [[COND_TRUE]] ], [ [[TMP26]], [[COND_FALSE]] ]
3734 // CHECK1-NEXT: store i32 [[COND]], ptr [[TMP19]], align 4
3735 // CHECK1-NEXT: ret void
3738 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEanERKS0_
3739 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[TMP0:%.*]]) #[[ATTR7]] align 2 {
3740 // CHECK1-NEXT: entry:
3741 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
3742 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
3743 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
3744 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
3745 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
3746 // CHECK1-NEXT: ret ptr [[THIS1]]
3749 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEcviEv
3750 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) #[[ATTR7]] align 2 {
3751 // CHECK1-NEXT: entry:
3752 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
3753 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
3754 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
3755 // CHECK1-NEXT: ret i32 0
3758 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiED1Ev
3759 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] align 2 {
3760 // CHECK1-NEXT: entry:
3761 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
3762 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
3763 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
3764 // CHECK1-NEXT: call void @_ZN1SIiED2Ev(ptr noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR5]]
3765 // CHECK1-NEXT: ret void
3768 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiLi42EET_v.omp_outlined.13
3769 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[T_VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[VEC:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[S_ARR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR:%.*]]) #[[ATTR4]] {
3770 // CHECK1-NEXT: entry:
3771 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3772 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3773 // CHECK1-NEXT: [[T_VAR_ADDR:%.*]] = alloca ptr, align 8
3774 // CHECK1-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 8
3775 // CHECK1-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 8
3776 // CHECK1-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 8
3777 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
3778 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
3779 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3780 // CHECK1-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3781 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3782 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3783 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3784 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3785 // CHECK1-NEXT: [[T_VAR3:%.*]] = alloca i32, align 4
3786 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
3787 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8
3788 // CHECK1-NEXT: [[ATOMIC_TEMP:%.*]] = alloca i32, align 4
3789 // CHECK1-NEXT: [[_TMP10:%.*]] = alloca i32, align 4
3790 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3791 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3792 // CHECK1-NEXT: store ptr [[T_VAR]], ptr [[T_VAR_ADDR]], align 8
3793 // CHECK1-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 8
3794 // CHECK1-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 8
3795 // CHECK1-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 8
3796 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[T_VAR_ADDR]], align 8
3797 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[VEC_ADDR]], align 8
3798 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 8
3799 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[VAR_ADDR]], align 8
3800 // CHECK1-NEXT: store ptr [[TMP3]], ptr [[TMP]], align 8
3801 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[TMP]], align 8
3802 // CHECK1-NEXT: store ptr [[TMP4]], ptr [[_TMP1]], align 8
3803 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3804 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
3805 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3806 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3807 // CHECK1-NEXT: store i32 1, ptr [[T_VAR3]], align 4
3808 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3809 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[TMP5]], align 4
3810 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP6]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3811 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3812 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP7]], 1
3813 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3814 // CHECK1: cond.true:
3815 // CHECK1-NEXT: br label [[COND_END:%.*]]
3816 // CHECK1: cond.false:
3817 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3818 // CHECK1-NEXT: br label [[COND_END]]
3819 // CHECK1: cond.end:
3820 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP8]], [[COND_FALSE]] ]
3821 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3822 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3823 // CHECK1-NEXT: store i32 [[TMP9]], ptr [[DOTOMP_IV]], align 4
3824 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3825 // CHECK1: omp.inner.for.cond:
3826 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3827 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3828 // CHECK1-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP10]], [[TMP11]]
3829 // CHECK1-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3830 // CHECK1: omp.inner.for.body:
3831 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3832 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP12]], 1
3833 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3834 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
3835 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[T_VAR3]], align 4
3836 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[I]], align 4
3837 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP14]] to i64
3838 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i32], ptr [[TMP1]], i64 0, i64 [[IDXPROM]]
3839 // CHECK1-NEXT: store i32 [[TMP13]], ptr [[ARRAYIDX]], align 4
3840 // CHECK1-NEXT: [[TMP15:%.*]] = load ptr, ptr [[_TMP1]], align 8
3841 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[I]], align 4
3842 // CHECK1-NEXT: [[IDXPROM5:%.*]] = sext i32 [[TMP16]] to i64
3843 // CHECK1-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[TMP2]], i64 0, i64 [[IDXPROM5]]
3844 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX6]], ptr align 4 [[TMP15]], i64 4, i1 false)
3845 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3846 // CHECK1: omp.body.continue:
3847 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3848 // CHECK1: omp.inner.for.inc:
3849 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3850 // CHECK1-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP17]], 1
3851 // CHECK1-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4
3852 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
3853 // CHECK1: omp.inner.for.end:
3854 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3855 // CHECK1: omp.loop.exit:
3856 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP6]])
3857 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
3858 // CHECK1-NEXT: store ptr [[T_VAR3]], ptr [[TMP18]], align 8
3859 // CHECK1-NEXT: [[TMP19:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2]], i32 [[TMP6]], i32 1, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_Z5tmainIiLi42EET_v.omp_outlined.13.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
3860 // CHECK1-NEXT: switch i32 [[TMP19]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
3861 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
3862 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
3863 // CHECK1-NEXT: ]
3864 // CHECK1: .omp.reduction.case1:
3865 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP0]], align 4
3866 // CHECK1-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP20]], 0
3867 // CHECK1-NEXT: br i1 [[TOBOOL]], label [[LAND_RHS:%.*]], label [[LAND_END:%.*]]
3868 // CHECK1: land.rhs:
3869 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[T_VAR3]], align 4
3870 // CHECK1-NEXT: [[TOBOOL8:%.*]] = icmp ne i32 [[TMP21]], 0
3871 // CHECK1-NEXT: br label [[LAND_END]]
3872 // CHECK1: land.end:
3873 // CHECK1-NEXT: [[TMP22:%.*]] = phi i1 [ false, [[DOTOMP_REDUCTION_CASE1]] ], [ [[TOBOOL8]], [[LAND_RHS]] ]
3874 // CHECK1-NEXT: [[CONV:%.*]] = zext i1 [[TMP22]] to i32
3875 // CHECK1-NEXT: store i32 [[CONV]], ptr [[TMP0]], align 4
3876 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP6]], ptr @.gomp_critical_user_.reduction.var)
3877 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
3878 // CHECK1: .omp.reduction.case2:
3879 // CHECK1-NEXT: [[TMP23:%.*]] = load i32, ptr [[T_VAR3]], align 4
3880 // CHECK1-NEXT: [[TOBOOL9:%.*]] = icmp ne i32 [[TMP23]], 0
3881 // CHECK1-NEXT: [[ATOMIC_LOAD:%.*]] = load atomic i32, ptr [[TMP0]] monotonic, align 4
3882 // CHECK1-NEXT: br label [[ATOMIC_CONT:%.*]]
3883 // CHECK1: atomic_cont:
3884 // CHECK1-NEXT: [[TMP24:%.*]] = phi i32 [ [[ATOMIC_LOAD]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[TMP30:%.*]], [[LAND_END14:%.*]] ]
3885 // CHECK1-NEXT: store i32 [[TMP24]], ptr [[_TMP10]], align 4
3886 // CHECK1-NEXT: [[TMP25:%.*]] = load i32, ptr [[_TMP10]], align 4
3887 // CHECK1-NEXT: [[TOBOOL11:%.*]] = icmp ne i32 [[TMP25]], 0
3888 // CHECK1-NEXT: br i1 [[TOBOOL11]], label [[LAND_RHS12:%.*]], label [[LAND_END14]]
3889 // CHECK1: land.rhs12:
3890 // CHECK1-NEXT: [[TMP26:%.*]] = load i32, ptr [[T_VAR3]], align 4
3891 // CHECK1-NEXT: [[TOBOOL13:%.*]] = icmp ne i32 [[TMP26]], 0
3892 // CHECK1-NEXT: br label [[LAND_END14]]
3893 // CHECK1: land.end14:
3894 // CHECK1-NEXT: [[TMP27:%.*]] = phi i1 [ false, [[ATOMIC_CONT]] ], [ [[TOBOOL13]], [[LAND_RHS12]] ]
3895 // CHECK1-NEXT: [[CONV15:%.*]] = zext i1 [[TMP27]] to i32
3896 // CHECK1-NEXT: store i32 [[CONV15]], ptr [[ATOMIC_TEMP]], align 4
3897 // CHECK1-NEXT: [[TMP28:%.*]] = load i32, ptr [[ATOMIC_TEMP]], align 4
3898 // CHECK1-NEXT: [[TMP29:%.*]] = cmpxchg ptr [[TMP0]], i32 [[TMP24]], i32 [[TMP28]] monotonic monotonic, align 4
3899 // CHECK1-NEXT: [[TMP30]] = extractvalue { i32, i1 } [[TMP29]], 0
3900 // CHECK1-NEXT: [[TMP31:%.*]] = extractvalue { i32, i1 } [[TMP29]], 1
3901 // CHECK1-NEXT: br i1 [[TMP31]], label [[ATOMIC_EXIT:%.*]], label [[ATOMIC_CONT]]
3902 // CHECK1: atomic_exit:
3903 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP6]], ptr @.gomp_critical_user_.reduction.var)
3904 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
3905 // CHECK1: .omp.reduction.default:
3906 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4]], i32 [[TMP6]])
3907 // CHECK1-NEXT: ret void
3910 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiLi42EET_v.omp_outlined.13.omp.reduction.reduction_func
3911 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
3912 // CHECK1-NEXT: entry:
3913 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
3914 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
3915 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
3916 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
3917 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
3918 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
3919 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i64 0, i64 0
3920 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
3921 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP2]], i64 0, i64 0
3922 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
3923 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
3924 // CHECK1-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP8]], 0
3925 // CHECK1-NEXT: br i1 [[TOBOOL]], label [[LAND_RHS:%.*]], label [[LAND_END:%.*]]
3926 // CHECK1: land.rhs:
3927 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP5]], align 4
3928 // CHECK1-NEXT: [[TOBOOL2:%.*]] = icmp ne i32 [[TMP9]], 0
3929 // CHECK1-NEXT: br label [[LAND_END]]
3930 // CHECK1: land.end:
3931 // CHECK1-NEXT: [[TMP10:%.*]] = phi i1 [ false, [[ENTRY:%.*]] ], [ [[TOBOOL2]], [[LAND_RHS]] ]
3932 // CHECK1-NEXT: [[CONV:%.*]] = zext i1 [[TMP10]] to i32
3933 // CHECK1-NEXT: store i32 [[CONV]], ptr [[TMP7]], align 4
3934 // CHECK1-NEXT: ret void
3937 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiLi42EET_v.omp_outlined.14
3938 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(168) [[ARR:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[VEC:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[T_VAR:%.*]], ptr noundef nonnull align 4 dereferenceable(8) [[S_ARR:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[VAR:%.*]]) #[[ATTR4]] {
3939 // CHECK1-NEXT: entry:
3940 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3941 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3942 // CHECK1-NEXT: [[ARR_ADDR:%.*]] = alloca ptr, align 8
3943 // CHECK1-NEXT: [[VEC_ADDR:%.*]] = alloca ptr, align 8
3944 // CHECK1-NEXT: [[T_VAR_ADDR:%.*]] = alloca ptr, align 8
3945 // CHECK1-NEXT: [[S_ARR_ADDR:%.*]] = alloca ptr, align 8
3946 // CHECK1-NEXT: [[VAR_ADDR:%.*]] = alloca ptr, align 8
3947 // CHECK1-NEXT: [[TMP:%.*]] = alloca ptr, align 8
3948 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca ptr, align 8
3949 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3950 // CHECK1-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3951 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3952 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3953 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3954 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3955 // CHECK1-NEXT: [[ARR4:%.*]] = alloca [40 x %struct.S.0], align 16
3956 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
3957 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8
3958 // CHECK1-NEXT: [[REF_TMP:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
3959 // CHECK1-NEXT: [[REF_TMP20:%.*]] = alloca [[STRUCT_S_0]], align 4
3960 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3961 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3962 // CHECK1-NEXT: store ptr [[ARR]], ptr [[ARR_ADDR]], align 8
3963 // CHECK1-NEXT: store ptr [[VEC]], ptr [[VEC_ADDR]], align 8
3964 // CHECK1-NEXT: store ptr [[T_VAR]], ptr [[T_VAR_ADDR]], align 8
3965 // CHECK1-NEXT: store ptr [[S_ARR]], ptr [[S_ARR_ADDR]], align 8
3966 // CHECK1-NEXT: store ptr [[VAR]], ptr [[VAR_ADDR]], align 8
3967 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARR_ADDR]], align 8
3968 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[VEC_ADDR]], align 8
3969 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[T_VAR_ADDR]], align 8
3970 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[S_ARR_ADDR]], align 8
3971 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[VAR_ADDR]], align 8
3972 // CHECK1-NEXT: store ptr [[TMP4]], ptr [[TMP]], align 8
3973 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP]], align 8
3974 // CHECK1-NEXT: store ptr [[TMP5]], ptr [[_TMP1]], align 8
3975 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3976 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
3977 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3978 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3979 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [42 x %struct.S.0], ptr [[TMP0]], i64 0, i64 1
3980 // CHECK1-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds [42 x %struct.S.0], ptr [[TMP0]], i64 0, i64 40
3981 // CHECK1-NEXT: [[ARRAY_BEGIN:%.*]] = getelementptr inbounds [40 x %struct.S.0], ptr [[ARR4]], i32 0, i32 0
3982 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr [[STRUCT_S_0]], ptr [[ARRAY_BEGIN]], i64 40
3983 // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq ptr [[ARRAY_BEGIN]], [[TMP6]]
3984 // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
3985 // CHECK1: omp.arrayinit.body:
3986 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[ARRAY_BEGIN]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
3987 // CHECK1-NEXT: call void @_ZN1SIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]])
3988 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
3989 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP6]]
3990 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
3991 // CHECK1: omp.arrayinit.done:
3992 // CHECK1-NEXT: [[TMP7:%.*]] = ptrtoint ptr [[TMP0]] to i64
3993 // CHECK1-NEXT: [[TMP8:%.*]] = ptrtoint ptr [[ARRAYIDX]] to i64
3994 // CHECK1-NEXT: [[TMP9:%.*]] = sub i64 [[TMP7]], [[TMP8]]
3995 // CHECK1-NEXT: [[TMP10:%.*]] = sdiv exact i64 [[TMP9]], ptrtoint (ptr getelementptr ([[STRUCT_S_0]], ptr null, i32 1) to i64)
3996 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr [[STRUCT_S_0]], ptr [[ARR4]], i64 [[TMP10]]
3997 // CHECK1-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3998 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP12]], align 4
3999 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP13]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4000 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4001 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP14]], 1
4002 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4003 // CHECK1: cond.true:
4004 // CHECK1-NEXT: br label [[COND_END:%.*]]
4005 // CHECK1: cond.false:
4006 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4007 // CHECK1-NEXT: br label [[COND_END]]
4008 // CHECK1: cond.end:
4009 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP15]], [[COND_FALSE]] ]
4010 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4011 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4012 // CHECK1-NEXT: store i32 [[TMP16]], ptr [[DOTOMP_IV]], align 4
4013 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4014 // CHECK1: omp.inner.for.cond:
4015 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4016 // CHECK1-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4017 // CHECK1-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
4018 // CHECK1-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
4019 // CHECK1: omp.inner.for.cond.cleanup:
4020 // CHECK1-NEXT: br label [[OMP_INNER_FOR_END:%.*]]
4021 // CHECK1: omp.inner.for.body:
4022 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4023 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP19]], 1
4024 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4025 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
4026 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP2]], align 4
4027 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[I]], align 4
4028 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP21]] to i64
4029 // CHECK1-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds [2 x i32], ptr [[TMP1]], i64 0, i64 [[IDXPROM]]
4030 // CHECK1-NEXT: store i32 [[TMP20]], ptr [[ARRAYIDX6]], align 4
4031 // CHECK1-NEXT: [[TMP22:%.*]] = load ptr, ptr [[_TMP1]], align 8
4032 // CHECK1-NEXT: [[TMP23:%.*]] = load i32, ptr [[I]], align 4
4033 // CHECK1-NEXT: [[IDXPROM7:%.*]] = sext i32 [[TMP23]] to i64
4034 // CHECK1-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds [2 x %struct.S.0], ptr [[TMP3]], i64 0, i64 [[IDXPROM7]]
4035 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARRAYIDX8]], ptr align 4 [[TMP22]], i64 4, i1 false)
4036 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4037 // CHECK1: omp.body.continue:
4038 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4039 // CHECK1: omp.inner.for.inc:
4040 // CHECK1-NEXT: [[TMP24:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4041 // CHECK1-NEXT: [[ADD9:%.*]] = add nsw i32 [[TMP24]], 1
4042 // CHECK1-NEXT: store i32 [[ADD9]], ptr [[DOTOMP_IV]], align 4
4043 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
4044 // CHECK1: omp.inner.for.end:
4045 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4046 // CHECK1: omp.loop.exit:
4047 // CHECK1-NEXT: [[TMP25:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4048 // CHECK1-NEXT: [[TMP26:%.*]] = load i32, ptr [[TMP25]], align 4
4049 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP26]])
4050 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
4051 // CHECK1-NEXT: store ptr [[ARR4]], ptr [[TMP27]], align 8
4052 // CHECK1-NEXT: [[TMP28:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4053 // CHECK1-NEXT: [[TMP29:%.*]] = load i32, ptr [[TMP28]], align 4
4054 // CHECK1-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2]], i32 [[TMP29]], i32 1, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_Z5tmainIiLi42EET_v.omp_outlined.14.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
4055 // CHECK1-NEXT: switch i32 [[TMP30]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
4056 // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
4057 // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
4058 // CHECK1-NEXT: ]
4059 // CHECK1: .omp.reduction.case1:
4060 // CHECK1-NEXT: [[TMP31:%.*]] = getelementptr [[STRUCT_S_0]], ptr [[ARRAYIDX]], i64 40
4061 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[ARRAYIDX]], [[TMP31]]
4062 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE15:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
4063 // CHECK1: omp.arraycpy.body:
4064 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[ARR4]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
4065 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST10:%.*]] = phi ptr [ [[ARRAYIDX]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT13:%.*]], [[OMP_ARRAYCPY_BODY]] ]
4066 // CHECK1-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN1SIiEcviEv(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST10]])
4067 // CHECK1-NEXT: [[CALL11:%.*]] = call noundef i32 @_ZN1SIiEcviEv(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
4068 // CHECK1-NEXT: [[ADD12:%.*]] = add nsw i32 [[CALL]], [[CALL11]]
4069 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP]], i32 noundef [[ADD12]])
4070 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST10]], ptr align 4 [[REF_TMP]], i64 4, i1 false)
4071 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP]]) #[[ATTR5]]
4072 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT13]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST10]], i32 1
4073 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
4074 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE14:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT13]], [[TMP31]]
4075 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE14]], label [[OMP_ARRAYCPY_DONE15]], label [[OMP_ARRAYCPY_BODY]]
4076 // CHECK1: omp.arraycpy.done15:
4077 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP29]], ptr @.gomp_critical_user_.reduction.var)
4078 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
4079 // CHECK1: .omp.reduction.case2:
4080 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr [[STRUCT_S_0]], ptr [[ARRAYIDX]], i64 40
4081 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY16:%.*]] = icmp eq ptr [[ARRAYIDX]], [[TMP32]]
4082 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY16]], label [[OMP_ARRAYCPY_DONE27:%.*]], label [[OMP_ARRAYCPY_BODY17:%.*]]
4083 // CHECK1: omp.arraycpy.body17:
4084 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST18:%.*]] = phi ptr [ [[ARR4]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT25:%.*]], [[OMP_ARRAYCPY_BODY17]] ]
4085 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST19:%.*]] = phi ptr [ [[ARRAYIDX]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT24:%.*]], [[OMP_ARRAYCPY_BODY17]] ]
4086 // CHECK1-NEXT: [[TMP33:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4087 // CHECK1-NEXT: [[TMP34:%.*]] = load i32, ptr [[TMP33]], align 4
4088 // CHECK1-NEXT: call void @__kmpc_critical(ptr @[[GLOB3]], i32 [[TMP34]], ptr @.gomp_critical_user_.atomic_reduction.var)
4089 // CHECK1-NEXT: [[CALL21:%.*]] = call noundef i32 @_ZN1SIiEcviEv(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST19]])
4090 // CHECK1-NEXT: [[CALL22:%.*]] = call noundef i32 @_ZN1SIiEcviEv(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST18]])
4091 // CHECK1-NEXT: [[ADD23:%.*]] = add nsw i32 [[CALL21]], [[CALL22]]
4092 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP20]], i32 noundef [[ADD23]])
4093 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST19]], ptr align 4 [[REF_TMP20]], i64 4, i1 false)
4094 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP20]]) #[[ATTR5]]
4095 // CHECK1-NEXT: call void @__kmpc_end_critical(ptr @[[GLOB3]], i32 [[TMP34]], ptr @.gomp_critical_user_.atomic_reduction.var)
4096 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT24]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST19]], i32 1
4097 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT25]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST18]], i32 1
4098 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE26:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT24]], [[TMP32]]
4099 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE26]], label [[OMP_ARRAYCPY_DONE27]], label [[OMP_ARRAYCPY_BODY17]]
4100 // CHECK1: omp.arraycpy.done27:
4101 // CHECK1-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP29]], ptr @.gomp_critical_user_.reduction.var)
4102 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
4103 // CHECK1: .omp.reduction.default:
4104 // CHECK1-NEXT: [[ARRAY_BEGIN28:%.*]] = getelementptr inbounds [40 x %struct.S.0], ptr [[ARR4]], i32 0, i32 0
4105 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAY_BEGIN28]], i64 40
4106 // CHECK1-NEXT: br label [[ARRAYDESTROY_BODY:%.*]]
4107 // CHECK1: arraydestroy.body:
4108 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENTPAST:%.*]] = phi ptr [ [[TMP35]], [[DOTOMP_REDUCTION_DEFAULT]] ], [ [[ARRAYDESTROY_ELEMENT:%.*]], [[ARRAYDESTROY_BODY]] ]
4109 // CHECK1-NEXT: [[ARRAYDESTROY_ELEMENT]] = getelementptr inbounds [[STRUCT_S_0]], ptr [[ARRAYDESTROY_ELEMENTPAST]], i64 -1
4110 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[ARRAYDESTROY_ELEMENT]]) #[[ATTR5]]
4111 // CHECK1-NEXT: [[ARRAYDESTROY_DONE:%.*]] = icmp eq ptr [[ARRAYDESTROY_ELEMENT]], [[ARRAY_BEGIN28]]
4112 // CHECK1-NEXT: br i1 [[ARRAYDESTROY_DONE]], label [[ARRAYDESTROY_DONE29:%.*]], label [[ARRAYDESTROY_BODY]]
4113 // CHECK1: arraydestroy.done29:
4114 // CHECK1-NEXT: [[TMP36:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4115 // CHECK1-NEXT: [[TMP37:%.*]] = load i32, ptr [[TMP36]], align 4
4116 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB4]], i32 [[TMP37]])
4117 // CHECK1-NEXT: ret void
4120 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiLi42EET_v.omp_outlined.14.omp.reduction.reduction_func
4121 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR6]] {
4122 // CHECK1-NEXT: entry:
4123 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
4124 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
4125 // CHECK1-NEXT: [[REF_TMP:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4
4126 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
4127 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
4128 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
4129 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
4130 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i64 0, i64 0
4131 // CHECK1-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
4132 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP2]], i64 0, i64 0
4133 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
4134 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr [[STRUCT_S_0]], ptr [[TMP7]], i64 40
4135 // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq ptr [[TMP7]], [[TMP8]]
4136 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE3:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
4137 // CHECK1: omp.arraycpy.body:
4138 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi ptr [ [[TMP5]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
4139 // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi ptr [ [[TMP7]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
4140 // CHECK1-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN1SIiEcviEv(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_DESTELEMENTPAST]])
4141 // CHECK1-NEXT: [[CALL2:%.*]] = call noundef i32 @_ZN1SIiEcviEv(ptr noundef nonnull align 4 dereferenceable(4) [[OMP_ARRAYCPY_SRCELEMENTPAST]])
4142 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL]], [[CALL2]]
4143 // CHECK1-NEXT: call void @_ZN1SIiEC1Ei(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP]], i32 noundef [[ADD]])
4144 // CHECK1-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[OMP_ARRAYCPY_DESTELEMENTPAST]], ptr align 4 [[REF_TMP]], i64 4, i1 false)
4145 // CHECK1-NEXT: call void @_ZN1SIiED1Ev(ptr noundef nonnull align 4 dereferenceable(4) [[REF_TMP]]) #[[ATTR5]]
4146 // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
4147 // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr [[STRUCT_S_0]], ptr [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
4148 // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq ptr [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP8]]
4149 // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE3]], label [[OMP_ARRAYCPY_BODY]]
4150 // CHECK1: omp.arraycpy.done3:
4151 // CHECK1-NEXT: ret void
4154 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ev
4155 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] align 2 {
4156 // CHECK1-NEXT: entry:
4157 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
4158 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
4159 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
4160 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
4161 // CHECK1-NEXT: [[TMP0:%.*]] = load volatile double, ptr @g, align 8
4162 // CHECK1-NEXT: [[CONV:%.*]] = fptosi double [[TMP0]] to i32
4163 // CHECK1-NEXT: store i32 [[CONV]], ptr [[F]], align 4
4164 // CHECK1-NEXT: ret void
4167 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiEC2Ei
4168 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]], i32 noundef [[A:%.*]]) unnamed_addr #[[ATTR1]] align 2 {
4169 // CHECK1-NEXT: entry:
4170 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
4171 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4172 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
4173 // CHECK1-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4174 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
4175 // CHECK1-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_S_0:%.*]], ptr [[THIS1]], i32 0, i32 0
4176 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
4177 // CHECK1-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP0]] to double
4178 // CHECK1-NEXT: [[TMP1:%.*]] = load volatile double, ptr @g, align 8
4179 // CHECK1-NEXT: [[ADD:%.*]] = fadd double [[CONV]], [[TMP1]]
4180 // CHECK1-NEXT: [[CONV2:%.*]] = fptosi double [[ADD]] to i32
4181 // CHECK1-NEXT: store i32 [[CONV2]], ptr [[F]], align 4
4182 // CHECK1-NEXT: ret void
4185 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SIiED2Ev
4186 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[THIS:%.*]]) unnamed_addr #[[ATTR1]] align 2 {
4187 // CHECK1-NEXT: entry:
4188 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
4189 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
4190 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
4191 // CHECK1-NEXT: ret void
4194 // CHECK3-LABEL: define {{[^@]+}}@main
4195 // CHECK3-SAME: () #[[ATTR0:[0-9]+]] {
4196 // CHECK3-NEXT: entry:
4197 // CHECK3-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
4198 // CHECK3-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_ANON:%.*]], align 1
4199 // CHECK3-NEXT: store i32 0, ptr [[RETVAL]], align 4
4200 // CHECK3-NEXT: call void @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1) [[REF_TMP]])
4201 // CHECK3-NEXT: ret i32 0
4204 // CHECK4-LABEL: define {{[^@]+}}@main
4205 // CHECK4-SAME: () #[[ATTR1:[0-9]+]] {
4206 // CHECK4-NEXT: entry:
4207 // CHECK4-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
4208 // CHECK4-NEXT: store i32 0, ptr [[RETVAL]], align 4
4209 // CHECK4-NEXT: [[TMP0:%.*]] = load ptr, ptr getelementptr inbounds ([[STRUCT___BLOCK_LITERAL_GENERIC:%.*]], ptr @__block_literal_global, i32 0, i32 3), align 8
4210 // CHECK4-NEXT: call void [[TMP0]](ptr noundef @__block_literal_global)
4211 // CHECK4-NEXT: ret i32 0
4214 // CHECK4-LABEL: define {{[^@]+}}@__main_block_invoke
4215 // CHECK4-SAME: (ptr noundef [[DOTBLOCK_DESCRIPTOR:%.*]]) #[[ATTR2:[0-9]+]] {
4216 // CHECK4-NEXT: entry:
4217 // CHECK4-NEXT: [[DOTBLOCK_DESCRIPTOR_ADDR:%.*]] = alloca ptr, align 8
4218 // CHECK4-NEXT: [[BLOCK_ADDR:%.*]] = alloca ptr, align 8
4219 // CHECK4-NEXT: store ptr [[DOTBLOCK_DESCRIPTOR]], ptr [[DOTBLOCK_DESCRIPTOR_ADDR]], align 8
4220 // CHECK4-NEXT: store ptr [[DOTBLOCK_DESCRIPTOR]], ptr [[BLOCK_ADDR]], align 8
4221 // CHECK4-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB4:[0-9]+]], i32 0, ptr @__main_block_invoke.omp_outlined)
4222 // CHECK4-NEXT: ret void
4225 // CHECK4-LABEL: define {{[^@]+}}@__main_block_invoke.omp_outlined
4226 // CHECK4-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR3:[0-9]+]] {
4227 // CHECK4-NEXT: entry:
4228 // CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4229 // CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4230 // CHECK4-NEXT: [[TMP:%.*]] = alloca ptr, align 8
4231 // CHECK4-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4232 // CHECK4-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
4233 // CHECK4-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4234 // CHECK4-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4235 // CHECK4-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4236 // CHECK4-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4237 // CHECK4-NEXT: [[G:%.*]] = alloca double, align 8
4238 // CHECK4-NEXT: [[G1:%.*]] = alloca double, align 8
4239 // CHECK4-NEXT: [[_TMP2:%.*]] = alloca ptr, align 8
4240 // CHECK4-NEXT: [[I:%.*]] = alloca i32, align 4
4241 // CHECK4-NEXT: [[BLOCK:%.*]] = alloca <{ ptr, i32, i32, ptr, ptr, double, ptr }>, align 8
4242 // CHECK4-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 8
4243 // CHECK4-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4244 // CHECK4-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4245 // CHECK4-NEXT: [[TMP0:%.*]] = load ptr, ptr @g1, align 8
4246 // CHECK4-NEXT: store ptr [[TMP0]], ptr [[TMP]], align 8
4247 // CHECK4-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4248 // CHECK4-NEXT: store i32 1, ptr [[DOTOMP_UB]], align 4
4249 // CHECK4-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4250 // CHECK4-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4251 // CHECK4-NEXT: store double 0.000000e+00, ptr [[G]], align 8
4252 // CHECK4-NEXT: [[TMP1:%.*]] = load ptr, ptr @g1, align 8
4253 // CHECK4-NEXT: store double 0.000000e+00, ptr [[G1]], align 8
4254 // CHECK4-NEXT: store ptr [[G1]], ptr [[_TMP2]], align 8
4255 // CHECK4-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4256 // CHECK4-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
4257 // CHECK4-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4258 // CHECK4-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4259 // CHECK4-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 1
4260 // CHECK4-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4261 // CHECK4: cond.true:
4262 // CHECK4-NEXT: br label [[COND_END:%.*]]
4263 // CHECK4: cond.false:
4264 // CHECK4-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4265 // CHECK4-NEXT: br label [[COND_END]]
4266 // CHECK4: cond.end:
4267 // CHECK4-NEXT: [[COND:%.*]] = phi i32 [ 1, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
4268 // CHECK4-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4269 // CHECK4-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4270 // CHECK4-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
4271 // CHECK4-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4272 // CHECK4: omp.inner.for.cond:
4273 // CHECK4-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4274 // CHECK4-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4275 // CHECK4-NEXT: [[CMP3:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
4276 // CHECK4-NEXT: br i1 [[CMP3]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4277 // CHECK4: omp.inner.for.body:
4278 // CHECK4-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4279 // CHECK4-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
4280 // CHECK4-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4281 // CHECK4-NEXT: store i32 [[ADD]], ptr [[I]], align 4
4282 // CHECK4-NEXT: store double 1.000000e+00, ptr [[G]], align 8
4283 // CHECK4-NEXT: [[TMP10:%.*]] = load ptr, ptr [[_TMP2]], align 8
4284 // CHECK4-NEXT: store volatile double 1.000000e+00, ptr [[TMP10]], align 8
4285 // CHECK4-NEXT: [[BLOCK_ISA:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, double, ptr }>, ptr [[BLOCK]], i32 0, i32 0
4286 // CHECK4-NEXT: store ptr @_NSConcreteStackBlock, ptr [[BLOCK_ISA]], align 8
4287 // CHECK4-NEXT: [[BLOCK_FLAGS:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, double, ptr }>, ptr [[BLOCK]], i32 0, i32 1
4288 // CHECK4-NEXT: store i32 1073741824, ptr [[BLOCK_FLAGS]], align 8
4289 // CHECK4-NEXT: [[BLOCK_RESERVED:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, double, ptr }>, ptr [[BLOCK]], i32 0, i32 2
4290 // CHECK4-NEXT: store i32 0, ptr [[BLOCK_RESERVED]], align 4
4291 // CHECK4-NEXT: [[BLOCK_INVOKE:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, double, ptr }>, ptr [[BLOCK]], i32 0, i32 3
4292 // CHECK4-NEXT: store ptr @g1_block_invoke, ptr [[BLOCK_INVOKE]], align 8
4293 // CHECK4-NEXT: [[BLOCK_DESCRIPTOR:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, double, ptr }>, ptr [[BLOCK]], i32 0, i32 4
4294 // CHECK4-NEXT: store ptr @__block_descriptor_tmp.1, ptr [[BLOCK_DESCRIPTOR]], align 8
4295 // CHECK4-NEXT: [[BLOCK_CAPTURED:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, double, ptr }>, ptr [[BLOCK]], i32 0, i32 5
4296 // CHECK4-NEXT: [[TMP11:%.*]] = load volatile double, ptr [[G]], align 8
4297 // CHECK4-NEXT: store volatile double [[TMP11]], ptr [[BLOCK_CAPTURED]], align 8
4298 // CHECK4-NEXT: [[BLOCK_CAPTURED4:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, double, ptr }>, ptr [[BLOCK]], i32 0, i32 6
4299 // CHECK4-NEXT: [[TMP12:%.*]] = load ptr, ptr [[_TMP2]], align 8
4300 // CHECK4-NEXT: store ptr [[TMP12]], ptr [[BLOCK_CAPTURED4]], align 8
4301 // CHECK4-NEXT: [[TMP13:%.*]] = getelementptr inbounds [[STRUCT___BLOCK_LITERAL_GENERIC:%.*]], ptr [[BLOCK]], i32 0, i32 3
4302 // CHECK4-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP13]], align 8
4303 // CHECK4-NEXT: call void [[TMP14]](ptr noundef [[BLOCK]])
4304 // CHECK4-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4305 // CHECK4: omp.body.continue:
4306 // CHECK4-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4307 // CHECK4: omp.inner.for.inc:
4308 // CHECK4-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4309 // CHECK4-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP15]], 1
4310 // CHECK4-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4
4311 // CHECK4-NEXT: br label [[OMP_INNER_FOR_COND]]
4312 // CHECK4: omp.inner.for.end:
4313 // CHECK4-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4314 // CHECK4: omp.loop.exit:
4315 // CHECK4-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
4316 // CHECK4-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
4317 // CHECK4-NEXT: store ptr [[G]], ptr [[TMP16]], align 8
4318 // CHECK4-NEXT: [[TMP17:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
4319 // CHECK4-NEXT: store ptr [[G1]], ptr [[TMP17]], align 8
4320 // CHECK4-NEXT: [[TMP18:%.*]] = call i32 @__kmpc_reduce(ptr @[[GLOB2:[0-9]+]], i32 [[TMP3]], i32 2, i64 16, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @__main_block_invoke.omp_outlined.omp.reduction.reduction_func, ptr @.gomp_critical_user_.reduction.var)
4321 // CHECK4-NEXT: switch i32 [[TMP18]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
4322 // CHECK4-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
4323 // CHECK4-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
4324 // CHECK4-NEXT: ]
4325 // CHECK4: .omp.reduction.case1:
4326 // CHECK4-NEXT: [[TMP19:%.*]] = load double, ptr @g, align 8
4327 // CHECK4-NEXT: [[TMP20:%.*]] = load double, ptr [[G]], align 8
4328 // CHECK4-NEXT: [[ADD6:%.*]] = fadd double [[TMP19]], [[TMP20]]
4329 // CHECK4-NEXT: store double [[ADD6]], ptr @g, align 8
4330 // CHECK4-NEXT: [[TMP21:%.*]] = load double, ptr [[TMP1]], align 8
4331 // CHECK4-NEXT: [[TMP22:%.*]] = load double, ptr [[G1]], align 8
4332 // CHECK4-NEXT: [[ADD7:%.*]] = fadd double [[TMP21]], [[TMP22]]
4333 // CHECK4-NEXT: store double [[ADD7]], ptr [[TMP1]], align 8
4334 // CHECK4-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP3]], ptr @.gomp_critical_user_.reduction.var)
4335 // CHECK4-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
4336 // CHECK4: .omp.reduction.case2:
4337 // CHECK4-NEXT: [[TMP23:%.*]] = load double, ptr [[G]], align 8
4338 // CHECK4-NEXT: [[TMP24:%.*]] = atomicrmw fadd ptr @g, double [[TMP23]] monotonic, align 8
4339 // CHECK4-NEXT: [[TMP25:%.*]] = load double, ptr [[G1]], align 8
4340 // CHECK4-NEXT: [[TMP26:%.*]] = atomicrmw fadd ptr [[TMP1]], double [[TMP25]] monotonic, align 8
4341 // CHECK4-NEXT: call void @__kmpc_end_reduce(ptr @[[GLOB2]], i32 [[TMP3]], ptr @.gomp_critical_user_.reduction.var)
4342 // CHECK4-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]]
4343 // CHECK4: .omp.reduction.default:
4344 // CHECK4-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[TMP3]])
4345 // CHECK4-NEXT: ret void
4348 // CHECK4-LABEL: define {{[^@]+}}@g1_block_invoke
4349 // CHECK4-SAME: (ptr noundef [[DOTBLOCK_DESCRIPTOR:%.*]]) #[[ATTR2]] {
4350 // CHECK4-NEXT: entry:
4351 // CHECK4-NEXT: [[DOTBLOCK_DESCRIPTOR_ADDR:%.*]] = alloca ptr, align 8
4352 // CHECK4-NEXT: [[BLOCK_ADDR:%.*]] = alloca ptr, align 8
4353 // CHECK4-NEXT: store ptr [[DOTBLOCK_DESCRIPTOR]], ptr [[DOTBLOCK_DESCRIPTOR_ADDR]], align 8
4354 // CHECK4-NEXT: store ptr [[DOTBLOCK_DESCRIPTOR]], ptr [[BLOCK_ADDR]], align 8
4355 // CHECK4-NEXT: [[BLOCK_CAPTURE_ADDR:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, double, ptr }>, ptr [[DOTBLOCK_DESCRIPTOR]], i32 0, i32 5
4356 // CHECK4-NEXT: store double 2.000000e+00, ptr [[BLOCK_CAPTURE_ADDR]], align 8
4357 // CHECK4-NEXT: [[BLOCK_CAPTURE_ADDR1:%.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, double, ptr }>, ptr [[DOTBLOCK_DESCRIPTOR]], i32 0, i32 6
4358 // CHECK4-NEXT: [[TMP0:%.*]] = load ptr, ptr [[BLOCK_CAPTURE_ADDR1]], align 8
4359 // CHECK4-NEXT: store double 2.000000e+00, ptr [[TMP0]], align 8
4360 // CHECK4-NEXT: ret void
4363 // CHECK4-LABEL: define {{[^@]+}}@__main_block_invoke.omp_outlined.omp.reduction.reduction_func
4364 // CHECK4-SAME: (ptr noundef [[TMP0:%.*]], ptr noundef [[TMP1:%.*]]) #[[ATTR5:[0-9]+]] {
4365 // CHECK4-NEXT: entry:
4366 // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
4367 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca ptr, align 8
4368 // CHECK4-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
4369 // CHECK4-NEXT: store ptr [[TMP1]], ptr [[DOTADDR1]], align 8
4370 // CHECK4-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTADDR]], align 8
4371 // CHECK4-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR1]], align 8
4372 // CHECK4-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i64 0, i64 0
4373 // CHECK4-NEXT: [[TMP5:%.*]] = load ptr, ptr [[TMP4]], align 8
4374 // CHECK4-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP2]], i64 0, i64 0
4375 // CHECK4-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
4376 // CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i64 0, i64 1
4377 // CHECK4-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 8
4378 // CHECK4-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP2]], i64 0, i64 1
4379 // CHECK4-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 8
4380 // CHECK4-NEXT: [[TMP12:%.*]] = load double, ptr [[TMP7]], align 8
4381 // CHECK4-NEXT: [[TMP13:%.*]] = load double, ptr [[TMP5]], align 8
4382 // CHECK4-NEXT: [[ADD:%.*]] = fadd double [[TMP12]], [[TMP13]]
4383 // CHECK4-NEXT: store double [[ADD]], ptr [[TMP7]], align 8
4384 // CHECK4-NEXT: [[TMP14:%.*]] = load double, ptr [[TMP11]], align 8
4385 // CHECK4-NEXT: [[TMP15:%.*]] = load double, ptr [[TMP9]], align 8
4386 // CHECK4-NEXT: [[ADD2:%.*]] = fadd double [[TMP14]], [[TMP15]]
4387 // CHECK4-NEXT: store double [[ADD2]], ptr [[TMP11]], align 8
4388 // CHECK4-NEXT: ret void