1207b08a9SGiorgis Georgakoudis // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _
2532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix=CHECK1
3532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s
4b52d33e6SJohannes Doerfert // RUN: %clang_cc1 -no-opaque-pointers -fopenmp -x c++ -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK1
58c2f4e0eSAlexey Bataev 
6532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-unknown-linux -verify -fopenmp-simd -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
7532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
8532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
98c2f4e0eSAlexey Bataev // expected-no-diagnostics
108c2f4e0eSAlexey Bataev #ifndef HEADER
118c2f4e0eSAlexey Bataev #define HEADER
128c2f4e0eSAlexey Bataev 
main(int argc,char ** argv)138c2f4e0eSAlexey Bataev int main(int argc, char **argv) {
148c2f4e0eSAlexey Bataev #pragma omp target teams
158c2f4e0eSAlexey Bataev #pragma omp distribute parallel for reduction(task, +: argc, argv[0:10][0:argc])
168c2f4e0eSAlexey Bataev   for (long long i = 0; i < 10; ++i) {
178c2f4e0eSAlexey Bataev #pragma omp task in_reduction(+: argc, argv[0:10][0:argc])
188c2f4e0eSAlexey Bataev     ;
198c2f4e0eSAlexey Bataev   }
208c2f4e0eSAlexey Bataev }
218c2f4e0eSAlexey Bataev 
228c2f4e0eSAlexey Bataev 
238c2f4e0eSAlexey Bataev 
248c2f4e0eSAlexey Bataev // Init firstprivate copy of argc
258c2f4e0eSAlexey Bataev 
268c2f4e0eSAlexey Bataev // Init firstprivate copy of argv[0:10][0:argc]
278c2f4e0eSAlexey Bataev 
288c2f4e0eSAlexey Bataev // Register task reduction.
298c2f4e0eSAlexey Bataev 
308c2f4e0eSAlexey Bataev 
318c2f4e0eSAlexey Bataev 
328c2f4e0eSAlexey Bataev 
338c2f4e0eSAlexey Bataev 
348c2f4e0eSAlexey Bataev 
358c2f4e0eSAlexey Bataev 
368c2f4e0eSAlexey Bataev 
378c2f4e0eSAlexey Bataev 
388c2f4e0eSAlexey Bataev #endif
39207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@main
401b1c8d83Shyeongyu kim // CHECK1-SAME: (i32 noundef [[ARGC:%.*]], i8** noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
41207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
42207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGC_ADDR:%.*]] = alloca i32, align 4
43207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGV_ADDR:%.*]] = alloca i8**, align 8
44207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGC_CASTED:%.*]] = alloca i64, align 8
45207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 [[ARGC]], i32* [[ARGC_ADDR]], align 4
46207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[ARGV]], i8*** [[ARGV_ADDR]], align 8
47207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP0:%.*]] = load i32, i32* [[ARGC_ADDR]], align 4
48207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV:%.*]] = bitcast i64* [[ARGC_CASTED]] to i32*
49207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 [[TMP0]], i32* [[CONV]], align 4
50207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP1:%.*]] = load i64, i64* [[ARGC_CASTED]], align 8
51207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i8**, i8*** [[ARGV_ADDR]], align 8
52207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l14(i64 [[TMP1]], i8** [[TMP2]]) #[[ATTR5:[0-9]+]]
53207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret i32 0
54207b08a9SGiorgis Georgakoudis //
55207b08a9SGiorgis Georgakoudis //
56207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l14
571b1c8d83Shyeongyu kim // CHECK1-SAME: (i64 noundef [[ARGC:%.*]], i8** noundef [[ARGV:%.*]]) #[[ATTR1:[0-9]+]] {
58207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
59207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGC_ADDR:%.*]] = alloca i64, align 8
60207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGV_ADDR:%.*]] = alloca i8**, align 8
61ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGC_CASTED:%.*]] = alloca i64, align 8
62207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[ARGC]], i64* [[ARGC_ADDR]], align 8
63207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[ARGV]], i8*** [[ARGV_ADDR]], align 8
64207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV:%.*]] = bitcast i64* [[ARGC_ADDR]] to i32*
651201a0f3SNikita Popov // CHECK1-NEXT:    [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
66ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV1:%.*]] = bitcast i64* [[ARGC_CASTED]] to i32*
67ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 [[TMP0]], i32* [[CONV1]], align 4
68ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP1:%.*]] = load i64, i64* [[ARGC_CASTED]], align 8
69ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i8**, i8*** [[ARGV_ADDR]], align 8
70ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i8**)* @.omp_outlined. to void (i32*, i32*, ...)*), i64 [[TMP1]], i8** [[TMP2]])
71207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
72207b08a9SGiorgis Georgakoudis //
73207b08a9SGiorgis Georgakoudis //
74207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.omp_outlined.
751b1c8d83Shyeongyu kim // CHECK1-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[ARGC:%.*]], i8** noundef [[ARGV:%.*]]) #[[ATTR1]] {
76207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
77207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
78207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
79ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGC_ADDR:%.*]] = alloca i64, align 8
80ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGV_ADDR:%.*]] = alloca i8**, align 8
81207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_IV:%.*]] = alloca i64, align 8
82207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP:%.*]] = alloca i64, align 8
83207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_COMB_LB:%.*]] = alloca i64, align 8
84207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_COMB_UB:%.*]] = alloca i64, align 8
85207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i64, align 8
86207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
87207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[I:%.*]] = alloca i64, align 8
88207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
89207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
90ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[ARGC]], i64* [[ARGC_ADDR]], align 8
91ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[ARGV]], i8*** [[ARGV_ADDR]], align 8
92ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV:%.*]] = bitcast i64* [[ARGC_ADDR]] to i32*
93207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 0, i64* [[DOTOMP_COMB_LB]], align 8
94207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 9, i64* [[DOTOMP_COMB_UB]], align 8
95207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 1, i64* [[DOTOMP_STRIDE]], align 8
96207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
97ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
98ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
99ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    call void @__kmpc_for_static_init_8(%struct.ident_t* @[[GLOB1:[0-9]+]], i32 [[TMP1]], i32 92, i32* [[DOTOMP_IS_LAST]], i64* [[DOTOMP_COMB_LB]], i64* [[DOTOMP_COMB_UB]], i64* [[DOTOMP_STRIDE]], i64 1, i64 1)
100ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i64, i64* [[DOTOMP_COMB_UB]], align 8
101ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[CMP:%.*]] = icmp sgt i64 [[TMP2]], 9
102207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
103207b08a9SGiorgis Georgakoudis // CHECK1:       cond.true:
104207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[COND_END:%.*]]
105207b08a9SGiorgis Georgakoudis // CHECK1:       cond.false:
106ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = load i64, i64* [[DOTOMP_COMB_UB]], align 8
107207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[COND_END]]
108207b08a9SGiorgis Georgakoudis // CHECK1:       cond.end:
109ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[COND:%.*]] = phi i64 [ 9, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
110207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[COND]], i64* [[DOTOMP_COMB_UB]], align 8
111ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = load i64, i64* [[DOTOMP_COMB_LB]], align 8
112ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[TMP4]], i64* [[DOTOMP_IV]], align 8
113207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
114207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.cond:
115ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP5:%.*]] = load i64, i64* [[DOTOMP_IV]], align 8
116ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP6:%.*]] = load i64, i64* [[DOTOMP_COMB_UB]], align 8
117ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[CMP1:%.*]] = icmp sle i64 [[TMP5]], [[TMP6]]
118207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
119207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.body:
120ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP7:%.*]] = load i64, i64* [[DOTOMP_COMB_LB]], align 8
121ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP8:%.*]] = load i64, i64* [[DOTOMP_COMB_UB]], align 8
122ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP9:%.*]] = load i8**, i8*** [[ARGV_ADDR]], align 8
123ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB2]], i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64, i32*, i8**)* @.omp_outlined..1 to void (i32*, i32*, ...)*), i64 [[TMP7]], i64 [[TMP8]], i32* [[CONV]], i8** [[TMP9]])
124207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
125207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.inc:
126ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP10:%.*]] = load i64, i64* [[DOTOMP_IV]], align 8
127ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP11:%.*]] = load i64, i64* [[DOTOMP_STRIDE]], align 8
128ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD:%.*]] = add nsw i64 [[TMP10]], [[TMP11]]
129207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[ADD]], i64* [[DOTOMP_IV]], align 8
130207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_INNER_FOR_COND]]
131207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.end:
132207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
133207b08a9SGiorgis Georgakoudis // CHECK1:       omp.loop.exit:
134ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]])
135207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
136207b08a9SGiorgis Georgakoudis //
137207b08a9SGiorgis Georgakoudis //
138207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.omp_outlined..1
1391b1c8d83Shyeongyu kim // CHECK1-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], i32* noundef nonnull align 4 dereferenceable(4) [[ARGC:%.*]], i8** noundef [[ARGV:%.*]]) #[[ATTR1]] {
140207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
141207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
142207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
143ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
144ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
145ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGC_ADDR:%.*]] = alloca i32*, align 8
146ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGV_ADDR:%.*]] = alloca i8**, align 8
147207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_IV:%.*]] = alloca i64, align 8
148207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP:%.*]] = alloca i64, align 8
149207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_LB:%.*]] = alloca i64, align 8
150207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_UB:%.*]] = alloca i64, align 8
151207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i64, align 8
152207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
153ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGC1:%.*]] = alloca i32, align 4
154207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[SAVED_STACK:%.*]] = alloca i8*, align 8
155207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[__VLA_EXPR0:%.*]] = alloca i64, align 8
156ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[_TMP5:%.*]] = alloca i8**, align 8
157ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[_TMP6:%.*]] = alloca i8*, align 8
158207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTRD_INPUT_:%.*]] = alloca [2 x %struct.kmp_taskred_input_t], align 8
159207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTTASK_RED_:%.*]] = alloca i8*, align 8
160207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[I:%.*]] = alloca i64, align 8
161ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[AGG_CAPTURED:%.*]] = alloca [[STRUCT_ANON:%.*]], align 8
162207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [3 x i8*], align 8
163207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ATOMIC_TEMP:%.*]] = alloca i8, align 1
164ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[_TMP28:%.*]] = alloca i8, align 1
165207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
166207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
167ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[DOTPREVIOUS_LB_]], i64* [[DOTPREVIOUS_LB__ADDR]], align 8
168ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[DOTPREVIOUS_UB_]], i64* [[DOTPREVIOUS_UB__ADDR]], align 8
169ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i32* [[ARGC]], i32** [[ARGC_ADDR]], align 8
170ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[ARGV]], i8*** [[ARGV_ADDR]], align 8
171ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[ARGC_ADDR]], align 8
172207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 0, i64* [[DOTOMP_LB]], align 8
173207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 9, i64* [[DOTOMP_UB]], align 8
174ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP1:%.*]] = load i64, i64* [[DOTPREVIOUS_LB__ADDR]], align 8
175ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i64, i64* [[DOTPREVIOUS_UB__ADDR]], align 8
176ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[TMP1]], i64* [[DOTOMP_LB]], align 8
177ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[TMP2]], i64* [[DOTOMP_UB]], align 8
178207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 1, i64* [[DOTOMP_STRIDE]], align 8
179207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
180ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 0, i32* [[ARGC1]], align 4
181ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = load i8**, i8*** [[ARGV_ADDR]], align 8
182ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds i8*, i8** [[TMP3]], i64 0
183ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[ARRAYIDX]], align 8
184ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX2:%.*]] = getelementptr inbounds i8, i8* [[TMP4]], i64 0
185ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP5:%.*]] = load i32, i32* [[TMP0]], align 4
186ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP6:%.*]] = sext i32 [[TMP5]] to i64
187ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[LB_ADD_LEN:%.*]] = add nsw i64 -1, [[TMP6]]
188ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP7:%.*]] = load i8**, i8*** [[ARGV_ADDR]], align 8
189ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX3:%.*]] = getelementptr inbounds i8*, i8** [[TMP7]], i64 9
190ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP8:%.*]] = load i8*, i8** [[ARRAYIDX3]], align 8
191ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX4:%.*]] = getelementptr inbounds i8, i8* [[TMP8]], i64 [[LB_ADD_LEN]]
192ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP9:%.*]] = ptrtoint i8* [[ARRAYIDX4]] to i64
193ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP10:%.*]] = ptrtoint i8* [[ARRAYIDX2]] to i64
194ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP11:%.*]] = sub i64 [[TMP9]], [[TMP10]]
195ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP12:%.*]] = sdiv exact i64 [[TMP11]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
196ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP13:%.*]] = add nuw i64 [[TMP12]], 1
197ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP14:%.*]] = mul nuw i64 [[TMP13]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
198ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP15:%.*]] = call i8* @llvm.stacksave()
199ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP15]], i8** [[SAVED_STACK]], align 8
200ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[VLA:%.*]] = alloca i8, i64 [[TMP13]], align 16
201ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[TMP13]], i64* [[__VLA_EXPR0]], align 8
202ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP16:%.*]] = getelementptr i8, i8* [[VLA]], i64 [[TMP13]]
203ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq i8* [[VLA]], [[TMP16]]
204207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
205207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arrayinit.body:
206207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[VLA]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
207207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 0, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
208207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
209ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP16]]
210207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
211207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arrayinit.done:
212ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP17:%.*]] = load i8**, i8*** [[ARGV_ADDR]], align 8
213ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP18:%.*]] = load i8*, i8** [[TMP17]], align 8
214ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP19:%.*]] = ptrtoint i8* [[TMP18]] to i64
215ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP20:%.*]] = ptrtoint i8* [[ARRAYIDX2]] to i64
216ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP21:%.*]] = sub i64 [[TMP19]], [[TMP20]]
217ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP22:%.*]] = sdiv exact i64 [[TMP21]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
218ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP23:%.*]] = getelementptr i8, i8* [[VLA]], i64 [[TMP22]]
219ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[_TMP6]], i8*** [[_TMP5]], align 8
220ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP23]], i8** [[_TMP6]], align 8
221207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTRD_INPUT_GEP_:%.*]] = getelementptr inbounds [2 x %struct.kmp_taskred_input_t], [2 x %struct.kmp_taskred_input_t]* [[DOTRD_INPUT_]], i64 0, i64 0
222ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP24:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T:%.*]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 0
223ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP25:%.*]] = bitcast i32* [[ARGC1]] to i8*
224ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP25]], i8** [[TMP24]], align 8
225ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP26:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 1
226ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP27:%.*]] = bitcast i32* [[TMP0]] to i8*
227ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP27]], i8** [[TMP26]], align 8
228ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP28:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 2
229ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 4, i64* [[TMP28]], align 8
230ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP29:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 3
231ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* bitcast (void (i8*, i8*)* @.red_init. to i8*), i8** [[TMP29]], align 8
232ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP30:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 4
233ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* null, i8** [[TMP30]], align 8
234ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP31:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 5
235ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* bitcast (void (i8*, i8*)* @.red_comb. to i8*), i8** [[TMP31]], align 8
236ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP32:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 6
237ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP33:%.*]] = bitcast i32* [[TMP32]] to i8*
238ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP33]], i8 0, i64 4, i1 false)
239ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTRD_INPUT_GEP_7:%.*]] = getelementptr inbounds [2 x %struct.kmp_taskred_input_t], [2 x %struct.kmp_taskred_input_t]* [[DOTRD_INPUT_]], i64 0, i64 1
240ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP34:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 0
241ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP35:%.*]] = load i8**, i8*** [[ARGV_ADDR]], align 8
242ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds i8*, i8** [[TMP35]], i64 0
243ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP36:%.*]] = load i8*, i8** [[ARRAYIDX8]], align 8
244ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX9:%.*]] = getelementptr inbounds i8, i8* [[TMP36]], i64 0
245ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP37:%.*]] = load i32, i32* [[TMP0]], align 4
246ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP38:%.*]] = sext i32 [[TMP37]] to i64
247ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[LB_ADD_LEN10:%.*]] = add nsw i64 -1, [[TMP38]]
248ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP39:%.*]] = load i8**, i8*** [[ARGV_ADDR]], align 8
249ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX11:%.*]] = getelementptr inbounds i8*, i8** [[TMP39]], i64 9
250ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP40:%.*]] = load i8*, i8** [[ARRAYIDX11]], align 8
251ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX12:%.*]] = getelementptr inbounds i8, i8* [[TMP40]], i64 [[LB_ADD_LEN10]]
252ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[VLA]], i8** [[TMP34]], align 8
253ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP41:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 1
254ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[ARRAYIDX9]], i8** [[TMP41]], align 8
255ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP42:%.*]] = ptrtoint i8* [[ARRAYIDX12]] to i64
256ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP43:%.*]] = ptrtoint i8* [[ARRAYIDX9]] to i64
257ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP44:%.*]] = sub i64 [[TMP42]], [[TMP43]]
258ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP45:%.*]] = sdiv exact i64 [[TMP44]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
259ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP46:%.*]] = add nuw i64 [[TMP45]], 1
260ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP47:%.*]] = mul nuw i64 [[TMP46]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
261ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP48:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 2
262ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[TMP47]], i64* [[TMP48]], align 8
263ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP49:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 3
264ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* bitcast (void (i8*, i8*)* @.red_init..2 to i8*), i8** [[TMP49]], align 8
265ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP50:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 4
266ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* null, i8** [[TMP50]], align 8
267ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP51:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 5
268ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* bitcast (void (i8*, i8*)* @.red_comb..3 to i8*), i8** [[TMP51]], align 8
269ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP52:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 6
270ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 1, i32* [[TMP52]], align 8
271ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP53:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
272ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP54:%.*]] = load i32, i32* [[TMP53]], align 4
273ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP55:%.*]] = bitcast [2 x %struct.kmp_taskred_input_t]* [[DOTRD_INPUT_]] to i8*
274ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP56:%.*]] = call i8* @__kmpc_taskred_modifier_init(%struct.ident_t* @[[GLOB2]], i32 [[TMP54]], i32 1, i32 2, i8* [[TMP55]])
275ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP56]], i8** [[DOTTASK_RED_]], align 8
276ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP57:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
277ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP58:%.*]] = load i32, i32* [[TMP57]], align 4
278ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    call void @__kmpc_for_static_init_8(%struct.ident_t* @[[GLOB3:[0-9]+]], i32 [[TMP58]], i32 34, i32* [[DOTOMP_IS_LAST]], i64* [[DOTOMP_LB]], i64* [[DOTOMP_UB]], i64* [[DOTOMP_STRIDE]], i64 1, i64 1)
279ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP59:%.*]] = load i64, i64* [[DOTOMP_UB]], align 8
280ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[CMP:%.*]] = icmp sgt i64 [[TMP59]], 9
281207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
282207b08a9SGiorgis Georgakoudis // CHECK1:       cond.true:
283207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[COND_END:%.*]]
284207b08a9SGiorgis Georgakoudis // CHECK1:       cond.false:
285ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP60:%.*]] = load i64, i64* [[DOTOMP_UB]], align 8
286207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[COND_END]]
287207b08a9SGiorgis Georgakoudis // CHECK1:       cond.end:
288ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[COND:%.*]] = phi i64 [ 9, [[COND_TRUE]] ], [ [[TMP60]], [[COND_FALSE]] ]
289207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[COND]], i64* [[DOTOMP_UB]], align 8
290ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP61:%.*]] = load i64, i64* [[DOTOMP_LB]], align 8
291ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[TMP61]], i64* [[DOTOMP_IV]], align 8
292207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
293207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.cond:
294ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP62:%.*]] = load i64, i64* [[DOTOMP_IV]], align 8
295ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP63:%.*]] = load i64, i64* [[DOTOMP_UB]], align 8
296ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[CMP13:%.*]] = icmp sle i64 [[TMP62]], [[TMP63]]
297ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[CMP13]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
298207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.cond.cleanup:
299207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_INNER_FOR_END:%.*]]
300207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.body:
301ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP64:%.*]] = load i64, i64* [[DOTOMP_IV]], align 8
302ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[MUL:%.*]] = mul nsw i64 [[TMP64]], 1
303207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD:%.*]] = add nsw i64 0, [[MUL]]
304207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[ADD]], i64* [[I]], align 8
305ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP65:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[AGG_CAPTURED]], i32 0, i32 0
306ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[DOTTASK_RED_]], i8*** [[TMP65]], align 8
307ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP66:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[AGG_CAPTURED]], i32 0, i32 1
308ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i32* [[ARGC1]], i32** [[TMP66]], align 8
309ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP67:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[AGG_CAPTURED]], i32 0, i32 2
310ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP68:%.*]] = load i8**, i8*** [[_TMP5]], align 8
311ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[TMP68]], i8*** [[TMP67]], align 8
312ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP69:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
313ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP70:%.*]] = load i32, i32* [[TMP69]], align 4
314ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP71:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @[[GLOB2]], i32 [[TMP70]], i32 1, i64 48, i64 24, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @.omp_task_entry. to i32 (i32, i8*)*))
315ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP72:%.*]] = bitcast i8* [[TMP71]] to %struct.kmp_task_t_with_privates*
316ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP73:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES:%.*]], %struct.kmp_task_t_with_privates* [[TMP72]], i32 0, i32 0
317ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP74:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T:%.*]], %struct.kmp_task_t* [[TMP73]], i32 0, i32 0
318ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP75:%.*]] = load i8*, i8** [[TMP74]], align 8
319ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP76:%.*]] = bitcast %struct.anon* [[AGG_CAPTURED]] to i8*
320ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[TMP75]], i8* align 8 [[TMP76]], i64 24, i1 false)
321ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP77:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES]], %struct.kmp_task_t_with_privates* [[TMP72]], i32 0, i32 1
322ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP78:%.*]] = getelementptr inbounds [[STRUCT__KMP_PRIVATES_T:%.*]], %struct..kmp_privates.t* [[TMP77]], i32 0, i32 0
323ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP79:%.*]] = load i8*, i8** [[DOTTASK_RED_]], align 8
324ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP79]], i8** [[TMP78]], align 8
325ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP80:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
326ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP81:%.*]] = load i32, i32* [[TMP80]], align 4
327ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP82:%.*]] = call i32 @__kmpc_omp_task(%struct.ident_t* @[[GLOB2]], i32 [[TMP81]], i8* [[TMP71]])
328207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
329207b08a9SGiorgis Georgakoudis // CHECK1:       omp.body.continue:
330207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
331207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.inc:
332ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP83:%.*]] = load i64, i64* [[DOTOMP_IV]], align 8
333ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD14:%.*]] = add nsw i64 [[TMP83]], 1
334ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[ADD14]], i64* [[DOTOMP_IV]], align 8
335207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_INNER_FOR_COND]]
336207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.end:
337207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
338207b08a9SGiorgis Georgakoudis // CHECK1:       omp.loop.exit:
339ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP84:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
340ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP85:%.*]] = load i32, i32* [[TMP84]], align 4
341ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP85]])
342ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP86:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
343ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP87:%.*]] = load i32, i32* [[TMP86]], align 4
344ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    call void @__kmpc_task_reduction_modifier_fini(%struct.ident_t* @[[GLOB2]], i32 [[TMP87]], i32 1)
345ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP88:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
346ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP89:%.*]] = bitcast i32* [[ARGC1]] to i8*
347ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP89]], i8** [[TMP88]], align 8
348ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP90:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
349ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[VLA]], i8** [[TMP90]], align 8
350ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP91:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 2
351ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP92:%.*]] = inttoptr i64 [[TMP13]] to i8*
352ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP92]], i8** [[TMP91]], align 8
353fb0cf017SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP93:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
354fb0cf017SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP94:%.*]] = load i32, i32* [[TMP93]], align 4
355ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP95:%.*]] = bitcast [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
356ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP96:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB4:[0-9]+]], i32 [[TMP94]], i32 2, i64 24, i8* [[TMP95]], void (i8*, i8*)* @.omp.reduction.reduction_func, [8 x i32]* @.gomp_critical_user_.reduction.var)
357ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    switch i32 [[TMP96]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
358207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
359207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
360207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ]
361207b08a9SGiorgis Georgakoudis // CHECK1:       .omp.reduction.case1:
362ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP97:%.*]] = load i32, i32* [[TMP0]], align 4
363ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP98:%.*]] = load i32, i32* [[ARGC1]], align 4
364ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD15:%.*]] = add nsw i32 [[TMP97]], [[TMP98]]
365ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 [[ADD15]], i32* [[TMP0]], align 4
366ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP99:%.*]] = getelementptr i8, i8* [[ARRAYIDX2]], i64 [[TMP13]]
367ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[ARRAYIDX2]], [[TMP99]]
368ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE22:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
369207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.body:
370207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[VLA]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
371ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST16:%.*]] = phi i8* [ [[ARRAYIDX2]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT20:%.*]], [[OMP_ARRAYCPY_BODY]] ]
372ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP100:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST16]], align 1
373ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV:%.*]] = sext i8 [[TMP100]] to i32
374ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP101:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1
375ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV17:%.*]] = sext i8 [[TMP101]] to i32
376ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD18:%.*]] = add nsw i32 [[CONV]], [[CONV17]]
377ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV19:%.*]] = trunc i32 [[ADD18]] to i8
378ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 [[CONV19]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST16]], align 1
379ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT20]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST16]], i32 1
380207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
381ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DONE21:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT20]], [[TMP99]]
382ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_DONE21]], label [[OMP_ARRAYCPY_DONE22]], label [[OMP_ARRAYCPY_BODY]]
383ac90dfc4SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.done22:
384ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB4]], i32 [[TMP94]], [8 x i32]* @.gomp_critical_user_.reduction.var)
385207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
386207b08a9SGiorgis Georgakoudis // CHECK1:       .omp.reduction.case2:
387ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP102:%.*]] = load i32, i32* [[ARGC1]], align 4
388ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP103:%.*]] = atomicrmw add i32* [[TMP0]], i32 [[TMP102]] monotonic, align 4
389ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP104:%.*]] = getelementptr i8, i8* [[ARRAYIDX2]], i64 [[TMP13]]
390ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_ISEMPTY23:%.*]] = icmp eq i8* [[ARRAYIDX2]], [[TMP104]]
391ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_ISEMPTY23]], label [[OMP_ARRAYCPY_DONE36:%.*]], label [[OMP_ARRAYCPY_BODY24:%.*]]
392ac90dfc4SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.body24:
393ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRCELEMENTPAST25:%.*]] = phi i8* [ [[VLA]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT34:%.*]], [[ATOMIC_EXIT:%.*]] ]
394ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST26:%.*]] = phi i8* [ [[ARRAYIDX2]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT33:%.*]], [[ATOMIC_EXIT]] ]
395ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP105:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST25]], align 1
396ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV27:%.*]] = sext i8 [[TMP105]] to i32
397ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ATOMIC_LOAD:%.*]] = load atomic i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST26]] monotonic, align 1
398207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[ATOMIC_CONT:%.*]]
399207b08a9SGiorgis Georgakoudis // CHECK1:       atomic_cont:
400ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP106:%.*]] = phi i8 [ [[ATOMIC_LOAD]], [[OMP_ARRAYCPY_BODY24]] ], [ [[TMP111:%.*]], [[ATOMIC_CONT]] ]
401ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 [[TMP106]], i8* [[_TMP28]], align 1
402ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP107:%.*]] = load i8, i8* [[_TMP28]], align 1
403ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV29:%.*]] = sext i8 [[TMP107]] to i32
404ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP108:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST25]], align 1
405ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV30:%.*]] = sext i8 [[TMP108]] to i32
406ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD31:%.*]] = add nsw i32 [[CONV29]], [[CONV30]]
407ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV32:%.*]] = trunc i32 [[ADD31]] to i8
408ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 [[CONV32]], i8* [[ATOMIC_TEMP]], align 1
409ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP109:%.*]] = load i8, i8* [[ATOMIC_TEMP]], align 1
410ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP110:%.*]] = cmpxchg i8* [[OMP_ARRAYCPY_DESTELEMENTPAST26]], i8 [[TMP106]], i8 [[TMP109]] monotonic monotonic, align 1
411ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP111]] = extractvalue { i8, i1 } [[TMP110]], 0
412ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP112:%.*]] = extractvalue { i8, i1 } [[TMP110]], 1
413ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[TMP112]], label [[ATOMIC_EXIT]], label [[ATOMIC_CONT]]
414207b08a9SGiorgis Georgakoudis // CHECK1:       atomic_exit:
415ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT33]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST26]], i32 1
416ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRC_ELEMENT34]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST25]], i32 1
417ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DONE35:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT33]], [[TMP104]]
418ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_DONE35]], label [[OMP_ARRAYCPY_DONE36]], label [[OMP_ARRAYCPY_BODY24]]
419ac90dfc4SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.done36:
420207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
421207b08a9SGiorgis Georgakoudis // CHECK1:       .omp.reduction.default:
422ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP113:%.*]] = load i8*, i8** [[SAVED_STACK]], align 8
423ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    call void @llvm.stackrestore(i8* [[TMP113]])
424207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
425207b08a9SGiorgis Georgakoudis //
426207b08a9SGiorgis Georgakoudis //
427207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.red_init.
4281b1c8d83Shyeongyu kim // CHECK1-SAME: (i8* noalias noundef [[TMP0:%.*]], i8* noalias noundef [[TMP1:%.*]]) #[[ATTR3:[0-9]+]] {
429207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
430207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
431207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
432207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
433207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
434b6f85d85SNikita Popov // CHECK1-NEXT:    [[TMP2:%.*]] = bitcast i8** [[DOTADDR]] to i32**
435b6f85d85SNikita Popov // CHECK1-NEXT:    [[TMP3:%.*]] = load i32*, i32** [[TMP2]], align 8
436b6f85d85SNikita Popov // CHECK1-NEXT:    store i32 0, i32* [[TMP3]], align 4
437207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
438207b08a9SGiorgis Georgakoudis //
439207b08a9SGiorgis Georgakoudis //
440207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.red_comb.
4411b1c8d83Shyeongyu kim // CHECK1-SAME: (i8* noundef [[TMP0:%.*]], i8* noundef [[TMP1:%.*]]) #[[ATTR3]] {
442207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
443207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
444207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
445207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
446207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
44752cc65d4SNikita Popov // CHECK1-NEXT:    [[TMP2:%.*]] = bitcast i8** [[DOTADDR]] to i32**
44852cc65d4SNikita Popov // CHECK1-NEXT:    [[TMP3:%.*]] = load i32*, i32** [[TMP2]], align 8
44952cc65d4SNikita Popov // CHECK1-NEXT:    [[TMP4:%.*]] = bitcast i8** [[DOTADDR1]] to i32**
45052cc65d4SNikita Popov // CHECK1-NEXT:    [[TMP5:%.*]] = load i32*, i32** [[TMP4]], align 8
45152cc65d4SNikita Popov // CHECK1-NEXT:    [[TMP6:%.*]] = load i32, i32* [[TMP3]], align 4
45252cc65d4SNikita Popov // CHECK1-NEXT:    [[TMP7:%.*]] = load i32, i32* [[TMP5]], align 4
453207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD:%.*]] = add nsw i32 [[TMP6]], [[TMP7]]
45452cc65d4SNikita Popov // CHECK1-NEXT:    store i32 [[ADD]], i32* [[TMP3]], align 4
455207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
456207b08a9SGiorgis Georgakoudis //
457207b08a9SGiorgis Georgakoudis //
458207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.red_init..2
4591b1c8d83Shyeongyu kim // CHECK1-SAME: (i8* noalias noundef [[TMP0:%.*]], i8* noalias noundef [[TMP1:%.*]]) #[[ATTR3]] {
460207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
461207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
462207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
463207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
464207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
465207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
466207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = load i64, i64* @{{reduction_size[.].+[.]}}, align 8
467207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = getelementptr i8, i8* [[TMP2]], i64 [[TMP3]]
468207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq i8* [[TMP2]], [[TMP4]]
469207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
470207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arrayinit.body:
471207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP2]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
472207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 0, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
473207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
474207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP4]]
475207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
476207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arrayinit.done:
477207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
478207b08a9SGiorgis Georgakoudis //
479207b08a9SGiorgis Georgakoudis //
480207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.red_comb..3
4811b1c8d83Shyeongyu kim // CHECK1-SAME: (i8* noundef [[TMP0:%.*]], i8* noundef [[TMP1:%.*]]) #[[ATTR3]] {
482207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
483207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
484207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
485207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
486207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
487207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i64, i64* @{{reduction_size[.].+[.]}}, align 8
488207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 8
489207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
490207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP5:%.*]] = getelementptr i8, i8* [[TMP3]], i64 [[TMP2]]
491207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[TMP3]], [[TMP5]]
492207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE4:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
493207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.body:
494207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[TMP4]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
495207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP3]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
496207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP6:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
497207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV:%.*]] = sext i8 [[TMP6]] to i32
498207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP7:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1
499207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV2:%.*]] = sext i8 [[TMP7]] to i32
500207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD:%.*]] = add nsw i32 [[CONV]], [[CONV2]]
501207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV3:%.*]] = trunc i32 [[ADD]] to i8
502207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 [[CONV3]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
503207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
504207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
505207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP5]]
506207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE4]], label [[OMP_ARRAYCPY_BODY]]
507207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.done4:
508207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
509207b08a9SGiorgis Georgakoudis //
510207b08a9SGiorgis Georgakoudis //
511207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.omp_task_privates_map.
5121b1c8d83Shyeongyu kim // CHECK1-SAME: (%struct..kmp_privates.t* noalias noundef [[TMP0:%.*]], i8*** noalias noundef [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] {
513207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
514207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca %struct..kmp_privates.t*, align 8
515207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca i8***, align 8
516207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store %struct..kmp_privates.t* [[TMP0]], %struct..kmp_privates.t** [[DOTADDR]], align 8
517207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8*** [[TMP1]], i8**** [[DOTADDR1]], align 8
518207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load %struct..kmp_privates.t*, %struct..kmp_privates.t** [[DOTADDR]], align 8
519207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = getelementptr inbounds [[STRUCT__KMP_PRIVATES_T:%.*]], %struct..kmp_privates.t* [[TMP2]], i32 0, i32 0
520207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = load i8***, i8**** [[DOTADDR1]], align 8
521207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[TMP3]], i8*** [[TMP4]], align 8
522207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
523207b08a9SGiorgis Georgakoudis //
524207b08a9SGiorgis Georgakoudis //
525207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.omp_task_entry.
5261b1c8d83Shyeongyu kim // CHECK1-SAME: (i32 noundef [[TMP0:%.*]], %struct.kmp_task_t_with_privates* noalias noundef [[TMP1:%.*]]) #[[ATTR3]] {
527207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
528207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTGLOBAL_TID__ADDR_I:%.*]] = alloca i32, align 4
529207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTPART_ID__ADDR_I:%.*]] = alloca i32*, align 8
530207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTPRIVATES__ADDR_I:%.*]] = alloca i8*, align 8
531207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTCOPY_FN__ADDR_I:%.*]] = alloca void (i8*, ...)*, align 8
532207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTTASK_T__ADDR_I:%.*]] = alloca i8*, align 8
533ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[__CONTEXT_ADDR_I:%.*]] = alloca %struct.anon*, align 8
534207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTFIRSTPRIV_PTR_ADDR_I:%.*]] = alloca i8**, align 8
535207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP_I:%.*]] = alloca i8**, align 8
536207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4_I:%.*]] = alloca i8*, align 8
537207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca i32, align 4
538207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca %struct.kmp_task_t_with_privates*, align 8
539207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 [[TMP0]], i32* [[DOTADDR]], align 4
540207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store %struct.kmp_task_t_with_privates* [[TMP1]], %struct.kmp_task_t_with_privates** [[DOTADDR1]], align 8
541207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i32, i32* [[DOTADDR]], align 4
542207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = load %struct.kmp_task_t_with_privates*, %struct.kmp_task_t_with_privates** [[DOTADDR1]], align 8
543207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES:%.*]], %struct.kmp_task_t_with_privates* [[TMP3]], i32 0, i32 0
544207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP5:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T:%.*]], %struct.kmp_task_t* [[TMP4]], i32 0, i32 2
545207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T]], %struct.kmp_task_t* [[TMP4]], i32 0, i32 0
546207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
547ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.anon*
548207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES]], %struct.kmp_task_t_with_privates* [[TMP3]], i32 0, i32 1
549207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP10:%.*]] = bitcast %struct..kmp_privates.t* [[TMP9]] to i8*
550207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP11:%.*]] = bitcast %struct.kmp_task_t_with_privates* [[TMP3]] to i8*
5519ce02ea8SJoseph Huber // CHECK1-NEXT:    call void @llvm.experimental.noalias.scope.decl(metadata [[META3:![0-9]+]])
5529ce02ea8SJoseph Huber // CHECK1-NEXT:    call void @llvm.experimental.noalias.scope.decl(metadata [[META6:![0-9]+]])
5539ce02ea8SJoseph Huber // CHECK1-NEXT:    call void @llvm.experimental.noalias.scope.decl(metadata [[META8:![0-9]+]])
5549ce02ea8SJoseph Huber // CHECK1-NEXT:    call void @llvm.experimental.noalias.scope.decl(metadata [[META10:![0-9]+]])
5559ce02ea8SJoseph Huber // CHECK1-NEXT:    store i32 [[TMP2]], i32* [[DOTGLOBAL_TID__ADDR_I]], align 4, !noalias !12
5569ce02ea8SJoseph Huber // CHECK1-NEXT:    store i32* [[TMP5]], i32** [[DOTPART_ID__ADDR_I]], align 8, !noalias !12
5579ce02ea8SJoseph Huber // CHECK1-NEXT:    store i8* [[TMP10]], i8** [[DOTPRIVATES__ADDR_I]], align 8, !noalias !12
5589ce02ea8SJoseph Huber // CHECK1-NEXT:    store void (i8*, ...)* bitcast (void (%struct..kmp_privates.t*, i8***)* @.omp_task_privates_map. to void (i8*, ...)*), void (i8*, ...)** [[DOTCOPY_FN__ADDR_I]], align 8, !noalias !12
5599ce02ea8SJoseph Huber // CHECK1-NEXT:    store i8* [[TMP11]], i8** [[DOTTASK_T__ADDR_I]], align 8, !noalias !12
560ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    store %struct.anon* [[TMP8]], %struct.anon** [[__CONTEXT_ADDR_I]], align 8, !noalias !12
561ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP12:%.*]] = load %struct.anon*, %struct.anon** [[__CONTEXT_ADDR_I]], align 8, !noalias !12
5629ce02ea8SJoseph Huber // CHECK1-NEXT:    [[TMP13:%.*]] = load void (i8*, ...)*, void (i8*, ...)** [[DOTCOPY_FN__ADDR_I]], align 8, !noalias !12
5639ce02ea8SJoseph Huber // CHECK1-NEXT:    [[TMP14:%.*]] = load i8*, i8** [[DOTPRIVATES__ADDR_I]], align 8, !noalias !12
564207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP15:%.*]] = bitcast void (i8*, ...)* [[TMP13]] to void (i8*, i8***)*
565207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void [[TMP15]](i8* [[TMP14]], i8*** [[DOTFIRSTPRIV_PTR_ADDR_I]]) #[[ATTR5]]
5669ce02ea8SJoseph Huber // CHECK1-NEXT:    [[TMP16:%.*]] = load i8**, i8*** [[DOTFIRSTPRIV_PTR_ADDR_I]], align 8, !noalias !12
567ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP17:%.*]] = getelementptr inbounds [[STRUCT_ANON:%.*]], %struct.anon* [[TMP12]], i32 0, i32 1
568207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP18:%.*]] = load i32*, i32** [[TMP17]], align 8
569207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP19:%.*]] = load i8*, i8** [[TMP16]], align 8
5709ce02ea8SJoseph Huber // CHECK1-NEXT:    [[TMP20:%.*]] = load i32, i32* [[DOTGLOBAL_TID__ADDR_I]], align 4, !noalias !12
571207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP21:%.*]] = bitcast i32* [[TMP18]] to i8*
572*1ddc51d8SNicolai Hähnle // CHECK1-NEXT:    [[TMP22:%.*]] = call i8* @__kmpc_task_reduction_get_th_data(i32 [[TMP20]], i8* [[TMP19]], i8* [[TMP21]])
573207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV_I:%.*]] = bitcast i8* [[TMP22]] to i32*
574ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP12]], i32 0, i32 2
575207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP24:%.*]] = load i8**, i8*** [[TMP23]], align 8
576207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP25:%.*]] = load i8*, i8** [[TMP24]], align 8
577ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP26:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP12]], i32 0, i32 1
578207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP27:%.*]] = load i32*, i32** [[TMP26]], align 8
579207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP28:%.*]] = load i32, i32* [[TMP27]], align 4
580207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP29:%.*]] = sext i32 [[TMP28]] to i64
581207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[LB_ADD_LEN_I:%.*]] = add nsw i64 -1, [[TMP29]]
582ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP30:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP12]], i32 0, i32 2
583207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP31:%.*]] = load i8**, i8*** [[TMP30]], align 8
584207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX2_I:%.*]] = getelementptr inbounds i8*, i8** [[TMP31]], i64 9
585207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP32:%.*]] = load i8*, i8** [[ARRAYIDX2_I]], align 8
586207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX3_I:%.*]] = getelementptr inbounds i8, i8* [[TMP32]], i64 [[LB_ADD_LEN_I]]
587207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP33:%.*]] = ptrtoint i8* [[ARRAYIDX3_I]] to i64
588207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP34:%.*]] = ptrtoint i8* [[TMP25]] to i64
589207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP35:%.*]] = sub i64 [[TMP33]], [[TMP34]]
590207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP36:%.*]] = sdiv exact i64 [[TMP35]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
591207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP37:%.*]] = add nuw i64 [[TMP36]], 1
592207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP38:%.*]] = mul nuw i64 [[TMP37]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
5931586075aSNicolai Hähnle // CHECK1-NEXT:    store i64 [[TMP37]], i64* @{{reduction_size[.].+[.]}}, align 8, !noalias !12
594207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP39:%.*]] = load i8*, i8** [[TMP16]], align 8
595*1ddc51d8SNicolai Hähnle // CHECK1-NEXT:    [[TMP40:%.*]] = call i8* @__kmpc_task_reduction_get_th_data(i32 [[TMP20]], i8* [[TMP39]], i8* [[TMP25]])
596ac90dfc4SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP41:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP12]], i32 0, i32 2
597207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP42:%.*]] = load i8**, i8*** [[TMP41]], align 8
598207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP43:%.*]] = load i8*, i8** [[TMP42]], align 8
599207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP44:%.*]] = ptrtoint i8* [[TMP43]] to i64
600207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP45:%.*]] = ptrtoint i8* [[TMP25]] to i64
601207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP46:%.*]] = sub i64 [[TMP44]], [[TMP45]]
602207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP47:%.*]] = sdiv exact i64 [[TMP46]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
603207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP48:%.*]] = getelementptr i8, i8* [[TMP40]], i64 [[TMP47]]
6049ce02ea8SJoseph Huber // CHECK1-NEXT:    store i8** [[TMP4_I]], i8*** [[TMP_I]], align 8, !noalias !12
6059ce02ea8SJoseph Huber // CHECK1-NEXT:    store i8* [[TMP48]], i8** [[TMP4_I]], align 8, !noalias !12
606207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret i32 0
607207b08a9SGiorgis Georgakoudis //
608207b08a9SGiorgis Georgakoudis //
609207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func
6101b1c8d83Shyeongyu kim // CHECK1-SAME: (i8* noundef [[TMP0:%.*]], i8* noundef [[TMP1:%.*]]) #[[ATTR3]] {
611207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
612207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
613207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
614207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
615207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
616207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
617207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [3 x i8*]*
618207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
619207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [3 x i8*]*
620207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP5]], i64 0, i64 0
621207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
622207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to i32*
623207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 0
624207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
625207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to i32*
626207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP12:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP5]], i64 0, i64 1
627207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 8
628207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP14:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 1
629207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP15:%.*]] = load i8*, i8** [[TMP14]], align 8
630207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP16:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 2
631207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 8
632207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP18:%.*]] = ptrtoint i8* [[TMP17]] to i64
633207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP19:%.*]] = load i32, i32* [[TMP11]], align 4
634207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP20:%.*]] = load i32, i32* [[TMP8]], align 4
635207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD:%.*]] = add nsw i32 [[TMP19]], [[TMP20]]
636207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 [[ADD]], i32* [[TMP11]], align 4
637207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP21:%.*]] = getelementptr i8, i8* [[TMP15]], i64 [[TMP18]]
638207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[TMP15]], [[TMP21]]
639207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE5:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
640207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.body:
641207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[TMP13]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
642207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP15]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
643207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP22:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
644207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV:%.*]] = sext i8 [[TMP22]] to i32
645207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP23:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1
646207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV2:%.*]] = sext i8 [[TMP23]] to i32
647207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD3:%.*]] = add nsw i32 [[CONV]], [[CONV2]]
648207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV4:%.*]] = trunc i32 [[ADD3]] to i8
649207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 [[CONV4]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
650207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
651207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
652207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP21]]
653207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE5]], label [[OMP_ARRAYCPY_BODY]]
654207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.done5:
655207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
656207b08a9SGiorgis Georgakoudis //
657