1*207b08a9SGiorgis 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 _
2*207b08a9SGiorgis Georgakoudis // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix=CHECK1
3ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s
4*207b08a9SGiorgis Georgakoudis // RUN: %clang_cc1 -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=CHECK2
58c2f4e0eSAlexey Bataev 
6*207b08a9SGiorgis Georgakoudis // RUN: %clang_cc1 -triple x86_64-unknown-linux -verify -fopenmp-simd -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix=CHECK3
7ff260ad0SSaiyedul Islam // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
8*207b08a9SGiorgis Georgakoudis // RUN: %clang_cc1 -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 --check-prefix=CHECK4
98c2f4e0eSAlexey Bataev // expected-no-diagnostics
108c2f4e0eSAlexey Bataev #ifndef HEADER
118c2f4e0eSAlexey Bataev #define HEADER
128c2f4e0eSAlexey Bataev 
138c2f4e0eSAlexey Bataev int main(int argc, char **argv) {
148c2f4e0eSAlexey Bataev #pragma omp parallel
158c2f4e0eSAlexey Bataev #pragma omp 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
39*207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@main
40*207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i32 [[ARGC:%.*]], i8** [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
41*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
42*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGC_ADDR:%.*]] = alloca i32, align 4
43*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGV_ADDR:%.*]] = alloca i8**, align 8
44*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 [[ARGC]], i32* [[ARGC_ADDR]], align 4
45*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[ARGV]], i8*** [[ARGV_ADDR]], align 8
46*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1:[0-9]+]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, i8***)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* [[ARGC_ADDR]], i8*** [[ARGV_ADDR]])
47*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret i32 0
48*207b08a9SGiorgis Georgakoudis //
49*207b08a9SGiorgis Georgakoudis //
50*207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.omp_outlined.
51*207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[ARGC:%.*]], i8*** nonnull align 8 dereferenceable(8) [[ARGV:%.*]]) #[[ATTR1:[0-9]+]] {
52*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
53*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
54*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
55*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGC_ADDR:%.*]] = alloca i32*, align 8
56*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGV_ADDR:%.*]] = alloca i8***, align 8
57*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_IV:%.*]] = alloca i64, align 8
58*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP:%.*]] = alloca i64, align 8
59*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_LB:%.*]] = alloca i64, align 8
60*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_UB:%.*]] = alloca i64, align 8
61*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i64, align 8
62*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
63*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARGC1:%.*]] = alloca i32, align 4
64*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[SAVED_STACK:%.*]] = alloca i8*, align 8
65*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[__VLA_EXPR0:%.*]] = alloca i64, align 8
66*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[_TMP5:%.*]] = alloca i8**, align 8
67*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[_TMP6:%.*]] = alloca i8*, align 8
68*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTRD_INPUT_:%.*]] = alloca [2 x %struct.kmp_taskred_input_t], align 8
69*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTTASK_RED_:%.*]] = alloca i8*, align 8
70*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[I:%.*]] = alloca i64, align 8
71*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[AGG_CAPTURED:%.*]] = alloca [[STRUCT_ANON:%.*]], align 8
72*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [3 x i8*], align 8
73*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ATOMIC_TEMP:%.*]] = alloca i8, align 1
74*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[_TMP28:%.*]] = alloca i8, align 1
75*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
76*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
77*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32* [[ARGC]], i32** [[ARGC_ADDR]], align 8
78*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8*** [[ARGV]], i8**** [[ARGV_ADDR]], align 8
79*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[ARGC_ADDR]], align 8
80*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP1:%.*]] = load i8***, i8**** [[ARGV_ADDR]], align 8
81*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 0, i64* [[DOTOMP_LB]], align 8
82*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 9, i64* [[DOTOMP_UB]], align 8
83*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 1, i64* [[DOTOMP_STRIDE]], align 8
84*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
85*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 0, i32* [[ARGC1]], align 4
86*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i8**, i8*** [[TMP1]], align 8
87*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds i8*, i8** [[TMP2]], i64 0
88*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = load i8*, i8** [[ARRAYIDX]], align 8
89*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX2:%.*]] = getelementptr inbounds i8, i8* [[TMP3]], i64 0
90*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = load i32, i32* [[TMP0]], align 4
91*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP5:%.*]] = sext i32 [[TMP4]] to i64
92*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[LB_ADD_LEN:%.*]] = add nsw i64 -1, [[TMP5]]
93*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP6:%.*]] = load i8**, i8*** [[TMP1]], align 8
94*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX3:%.*]] = getelementptr inbounds i8*, i8** [[TMP6]], i64 9
95*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[ARRAYIDX3]], align 8
96*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX4:%.*]] = getelementptr inbounds i8, i8* [[TMP7]], i64 [[LB_ADD_LEN]]
97*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP8:%.*]] = ptrtoint i8* [[ARRAYIDX4]] to i64
98*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP9:%.*]] = ptrtoint i8* [[ARRAYIDX2]] to i64
99*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP10:%.*]] = sub i64 [[TMP8]], [[TMP9]]
100*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP11:%.*]] = sdiv exact i64 [[TMP10]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
101*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP12:%.*]] = add nuw i64 [[TMP11]], 1
102*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP13:%.*]] = mul nuw i64 [[TMP12]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
103*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP14:%.*]] = call i8* @llvm.stacksave()
104*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP14]], i8** [[SAVED_STACK]], align 8
105*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[VLA:%.*]] = alloca i8, i64 [[TMP12]], align 16
106*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[TMP12]], i64* [[__VLA_EXPR0]], align 8
107*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP15:%.*]] = getelementptr i8, i8* [[VLA]], i64 [[TMP12]]
108*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq i8* [[VLA]], [[TMP15]]
109*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
110*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arrayinit.body:
111*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[VLA]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
112*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 0, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
113*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
114*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP15]]
115*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
116*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arrayinit.done:
117*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP16:%.*]] = load i8**, i8*** [[TMP1]], align 8
118*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 8
119*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP18:%.*]] = ptrtoint i8* [[TMP17]] to i64
120*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP19:%.*]] = ptrtoint i8* [[ARRAYIDX2]] to i64
121*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP20:%.*]] = sub i64 [[TMP18]], [[TMP19]]
122*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP21:%.*]] = sdiv exact i64 [[TMP20]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
123*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP22:%.*]] = getelementptr i8, i8* [[VLA]], i64 [[TMP21]]
124*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[_TMP6]], i8*** [[_TMP5]], align 8
125*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP22]], i8** [[_TMP6]], align 8
126*207b08a9SGiorgis 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
127*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T:%.*]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 0
128*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP24:%.*]] = bitcast i32* [[ARGC1]] to i8*
129*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP24]], i8** [[TMP23]], align 8
130*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP25:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 1
131*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP26:%.*]] = bitcast i32* [[TMP0]] to i8*
132*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP26]], i8** [[TMP25]], align 8
133*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP27:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 2
134*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 4, i64* [[TMP27]], align 8
135*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP28:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 3
136*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* bitcast (void (i8*, i8*)* @.red_init. to i8*), i8** [[TMP28]], align 8
137*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP29:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 4
138*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* null, i8** [[TMP29]], align 8
139*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP30:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 5
140*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* bitcast (void (i8*, i8*)* @.red_comb. to i8*), i8** [[TMP30]], align 8
141*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP31:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 6
142*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP32:%.*]] = bitcast i32* [[TMP31]] to i8*
143*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP32]], i8 0, i64 4, i1 false)
144*207b08a9SGiorgis 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
145*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP33:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 0
146*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP34:%.*]] = load i8**, i8*** [[TMP1]], align 8
147*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds i8*, i8** [[TMP34]], i64 0
148*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP35:%.*]] = load i8*, i8** [[ARRAYIDX8]], align 8
149*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX9:%.*]] = getelementptr inbounds i8, i8* [[TMP35]], i64 0
150*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP36:%.*]] = load i32, i32* [[TMP0]], align 4
151*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP37:%.*]] = sext i32 [[TMP36]] to i64
152*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[LB_ADD_LEN10:%.*]] = add nsw i64 -1, [[TMP37]]
153*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP38:%.*]] = load i8**, i8*** [[TMP1]], align 8
154*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX11:%.*]] = getelementptr inbounds i8*, i8** [[TMP38]], i64 9
155*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP39:%.*]] = load i8*, i8** [[ARRAYIDX11]], align 8
156*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX12:%.*]] = getelementptr inbounds i8, i8* [[TMP39]], i64 [[LB_ADD_LEN10]]
157*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[VLA]], i8** [[TMP33]], align 8
158*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP40:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 1
159*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[ARRAYIDX9]], i8** [[TMP40]], align 8
160*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP41:%.*]] = ptrtoint i8* [[ARRAYIDX12]] to i64
161*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP42:%.*]] = ptrtoint i8* [[ARRAYIDX9]] to i64
162*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP43:%.*]] = sub i64 [[TMP41]], [[TMP42]]
163*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP44:%.*]] = sdiv exact i64 [[TMP43]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
164*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP45:%.*]] = add nuw i64 [[TMP44]], 1
165*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP46:%.*]] = mul nuw i64 [[TMP45]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
166*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP47:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 2
167*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[TMP46]], i64* [[TMP47]], align 8
168*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP48:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 3
169*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* bitcast (void (i8*, i8*)* @.red_init..1 to i8*), i8** [[TMP48]], align 8
170*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP49:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 4
171*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* null, i8** [[TMP49]], align 8
172*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP50:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 5
173*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* bitcast (void (i8*, i8*)* @.red_comb..2 to i8*), i8** [[TMP50]], align 8
174*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP51:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 6
175*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 1, i32* [[TMP51]], align 8
176*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP52:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
177*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP53:%.*]] = load i32, i32* [[TMP52]], align 4
178*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP54:%.*]] = bitcast [2 x %struct.kmp_taskred_input_t]* [[DOTRD_INPUT_]] to i8*
179*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP55:%.*]] = call i8* @__kmpc_taskred_modifier_init(%struct.ident_t* @[[GLOB1]], i32 [[TMP53]], i32 1, i32 2, i8* [[TMP54]])
180*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP55]], i8** [[DOTTASK_RED_]], align 8
181*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP56:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
182*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP57:%.*]] = load i32, i32* [[TMP56]], align 4
183*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @__kmpc_for_static_init_8(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP57]], i32 34, i32* [[DOTOMP_IS_LAST]], i64* [[DOTOMP_LB]], i64* [[DOTOMP_UB]], i64* [[DOTOMP_STRIDE]], i64 1, i64 1)
184*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP58:%.*]] = load i64, i64* [[DOTOMP_UB]], align 8
185*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CMP:%.*]] = icmp sgt i64 [[TMP58]], 9
186*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
187*207b08a9SGiorgis Georgakoudis // CHECK1:       cond.true:
188*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[COND_END:%.*]]
189*207b08a9SGiorgis Georgakoudis // CHECK1:       cond.false:
190*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP59:%.*]] = load i64, i64* [[DOTOMP_UB]], align 8
191*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[COND_END]]
192*207b08a9SGiorgis Georgakoudis // CHECK1:       cond.end:
193*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[COND:%.*]] = phi i64 [ 9, [[COND_TRUE]] ], [ [[TMP59]], [[COND_FALSE]] ]
194*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[COND]], i64* [[DOTOMP_UB]], align 8
195*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP60:%.*]] = load i64, i64* [[DOTOMP_LB]], align 8
196*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[TMP60]], i64* [[DOTOMP_IV]], align 8
197*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
198*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.cond:
199*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP61:%.*]] = load i64, i64* [[DOTOMP_IV]], align 8
200*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP62:%.*]] = load i64, i64* [[DOTOMP_UB]], align 8
201*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CMP13:%.*]] = icmp sle i64 [[TMP61]], [[TMP62]]
202*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[CMP13]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
203*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.cond.cleanup:
204*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_INNER_FOR_END:%.*]]
205*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.body:
206*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP63:%.*]] = load i64, i64* [[DOTOMP_IV]], align 8
207*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[MUL:%.*]] = mul nsw i64 [[TMP63]], 1
208*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD:%.*]] = add nsw i64 0, [[MUL]]
209*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[ADD]], i64* [[I]], align 8
210*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP64:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[AGG_CAPTURED]], i32 0, i32 0
211*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[DOTTASK_RED_]], i8*** [[TMP64]], align 8
212*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP65:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[AGG_CAPTURED]], i32 0, i32 1
213*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32* [[ARGC1]], i32** [[TMP65]], align 8
214*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP66:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[AGG_CAPTURED]], i32 0, i32 2
215*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP67:%.*]] = load i8**, i8*** [[_TMP5]], align 8
216*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[TMP67]], i8*** [[TMP66]], align 8
217*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP68:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
218*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP69:%.*]] = load i32, i32* [[TMP68]], align 4
219*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP70:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @[[GLOB1]], i32 [[TMP69]], 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*)*))
220*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP71:%.*]] = bitcast i8* [[TMP70]] to %struct.kmp_task_t_with_privates*
221*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP72:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES:%.*]], %struct.kmp_task_t_with_privates* [[TMP71]], i32 0, i32 0
222*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP73:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T:%.*]], %struct.kmp_task_t* [[TMP72]], i32 0, i32 0
223*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP74:%.*]] = load i8*, i8** [[TMP73]], align 8
224*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP75:%.*]] = bitcast %struct.anon* [[AGG_CAPTURED]] to i8*
225*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[TMP74]], i8* align 8 [[TMP75]], i64 24, i1 false)
226*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP76:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES]], %struct.kmp_task_t_with_privates* [[TMP71]], i32 0, i32 1
227*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP77:%.*]] = getelementptr inbounds [[STRUCT__KMP_PRIVATES_T:%.*]], %struct..kmp_privates.t* [[TMP76]], i32 0, i32 0
228*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP78:%.*]] = load i8*, i8** [[DOTTASK_RED_]], align 8
229*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP78]], i8** [[TMP77]], align 8
230*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP79:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
231*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP80:%.*]] = load i32, i32* [[TMP79]], align 4
232*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP81:%.*]] = call i32 @__kmpc_omp_task(%struct.ident_t* @[[GLOB1]], i32 [[TMP80]], i8* [[TMP70]])
233*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
234*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.body.continue:
235*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
236*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.inc:
237*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP82:%.*]] = load i64, i64* [[DOTOMP_IV]], align 8
238*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD14:%.*]] = add nsw i64 [[TMP82]], 1
239*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[ADD14]], i64* [[DOTOMP_IV]], align 8
240*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_INNER_FOR_COND]]
241*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.inner.for.end:
242*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
243*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.loop.exit:
244*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP83:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
245*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP84:%.*]] = load i32, i32* [[TMP83]], align 4
246*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB2]], i32 [[TMP84]])
247*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP85:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
248*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP86:%.*]] = load i32, i32* [[TMP85]], align 4
249*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @__kmpc_task_reduction_modifier_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP86]], i32 1)
250*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP87:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
251*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP88:%.*]] = bitcast i32* [[ARGC1]] to i8*
252*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP88]], i8** [[TMP87]], align 8
253*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP89:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
254*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[VLA]], i8** [[TMP89]], align 8
255*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP90:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 2
256*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP91:%.*]] = inttoptr i64 [[TMP12]] to i8*
257*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP91]], i8** [[TMP90]], align 8
258*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP92:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
259*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP93:%.*]] = load i32, i32* [[TMP92]], align 4
260*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP94:%.*]] = bitcast [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
261*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP95:%.*]] = call i32 @__kmpc_reduce(%struct.ident_t* @[[GLOB3:[0-9]+]], i32 [[TMP93]], i32 2, i64 24, i8* [[TMP94]], void (i8*, i8*)* @.omp.reduction.reduction_func, [8 x i32]* @.gomp_critical_user_.reduction.var)
262*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    switch i32 [[TMP95]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
263*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
264*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
265*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ]
266*207b08a9SGiorgis Georgakoudis // CHECK1:       .omp.reduction.case1:
267*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP96:%.*]] = load i32, i32* [[TMP0]], align 4
268*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP97:%.*]] = load i32, i32* [[ARGC1]], align 4
269*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD15:%.*]] = add nsw i32 [[TMP96]], [[TMP97]]
270*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 [[ADD15]], i32* [[TMP0]], align 4
271*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP98:%.*]] = getelementptr i8, i8* [[ARRAYIDX2]], i64 [[TMP12]]
272*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[ARRAYIDX2]], [[TMP98]]
273*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE22:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
274*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.body:
275*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[VLA]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
276*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST16:%.*]] = phi i8* [ [[ARRAYIDX2]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT20:%.*]], [[OMP_ARRAYCPY_BODY]] ]
277*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP99:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST16]], align 1
278*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV:%.*]] = sext i8 [[TMP99]] to i32
279*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP100:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1
280*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV17:%.*]] = sext i8 [[TMP100]] to i32
281*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD18:%.*]] = add nsw i32 [[CONV]], [[CONV17]]
282*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV19:%.*]] = trunc i32 [[ADD18]] to i8
283*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 [[CONV19]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST16]], align 1
284*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT20]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST16]], i32 1
285*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
286*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DONE21:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT20]], [[TMP98]]
287*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_DONE21]], label [[OMP_ARRAYCPY_DONE22]], label [[OMP_ARRAYCPY_BODY]]
288*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.done22:
289*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @__kmpc_end_reduce(%struct.ident_t* @[[GLOB3]], i32 [[TMP93]], [8 x i32]* @.gomp_critical_user_.reduction.var)
290*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
291*207b08a9SGiorgis Georgakoudis // CHECK1:       .omp.reduction.case2:
292*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP101:%.*]] = load i32, i32* [[ARGC1]], align 4
293*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP102:%.*]] = atomicrmw add i32* [[TMP0]], i32 [[TMP101]] monotonic, align 4
294*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP103:%.*]] = getelementptr i8, i8* [[ARRAYIDX2]], i64 [[TMP12]]
295*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_ISEMPTY23:%.*]] = icmp eq i8* [[ARRAYIDX2]], [[TMP103]]
296*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_ISEMPTY23]], label [[OMP_ARRAYCPY_DONE36:%.*]], label [[OMP_ARRAYCPY_BODY24:%.*]]
297*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.body24:
298*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRCELEMENTPAST25:%.*]] = phi i8* [ [[VLA]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT34:%.*]], [[ATOMIC_EXIT:%.*]] ]
299*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST26:%.*]] = phi i8* [ [[ARRAYIDX2]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT33:%.*]], [[ATOMIC_EXIT]] ]
300*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP104:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST25]], align 1
301*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV27:%.*]] = sext i8 [[TMP104]] to i32
302*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ATOMIC_LOAD:%.*]] = load atomic i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST26]] monotonic, align 1
303*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[ATOMIC_CONT:%.*]]
304*207b08a9SGiorgis Georgakoudis // CHECK1:       atomic_cont:
305*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP105:%.*]] = phi i8 [ [[ATOMIC_LOAD]], [[OMP_ARRAYCPY_BODY24]] ], [ [[TMP110:%.*]], [[ATOMIC_CONT]] ]
306*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 [[TMP105]], i8* [[_TMP28]], align 1
307*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP106:%.*]] = load i8, i8* [[_TMP28]], align 1
308*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV29:%.*]] = sext i8 [[TMP106]] to i32
309*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP107:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST25]], align 1
310*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV30:%.*]] = sext i8 [[TMP107]] to i32
311*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD31:%.*]] = add nsw i32 [[CONV29]], [[CONV30]]
312*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV32:%.*]] = trunc i32 [[ADD31]] to i8
313*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 [[CONV32]], i8* [[ATOMIC_TEMP]], align 1
314*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP108:%.*]] = load i8, i8* [[ATOMIC_TEMP]], align 1
315*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP109:%.*]] = cmpxchg i8* [[OMP_ARRAYCPY_DESTELEMENTPAST26]], i8 [[TMP105]], i8 [[TMP108]] monotonic monotonic, align 1
316*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP110]] = extractvalue { i8, i1 } [[TMP109]], 0
317*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP111:%.*]] = extractvalue { i8, i1 } [[TMP109]], 1
318*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[TMP111]], label [[ATOMIC_EXIT]], label [[ATOMIC_CONT]]
319*207b08a9SGiorgis Georgakoudis // CHECK1:       atomic_exit:
320*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT33]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST26]], i32 1
321*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRC_ELEMENT34]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST25]], i32 1
322*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DONE35:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT33]], [[TMP103]]
323*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_DONE35]], label [[OMP_ARRAYCPY_DONE36]], label [[OMP_ARRAYCPY_BODY24]]
324*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.done36:
325*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @__kmpc_end_reduce(%struct.ident_t* @[[GLOB3]], i32 [[TMP93]], [8 x i32]* @.gomp_critical_user_.reduction.var)
326*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
327*207b08a9SGiorgis Georgakoudis // CHECK1:       .omp.reduction.default:
328*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP112:%.*]] = load i8*, i8** [[SAVED_STACK]], align 8
329*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @llvm.stackrestore(i8* [[TMP112]])
330*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP113:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
331*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP114:%.*]] = load i32, i32* [[TMP113]], align 4
332*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4:[0-9]+]], i32 [[TMP114]])
333*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
334*207b08a9SGiorgis Georgakoudis //
335*207b08a9SGiorgis Georgakoudis //
336*207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.red_init.
337*207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i8* noalias [[TMP0:%.*]], i8* noalias [[TMP1:%.*]]) #[[ATTR3:[0-9]+]] {
338*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
339*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
340*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
341*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
342*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
343*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
344*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32*
345*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 0, i32* [[TMP3]], align 8
346*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
347*207b08a9SGiorgis Georgakoudis //
348*207b08a9SGiorgis Georgakoudis //
349*207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.red_comb.
350*207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR3]] {
351*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
352*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
353*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
354*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
355*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
356*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
357*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32*
358*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
359*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to i32*
360*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP6:%.*]] = load i32, i32* [[TMP3]], align 8
361*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP7:%.*]] = load i32, i32* [[TMP5]], align 8
362*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD:%.*]] = add nsw i32 [[TMP6]], [[TMP7]]
363*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 [[ADD]], i32* [[TMP3]], align 8
364*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
365*207b08a9SGiorgis Georgakoudis //
366*207b08a9SGiorgis Georgakoudis //
367*207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.red_init..1
368*207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i8* noalias [[TMP0:%.*]], i8* noalias [[TMP1:%.*]]) #[[ATTR3]] {
369*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
370*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
371*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
372*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
373*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
374*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
375*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = load i64, i64* @{{reduction_size[.].+[.]}}, align 8
376*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = getelementptr i8, i8* [[TMP2]], i64 [[TMP3]]
377*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq i8* [[TMP2]], [[TMP4]]
378*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
379*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arrayinit.body:
380*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP2]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
381*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 0, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
382*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
383*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP4]]
384*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
385*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arrayinit.done:
386*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
387*207b08a9SGiorgis Georgakoudis //
388*207b08a9SGiorgis Georgakoudis //
389*207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.red_comb..2
390*207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR3]] {
391*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
392*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
393*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
394*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
395*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
396*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i64, i64* @{{reduction_size[.].+[.]}}, align 8
397*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 8
398*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
399*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP5:%.*]] = getelementptr i8, i8* [[TMP3]], i64 [[TMP2]]
400*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[TMP3]], [[TMP5]]
401*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE4:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
402*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.body:
403*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[TMP4]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
404*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP3]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
405*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP6:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
406*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV:%.*]] = sext i8 [[TMP6]] to i32
407*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP7:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1
408*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV2:%.*]] = sext i8 [[TMP7]] to i32
409*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD:%.*]] = add nsw i32 [[CONV]], [[CONV2]]
410*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV3:%.*]] = trunc i32 [[ADD]] to i8
411*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 [[CONV3]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
412*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
413*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
414*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP5]]
415*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE4]], label [[OMP_ARRAYCPY_BODY]]
416*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.done4:
417*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
418*207b08a9SGiorgis Georgakoudis //
419*207b08a9SGiorgis Georgakoudis //
420*207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.omp_task_privates_map.
421*207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (%struct..kmp_privates.t* noalias [[TMP0:%.*]], i8*** noalias [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] {
422*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
423*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca %struct..kmp_privates.t*, align 8
424*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca i8***, align 8
425*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store %struct..kmp_privates.t* [[TMP0]], %struct..kmp_privates.t** [[DOTADDR]], align 8
426*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8*** [[TMP1]], i8**** [[DOTADDR1]], align 8
427*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load %struct..kmp_privates.t*, %struct..kmp_privates.t** [[DOTADDR]], align 8
428*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = getelementptr inbounds [[STRUCT__KMP_PRIVATES_T:%.*]], %struct..kmp_privates.t* [[TMP2]], i32 0, i32 0
429*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = load i8***, i8**** [[DOTADDR1]], align 8
430*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[TMP3]], i8*** [[TMP4]], align 8
431*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
432*207b08a9SGiorgis Georgakoudis //
433*207b08a9SGiorgis Georgakoudis //
434*207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.omp_task_entry.
435*207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i32 [[TMP0:%.*]], %struct.kmp_task_t_with_privates* noalias [[TMP1:%.*]]) #[[ATTR3]] {
436*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
437*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTGLOBAL_TID__ADDR_I:%.*]] = alloca i32, align 4
438*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTPART_ID__ADDR_I:%.*]] = alloca i32*, align 8
439*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTPRIVATES__ADDR_I:%.*]] = alloca i8*, align 8
440*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTCOPY_FN__ADDR_I:%.*]] = alloca void (i8*, ...)*, align 8
441*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTTASK_T__ADDR_I:%.*]] = alloca i8*, align 8
442*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[__CONTEXT_ADDR_I:%.*]] = alloca %struct.anon*, align 8
443*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTFIRSTPRIV_PTR_ADDR_I:%.*]] = alloca i8**, align 8
444*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP_I:%.*]] = alloca i8**, align 8
445*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4_I:%.*]] = alloca i8*, align 8
446*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca i32, align 4
447*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca %struct.kmp_task_t_with_privates*, align 8
448*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 [[TMP0]], i32* [[DOTADDR]], align 4
449*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store %struct.kmp_task_t_with_privates* [[TMP1]], %struct.kmp_task_t_with_privates** [[DOTADDR1]], align 8
450*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i32, i32* [[DOTADDR]], align 4
451*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = load %struct.kmp_task_t_with_privates*, %struct.kmp_task_t_with_privates** [[DOTADDR1]], align 8
452*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES:%.*]], %struct.kmp_task_t_with_privates* [[TMP3]], i32 0, i32 0
453*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP5:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T:%.*]], %struct.kmp_task_t* [[TMP4]], i32 0, i32 2
454*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T]], %struct.kmp_task_t* [[TMP4]], i32 0, i32 0
455*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
456*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.anon*
457*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES]], %struct.kmp_task_t_with_privates* [[TMP3]], i32 0, i32 1
458*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP10:%.*]] = bitcast %struct..kmp_privates.t* [[TMP9]] to i8*
459*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP11:%.*]] = bitcast %struct.kmp_task_t_with_privates* [[TMP3]] to i8*
460*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @llvm.experimental.noalias.scope.decl(metadata [[META2:![0-9]+]])
461*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @llvm.experimental.noalias.scope.decl(metadata [[META5:![0-9]+]])
462*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @llvm.experimental.noalias.scope.decl(metadata [[META7:![0-9]+]])
463*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void @llvm.experimental.noalias.scope.decl(metadata [[META9:![0-9]+]])
464*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 [[TMP2]], i32* [[DOTGLOBAL_TID__ADDR_I]], align 4, !noalias !11
465*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32* [[TMP5]], i32** [[DOTPART_ID__ADDR_I]], align 8, !noalias !11
466*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP10]], i8** [[DOTPRIVATES__ADDR_I]], align 8, !noalias !11
467*207b08a9SGiorgis Georgakoudis // 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 !11
468*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP11]], i8** [[DOTTASK_T__ADDR_I]], align 8, !noalias !11
469*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store %struct.anon* [[TMP8]], %struct.anon** [[__CONTEXT_ADDR_I]], align 8, !noalias !11
470*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP12:%.*]] = load %struct.anon*, %struct.anon** [[__CONTEXT_ADDR_I]], align 8, !noalias !11
471*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP13:%.*]] = load void (i8*, ...)*, void (i8*, ...)** [[DOTCOPY_FN__ADDR_I]], align 8, !noalias !11
472*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP14:%.*]] = load i8*, i8** [[DOTPRIVATES__ADDR_I]], align 8, !noalias !11
473*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP15:%.*]] = bitcast void (i8*, ...)* [[TMP13]] to void (i8*, i8***)*
474*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    call void [[TMP15]](i8* [[TMP14]], i8*** [[DOTFIRSTPRIV_PTR_ADDR_I]]) #[[ATTR5:[0-9]+]]
475*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP16:%.*]] = load i8**, i8*** [[DOTFIRSTPRIV_PTR_ADDR_I]], align 8, !noalias !11
476*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP17:%.*]] = getelementptr inbounds [[STRUCT_ANON:%.*]], %struct.anon* [[TMP12]], i32 0, i32 1
477*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP18:%.*]] = load i32*, i32** [[TMP17]], align 8
478*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP19:%.*]] = load i8*, i8** [[TMP16]], align 8
479*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP20:%.*]] = load i32, i32* [[DOTGLOBAL_TID__ADDR_I]], align 4, !noalias !11
480*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP21:%.*]] = bitcast i32* [[TMP18]] to i8*
481*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP22:%.*]] = call i8* @__kmpc_task_reduction_get_th_data(i32 [[TMP20]], i8* [[TMP19]], i8* [[TMP21]]) #[[ATTR5]]
482*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV_I:%.*]] = bitcast i8* [[TMP22]] to i32*
483*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP12]], i32 0, i32 2
484*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP24:%.*]] = load i8**, i8*** [[TMP23]], align 8
485*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP25:%.*]] = load i8*, i8** [[TMP24]], align 8
486*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP26:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP12]], i32 0, i32 1
487*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP27:%.*]] = load i32*, i32** [[TMP26]], align 8
488*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP28:%.*]] = load i32, i32* [[TMP27]], align 4
489*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP29:%.*]] = sext i32 [[TMP28]] to i64
490*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[LB_ADD_LEN_I:%.*]] = add nsw i64 -1, [[TMP29]]
491*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP30:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP12]], i32 0, i32 2
492*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP31:%.*]] = load i8**, i8*** [[TMP30]], align 8
493*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX2_I:%.*]] = getelementptr inbounds i8*, i8** [[TMP31]], i64 9
494*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP32:%.*]] = load i8*, i8** [[ARRAYIDX2_I]], align 8
495*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ARRAYIDX3_I:%.*]] = getelementptr inbounds i8, i8* [[TMP32]], i64 [[LB_ADD_LEN_I]]
496*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP33:%.*]] = ptrtoint i8* [[ARRAYIDX3_I]] to i64
497*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP34:%.*]] = ptrtoint i8* [[TMP25]] to i64
498*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP35:%.*]] = sub i64 [[TMP33]], [[TMP34]]
499*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP36:%.*]] = sdiv exact i64 [[TMP35]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
500*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP37:%.*]] = add nuw i64 [[TMP36]], 1
501*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP38:%.*]] = mul nuw i64 [[TMP37]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
502*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i64 [[TMP37]], i64* @{{reduction_size[.].+[.]}}, align 8
503*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP39:%.*]] = load i8*, i8** [[TMP16]], align 8
504*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP40:%.*]] = call i8* @__kmpc_task_reduction_get_th_data(i32 [[TMP20]], i8* [[TMP39]], i8* [[TMP25]]) #[[ATTR5]]
505*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP41:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP12]], i32 0, i32 2
506*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP42:%.*]] = load i8**, i8*** [[TMP41]], align 8
507*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP43:%.*]] = load i8*, i8** [[TMP42]], align 8
508*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP44:%.*]] = ptrtoint i8* [[TMP43]] to i64
509*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP45:%.*]] = ptrtoint i8* [[TMP25]] to i64
510*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP46:%.*]] = sub i64 [[TMP44]], [[TMP45]]
511*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP47:%.*]] = sdiv exact i64 [[TMP46]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
512*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP48:%.*]] = getelementptr i8, i8* [[TMP40]], i64 [[TMP47]]
513*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8** [[TMP4_I]], i8*** [[TMP_I]], align 8, !noalias !11
514*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP48]], i8** [[TMP4_I]], align 8, !noalias !11
515*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret i32 0
516*207b08a9SGiorgis Georgakoudis //
517*207b08a9SGiorgis Georgakoudis //
518*207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func
519*207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR3]] {
520*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:  entry:
521*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
522*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
523*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
524*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
525*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
526*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [3 x i8*]*
527*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
528*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [3 x i8*]*
529*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP5]], i64 0, i64 0
530*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
531*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to i32*
532*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 0
533*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
534*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to i32*
535*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP12:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP5]], i64 0, i64 1
536*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 8
537*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP14:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 1
538*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP15:%.*]] = load i8*, i8** [[TMP14]], align 8
539*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP16:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 2
540*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 8
541*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP18:%.*]] = ptrtoint i8* [[TMP17]] to i64
542*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP19:%.*]] = load i32, i32* [[TMP11]], align 4
543*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP20:%.*]] = load i32, i32* [[TMP8]], align 4
544*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD:%.*]] = add nsw i32 [[TMP19]], [[TMP20]]
545*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i32 [[ADD]], i32* [[TMP11]], align 4
546*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP21:%.*]] = getelementptr i8, i8* [[TMP15]], i64 [[TMP18]]
547*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[TMP15]], [[TMP21]]
548*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE5:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
549*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.body:
550*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[TMP13]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
551*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP15]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
552*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP22:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
553*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV:%.*]] = sext i8 [[TMP22]] to i32
554*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[TMP23:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1
555*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV2:%.*]] = sext i8 [[TMP23]] to i32
556*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[ADD3:%.*]] = add nsw i32 [[CONV]], [[CONV2]]
557*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[CONV4:%.*]] = trunc i32 [[ADD3]] to i8
558*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    store i8 [[CONV4]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
559*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
560*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
561*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP21]]
562*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE5]], label [[OMP_ARRAYCPY_BODY]]
563*207b08a9SGiorgis Georgakoudis // CHECK1:       omp.arraycpy.done5:
564*207b08a9SGiorgis Georgakoudis // CHECK1-NEXT:    ret void
565*207b08a9SGiorgis Georgakoudis //
566*207b08a9SGiorgis Georgakoudis //
567*207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@main
568*207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i32 [[ARGC:%.*]], i8** [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
569*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:  entry:
570*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARGC_ADDR:%.*]] = alloca i32, align 4
571*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARGV_ADDR:%.*]] = alloca i8**, align 8
572*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32 [[ARGC]], i32* [[ARGC_ADDR]], align 4
573*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8** [[ARGV]], i8*** [[ARGV_ADDR]], align 8
574*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1:[0-9]+]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, i8***)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* [[ARGC_ADDR]], i8*** [[ARGV_ADDR]])
575*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    ret i32 0
576*207b08a9SGiorgis Georgakoudis //
577*207b08a9SGiorgis Georgakoudis //
578*207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.omp_outlined.
579*207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[ARGC:%.*]], i8*** nonnull align 8 dereferenceable(8) [[ARGV:%.*]]) #[[ATTR1:[0-9]+]] {
580*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:  entry:
581*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
582*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
583*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARGC_ADDR:%.*]] = alloca i32*, align 8
584*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARGV_ADDR:%.*]] = alloca i8***, align 8
585*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTOMP_IV:%.*]] = alloca i64, align 8
586*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP:%.*]] = alloca i64, align 8
587*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTOMP_LB:%.*]] = alloca i64, align 8
588*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTOMP_UB:%.*]] = alloca i64, align 8
589*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTOMP_STRIDE:%.*]] = alloca i64, align 8
590*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
591*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARGC1:%.*]] = alloca i32, align 4
592*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[SAVED_STACK:%.*]] = alloca i8*, align 8
593*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[__VLA_EXPR0:%.*]] = alloca i64, align 8
594*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[_TMP5:%.*]] = alloca i8**, align 8
595*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[_TMP6:%.*]] = alloca i8*, align 8
596*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTRD_INPUT_:%.*]] = alloca [2 x %struct.kmp_taskred_input_t], align 8
597*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTTASK_RED_:%.*]] = alloca i8*, align 8
598*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[I:%.*]] = alloca i64, align 8
599*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[AGG_CAPTURED:%.*]] = alloca [[STRUCT_ANON:%.*]], align 8
600*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [3 x i8*], align 8
601*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ATOMIC_TEMP:%.*]] = alloca i8, align 1
602*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[_TMP28:%.*]] = alloca i8, align 1
603*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
604*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
605*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32* [[ARGC]], i32** [[ARGC_ADDR]], align 8
606*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8*** [[ARGV]], i8**** [[ARGV_ADDR]], align 8
607*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP0:%.*]] = load i32*, i32** [[ARGC_ADDR]], align 8
608*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP1:%.*]] = load i8***, i8**** [[ARGV_ADDR]], align 8
609*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i64 0, i64* [[DOTOMP_LB]], align 8
610*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i64 9, i64* [[DOTOMP_UB]], align 8
611*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i64 1, i64* [[DOTOMP_STRIDE]], align 8
612*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32 0, i32* [[DOTOMP_IS_LAST]], align 4
613*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32 0, i32* [[ARGC1]], align 4
614*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP2:%.*]] = load i8**, i8*** [[TMP1]], align 8
615*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds i8*, i8** [[TMP2]], i64 0
616*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP3:%.*]] = load i8*, i8** [[ARRAYIDX]], align 8
617*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARRAYIDX2:%.*]] = getelementptr inbounds i8, i8* [[TMP3]], i64 0
618*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP4:%.*]] = load i32, i32* [[TMP0]], align 4
619*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP5:%.*]] = sext i32 [[TMP4]] to i64
620*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[LB_ADD_LEN:%.*]] = add nsw i64 -1, [[TMP5]]
621*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP6:%.*]] = load i8**, i8*** [[TMP1]], align 8
622*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARRAYIDX3:%.*]] = getelementptr inbounds i8*, i8** [[TMP6]], i64 9
623*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[ARRAYIDX3]], align 8
624*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARRAYIDX4:%.*]] = getelementptr inbounds i8, i8* [[TMP7]], i64 [[LB_ADD_LEN]]
625*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP8:%.*]] = ptrtoint i8* [[ARRAYIDX4]] to i64
626*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP9:%.*]] = ptrtoint i8* [[ARRAYIDX2]] to i64
627*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP10:%.*]] = sub i64 [[TMP8]], [[TMP9]]
628*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP11:%.*]] = sdiv exact i64 [[TMP10]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
629*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP12:%.*]] = add nuw i64 [[TMP11]], 1
630*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP13:%.*]] = mul nuw i64 [[TMP12]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
631*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP14:%.*]] = call i8* @llvm.stacksave()
632*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP14]], i8** [[SAVED_STACK]], align 8
633*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[VLA:%.*]] = alloca i8, i64 [[TMP12]], align 16
634*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i64 [[TMP12]], i64* [[__VLA_EXPR0]], align 8
635*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP15:%.*]] = getelementptr i8, i8* [[VLA]], i64 [[TMP12]]
636*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq i8* [[VLA]], [[TMP15]]
637*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
638*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.arrayinit.body:
639*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[VLA]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
640*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8 0, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
641*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
642*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP15]]
643*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
644*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.arrayinit.done:
645*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP16:%.*]] = load i8**, i8*** [[TMP1]], align 8
646*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 8
647*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP18:%.*]] = ptrtoint i8* [[TMP17]] to i64
648*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP19:%.*]] = ptrtoint i8* [[ARRAYIDX2]] to i64
649*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP20:%.*]] = sub i64 [[TMP18]], [[TMP19]]
650*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP21:%.*]] = sdiv exact i64 [[TMP20]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
651*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP22:%.*]] = getelementptr i8, i8* [[VLA]], i64 [[TMP21]]
652*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8** [[_TMP6]], i8*** [[_TMP5]], align 8
653*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP22]], i8** [[_TMP6]], align 8
654*207b08a9SGiorgis Georgakoudis // CHECK2-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
655*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T:%.*]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 0
656*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP24:%.*]] = bitcast i32* [[ARGC1]] to i8*
657*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP24]], i8** [[TMP23]], align 8
658*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP25:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 1
659*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP26:%.*]] = bitcast i32* [[TMP0]] to i8*
660*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP26]], i8** [[TMP25]], align 8
661*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP27:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 2
662*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i64 4, i64* [[TMP27]], align 8
663*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP28:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 3
664*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* bitcast (void (i8*, i8*)* @.red_init. to i8*), i8** [[TMP28]], align 8
665*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP29:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 4
666*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* null, i8** [[TMP29]], align 8
667*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP30:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 5
668*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* bitcast (void (i8*, i8*)* @.red_comb. to i8*), i8** [[TMP30]], align 8
669*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP31:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 6
670*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP32:%.*]] = bitcast i32* [[TMP31]] to i8*
671*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP32]], i8 0, i64 4, i1 false)
672*207b08a9SGiorgis Georgakoudis // CHECK2-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
673*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP33:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 0
674*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP34:%.*]] = load i8**, i8*** [[TMP1]], align 8
675*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds i8*, i8** [[TMP34]], i64 0
676*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP35:%.*]] = load i8*, i8** [[ARRAYIDX8]], align 8
677*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARRAYIDX9:%.*]] = getelementptr inbounds i8, i8* [[TMP35]], i64 0
678*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP36:%.*]] = load i32, i32* [[TMP0]], align 4
679*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP37:%.*]] = sext i32 [[TMP36]] to i64
680*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[LB_ADD_LEN10:%.*]] = add nsw i64 -1, [[TMP37]]
681*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP38:%.*]] = load i8**, i8*** [[TMP1]], align 8
682*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARRAYIDX11:%.*]] = getelementptr inbounds i8*, i8** [[TMP38]], i64 9
683*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP39:%.*]] = load i8*, i8** [[ARRAYIDX11]], align 8
684*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARRAYIDX12:%.*]] = getelementptr inbounds i8, i8* [[TMP39]], i64 [[LB_ADD_LEN10]]
685*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[VLA]], i8** [[TMP33]], align 8
686*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP40:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 1
687*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[ARRAYIDX9]], i8** [[TMP40]], align 8
688*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP41:%.*]] = ptrtoint i8* [[ARRAYIDX12]] to i64
689*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP42:%.*]] = ptrtoint i8* [[ARRAYIDX9]] to i64
690*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP43:%.*]] = sub i64 [[TMP41]], [[TMP42]]
691*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP44:%.*]] = sdiv exact i64 [[TMP43]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
692*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP45:%.*]] = add nuw i64 [[TMP44]], 1
693*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP46:%.*]] = mul nuw i64 [[TMP45]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
694*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP47:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 2
695*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i64 [[TMP46]], i64* [[TMP47]], align 8
696*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP48:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 3
697*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* bitcast (void (i8*, i8*)* @.red_init..1 to i8*), i8** [[TMP48]], align 8
698*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP49:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 4
699*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* null, i8** [[TMP49]], align 8
700*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP50:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 5
701*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* bitcast (void (i8*, i8*)* @.red_comb..2 to i8*), i8** [[TMP50]], align 8
702*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP51:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 6
703*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32 1, i32* [[TMP51]], align 8
704*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP52:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
705*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP53:%.*]] = load i32, i32* [[TMP52]], align 4
706*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP54:%.*]] = bitcast [2 x %struct.kmp_taskred_input_t]* [[DOTRD_INPUT_]] to i8*
707*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP55:%.*]] = call i8* @__kmpc_taskred_modifier_init(%struct.ident_t* @[[GLOB1]], i32 [[TMP53]], i32 1, i32 2, i8* [[TMP54]])
708*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP55]], i8** [[DOTTASK_RED_]], align 8
709*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP56:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
710*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP57:%.*]] = load i32, i32* [[TMP56]], align 4
711*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void @__kmpc_for_static_init_8(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP57]], i32 34, i32* [[DOTOMP_IS_LAST]], i64* [[DOTOMP_LB]], i64* [[DOTOMP_UB]], i64* [[DOTOMP_STRIDE]], i64 1, i64 1)
712*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP58:%.*]] = load i64, i64* [[DOTOMP_UB]], align 8
713*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CMP:%.*]] = icmp sgt i64 [[TMP58]], 9
714*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
715*207b08a9SGiorgis Georgakoudis // CHECK2:       cond.true:
716*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br label [[COND_END:%.*]]
717*207b08a9SGiorgis Georgakoudis // CHECK2:       cond.false:
718*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP59:%.*]] = load i64, i64* [[DOTOMP_UB]], align 8
719*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br label [[COND_END]]
720*207b08a9SGiorgis Georgakoudis // CHECK2:       cond.end:
721*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[COND:%.*]] = phi i64 [ 9, [[COND_TRUE]] ], [ [[TMP59]], [[COND_FALSE]] ]
722*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i64 [[COND]], i64* [[DOTOMP_UB]], align 8
723*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP60:%.*]] = load i64, i64* [[DOTOMP_LB]], align 8
724*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i64 [[TMP60]], i64* [[DOTOMP_IV]], align 8
725*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br label [[OMP_INNER_FOR_COND:%.*]]
726*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.inner.for.cond:
727*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP61:%.*]] = load i64, i64* [[DOTOMP_IV]], align 8
728*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP62:%.*]] = load i64, i64* [[DOTOMP_UB]], align 8
729*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CMP13:%.*]] = icmp sle i64 [[TMP61]], [[TMP62]]
730*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[CMP13]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_COND_CLEANUP:%.*]]
731*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.inner.for.cond.cleanup:
732*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br label [[OMP_INNER_FOR_END:%.*]]
733*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.inner.for.body:
734*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP63:%.*]] = load i64, i64* [[DOTOMP_IV]], align 8
735*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[MUL:%.*]] = mul nsw i64 [[TMP63]], 1
736*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ADD:%.*]] = add nsw i64 0, [[MUL]]
737*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i64 [[ADD]], i64* [[I]], align 8
738*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP64:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[AGG_CAPTURED]], i32 0, i32 0
739*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8** [[DOTTASK_RED_]], i8*** [[TMP64]], align 8
740*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP65:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[AGG_CAPTURED]], i32 0, i32 1
741*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32* [[ARGC1]], i32** [[TMP65]], align 8
742*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP66:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[AGG_CAPTURED]], i32 0, i32 2
743*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP67:%.*]] = load i8**, i8*** [[_TMP5]], align 8
744*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8** [[TMP67]], i8*** [[TMP66]], align 8
745*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP68:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
746*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP69:%.*]] = load i32, i32* [[TMP68]], align 4
747*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP70:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @[[GLOB1]], i32 [[TMP69]], 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*)*))
748*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP71:%.*]] = bitcast i8* [[TMP70]] to %struct.kmp_task_t_with_privates*
749*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP72:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES:%.*]], %struct.kmp_task_t_with_privates* [[TMP71]], i32 0, i32 0
750*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP73:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T:%.*]], %struct.kmp_task_t* [[TMP72]], i32 0, i32 0
751*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP74:%.*]] = load i8*, i8** [[TMP73]], align 8
752*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP75:%.*]] = bitcast %struct.anon* [[AGG_CAPTURED]] to i8*
753*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[TMP74]], i8* align 8 [[TMP75]], i64 24, i1 false)
754*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP76:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES]], %struct.kmp_task_t_with_privates* [[TMP71]], i32 0, i32 1
755*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP77:%.*]] = getelementptr inbounds [[STRUCT__KMP_PRIVATES_T:%.*]], %struct..kmp_privates.t* [[TMP76]], i32 0, i32 0
756*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP78:%.*]] = load i8*, i8** [[DOTTASK_RED_]], align 8
757*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP78]], i8** [[TMP77]], align 8
758*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP79:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
759*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP80:%.*]] = load i32, i32* [[TMP79]], align 4
760*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP81:%.*]] = call i32 @__kmpc_omp_task(%struct.ident_t* @[[GLOB1]], i32 [[TMP80]], i8* [[TMP70]])
761*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br label [[OMP_BODY_CONTINUE:%.*]]
762*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.body.continue:
763*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br label [[OMP_INNER_FOR_INC:%.*]]
764*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.inner.for.inc:
765*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP82:%.*]] = load i64, i64* [[DOTOMP_IV]], align 8
766*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ADD14:%.*]] = add nsw i64 [[TMP82]], 1
767*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i64 [[ADD14]], i64* [[DOTOMP_IV]], align 8
768*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br label [[OMP_INNER_FOR_COND]]
769*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.inner.for.end:
770*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br label [[OMP_LOOP_EXIT:%.*]]
771*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.loop.exit:
772*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP83:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
773*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP84:%.*]] = load i32, i32* [[TMP83]], align 4
774*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void @__kmpc_for_static_fini(%struct.ident_t* @[[GLOB2]], i32 [[TMP84]])
775*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP85:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
776*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP86:%.*]] = load i32, i32* [[TMP85]], align 4
777*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void @__kmpc_task_reduction_modifier_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP86]], i32 1)
778*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP87:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
779*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP88:%.*]] = bitcast i32* [[ARGC1]] to i8*
780*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP88]], i8** [[TMP87]], align 8
781*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP89:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
782*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[VLA]], i8** [[TMP89]], align 8
783*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP90:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 2
784*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP91:%.*]] = inttoptr i64 [[TMP12]] to i8*
785*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP91]], i8** [[TMP90]], align 8
786*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP92:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
787*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP93:%.*]] = load i32, i32* [[TMP92]], align 4
788*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP94:%.*]] = bitcast [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8*
789*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP95:%.*]] = call i32 @__kmpc_reduce(%struct.ident_t* @[[GLOB3:[0-9]+]], i32 [[TMP93]], i32 2, i64 24, i8* [[TMP94]], void (i8*, i8*)* @.omp.reduction.reduction_func, [8 x i32]* @.gomp_critical_user_.reduction.var)
790*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    switch i32 [[TMP95]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [
791*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]]
792*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]]
793*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    ]
794*207b08a9SGiorgis Georgakoudis // CHECK2:       .omp.reduction.case1:
795*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP96:%.*]] = load i32, i32* [[TMP0]], align 4
796*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP97:%.*]] = load i32, i32* [[ARGC1]], align 4
797*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ADD15:%.*]] = add nsw i32 [[TMP96]], [[TMP97]]
798*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32 [[ADD15]], i32* [[TMP0]], align 4
799*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP98:%.*]] = getelementptr i8, i8* [[ARRAYIDX2]], i64 [[TMP12]]
800*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[ARRAYIDX2]], [[TMP98]]
801*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE22:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
802*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.arraycpy.body:
803*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[VLA]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
804*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST16:%.*]] = phi i8* [ [[ARRAYIDX2]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT20:%.*]], [[OMP_ARRAYCPY_BODY]] ]
805*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP99:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST16]], align 1
806*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV:%.*]] = sext i8 [[TMP99]] to i32
807*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP100:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1
808*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV17:%.*]] = sext i8 [[TMP100]] to i32
809*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ADD18:%.*]] = add nsw i32 [[CONV]], [[CONV17]]
810*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV19:%.*]] = trunc i32 [[ADD18]] to i8
811*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8 [[CONV19]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST16]], align 1
812*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT20]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST16]], i32 1
813*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
814*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DONE21:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT20]], [[TMP98]]
815*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[OMP_ARRAYCPY_DONE21]], label [[OMP_ARRAYCPY_DONE22]], label [[OMP_ARRAYCPY_BODY]]
816*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.arraycpy.done22:
817*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void @__kmpc_end_reduce(%struct.ident_t* @[[GLOB3]], i32 [[TMP93]], [8 x i32]* @.gomp_critical_user_.reduction.var)
818*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
819*207b08a9SGiorgis Georgakoudis // CHECK2:       .omp.reduction.case2:
820*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP101:%.*]] = load i32, i32* [[ARGC1]], align 4
821*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP102:%.*]] = atomicrmw add i32* [[TMP0]], i32 [[TMP101]] monotonic, align 4
822*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP103:%.*]] = getelementptr i8, i8* [[ARRAYIDX2]], i64 [[TMP12]]
823*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_ISEMPTY23:%.*]] = icmp eq i8* [[ARRAYIDX2]], [[TMP103]]
824*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[OMP_ARRAYCPY_ISEMPTY23]], label [[OMP_ARRAYCPY_DONE36:%.*]], label [[OMP_ARRAYCPY_BODY24:%.*]]
825*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.arraycpy.body24:
826*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_SRCELEMENTPAST25:%.*]] = phi i8* [ [[VLA]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT34:%.*]], [[ATOMIC_EXIT:%.*]] ]
827*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST26:%.*]] = phi i8* [ [[ARRAYIDX2]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT33:%.*]], [[ATOMIC_EXIT]] ]
828*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP104:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST25]], align 1
829*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV27:%.*]] = sext i8 [[TMP104]] to i32
830*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ATOMIC_LOAD:%.*]] = load atomic i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST26]] monotonic, align 1
831*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br label [[ATOMIC_CONT:%.*]]
832*207b08a9SGiorgis Georgakoudis // CHECK2:       atomic_cont:
833*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP105:%.*]] = phi i8 [ [[ATOMIC_LOAD]], [[OMP_ARRAYCPY_BODY24]] ], [ [[TMP110:%.*]], [[ATOMIC_CONT]] ]
834*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8 [[TMP105]], i8* [[_TMP28]], align 1
835*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP106:%.*]] = load i8, i8* [[_TMP28]], align 1
836*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV29:%.*]] = sext i8 [[TMP106]] to i32
837*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP107:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST25]], align 1
838*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV30:%.*]] = sext i8 [[TMP107]] to i32
839*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ADD31:%.*]] = add nsw i32 [[CONV29]], [[CONV30]]
840*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV32:%.*]] = trunc i32 [[ADD31]] to i8
841*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8 [[CONV32]], i8* [[ATOMIC_TEMP]], align 1
842*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP108:%.*]] = load i8, i8* [[ATOMIC_TEMP]], align 1
843*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP109:%.*]] = cmpxchg i8* [[OMP_ARRAYCPY_DESTELEMENTPAST26]], i8 [[TMP105]], i8 [[TMP108]] monotonic monotonic, align 1
844*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP110]] = extractvalue { i8, i1 } [[TMP109]], 0
845*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP111:%.*]] = extractvalue { i8, i1 } [[TMP109]], 1
846*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[TMP111]], label [[ATOMIC_EXIT]], label [[ATOMIC_CONT]]
847*207b08a9SGiorgis Georgakoudis // CHECK2:       atomic_exit:
848*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT33]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST26]], i32 1
849*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_SRC_ELEMENT34]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST25]], i32 1
850*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DONE35:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT33]], [[TMP103]]
851*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[OMP_ARRAYCPY_DONE35]], label [[OMP_ARRAYCPY_DONE36]], label [[OMP_ARRAYCPY_BODY24]]
852*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.arraycpy.done36:
853*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void @__kmpc_end_reduce(%struct.ident_t* @[[GLOB3]], i32 [[TMP93]], [8 x i32]* @.gomp_critical_user_.reduction.var)
854*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br label [[DOTOMP_REDUCTION_DEFAULT]]
855*207b08a9SGiorgis Georgakoudis // CHECK2:       .omp.reduction.default:
856*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP112:%.*]] = load i8*, i8** [[SAVED_STACK]], align 8
857*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void @llvm.stackrestore(i8* [[TMP112]])
858*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP113:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8
859*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP114:%.*]] = load i32, i32* [[TMP113]], align 4
860*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4:[0-9]+]], i32 [[TMP114]])
861*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    ret void
862*207b08a9SGiorgis Georgakoudis //
863*207b08a9SGiorgis Georgakoudis //
864*207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.red_init.
865*207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i8* noalias [[TMP0:%.*]], i8* noalias [[TMP1:%.*]]) #[[ATTR3:[0-9]+]] {
866*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:  entry:
867*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
868*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
869*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
870*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
871*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
872*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32*
873*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32 0, i32* [[TMP3]], align 8
874*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    ret void
875*207b08a9SGiorgis Georgakoudis //
876*207b08a9SGiorgis Georgakoudis //
877*207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.red_comb.
878*207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR3]] {
879*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:  entry:
880*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
881*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
882*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
883*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
884*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
885*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32*
886*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
887*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to i32*
888*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP6:%.*]] = load i32, i32* [[TMP3]], align 8
889*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP7:%.*]] = load i32, i32* [[TMP5]], align 8
890*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ADD:%.*]] = add nsw i32 [[TMP6]], [[TMP7]]
891*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32 [[ADD]], i32* [[TMP3]], align 8
892*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    ret void
893*207b08a9SGiorgis Georgakoudis //
894*207b08a9SGiorgis Georgakoudis //
895*207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.red_init..1
896*207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i8* noalias [[TMP0:%.*]], i8* noalias [[TMP1:%.*]]) #[[ATTR3]] {
897*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:  entry:
898*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
899*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
900*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
901*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
902*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
903*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP3:%.*]] = load i64, i64* @{{reduction_size[.].+[.]}}, align 8
904*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP4:%.*]] = getelementptr i8, i8* [[TMP2]], i64 [[TMP3]]
905*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq i8* [[TMP2]], [[TMP4]]
906*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]]
907*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.arrayinit.body:
908*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP2]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ]
909*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8 0, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
910*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
911*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP4]]
912*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]]
913*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.arrayinit.done:
914*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    ret void
915*207b08a9SGiorgis Georgakoudis //
916*207b08a9SGiorgis Georgakoudis //
917*207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.red_comb..2
918*207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR3]] {
919*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:  entry:
920*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
921*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
922*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
923*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
924*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP2:%.*]] = load i64, i64* @{{reduction_size[.].+[.]}}, align 8
925*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 8
926*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
927*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP5:%.*]] = getelementptr i8, i8* [[TMP3]], i64 [[TMP2]]
928*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[TMP3]], [[TMP5]]
929*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE4:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
930*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.arraycpy.body:
931*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[TMP4]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
932*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP3]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
933*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP6:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
934*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV:%.*]] = sext i8 [[TMP6]] to i32
935*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP7:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1
936*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV2:%.*]] = sext i8 [[TMP7]] to i32
937*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ADD:%.*]] = add nsw i32 [[CONV]], [[CONV2]]
938*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV3:%.*]] = trunc i32 [[ADD]] to i8
939*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8 [[CONV3]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
940*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
941*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
942*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP5]]
943*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE4]], label [[OMP_ARRAYCPY_BODY]]
944*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.arraycpy.done4:
945*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    ret void
946*207b08a9SGiorgis Georgakoudis //
947*207b08a9SGiorgis Georgakoudis //
948*207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.omp_task_privates_map.
949*207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (%struct..kmp_privates.t* noalias [[TMP0:%.*]], i8*** noalias [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] {
950*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:  entry:
951*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR:%.*]] = alloca %struct..kmp_privates.t*, align 8
952*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR1:%.*]] = alloca i8***, align 8
953*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store %struct..kmp_privates.t* [[TMP0]], %struct..kmp_privates.t** [[DOTADDR]], align 8
954*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8*** [[TMP1]], i8**** [[DOTADDR1]], align 8
955*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP2:%.*]] = load %struct..kmp_privates.t*, %struct..kmp_privates.t** [[DOTADDR]], align 8
956*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP3:%.*]] = getelementptr inbounds [[STRUCT__KMP_PRIVATES_T:%.*]], %struct..kmp_privates.t* [[TMP2]], i32 0, i32 0
957*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP4:%.*]] = load i8***, i8**** [[DOTADDR1]], align 8
958*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8** [[TMP3]], i8*** [[TMP4]], align 8
959*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    ret void
960*207b08a9SGiorgis Georgakoudis //
961*207b08a9SGiorgis Georgakoudis //
962*207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.omp_task_entry.
963*207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i32 [[TMP0:%.*]], %struct.kmp_task_t_with_privates* noalias [[TMP1:%.*]]) #[[ATTR3]] {
964*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:  entry:
965*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTGLOBAL_TID__ADDR_I:%.*]] = alloca i32, align 4
966*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTPART_ID__ADDR_I:%.*]] = alloca i32*, align 8
967*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTPRIVATES__ADDR_I:%.*]] = alloca i8*, align 8
968*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTCOPY_FN__ADDR_I:%.*]] = alloca void (i8*, ...)*, align 8
969*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTTASK_T__ADDR_I:%.*]] = alloca i8*, align 8
970*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[__CONTEXT_ADDR_I:%.*]] = alloca %struct.anon*, align 8
971*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTFIRSTPRIV_PTR_ADDR_I:%.*]] = alloca i8**, align 8
972*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP_I:%.*]] = alloca i8**, align 8
973*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP4_I:%.*]] = alloca i8*, align 8
974*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR:%.*]] = alloca i32, align 4
975*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR1:%.*]] = alloca %struct.kmp_task_t_with_privates*, align 8
976*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32 [[TMP0]], i32* [[DOTADDR]], align 4
977*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store %struct.kmp_task_t_with_privates* [[TMP1]], %struct.kmp_task_t_with_privates** [[DOTADDR1]], align 8
978*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP2:%.*]] = load i32, i32* [[DOTADDR]], align 4
979*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP3:%.*]] = load %struct.kmp_task_t_with_privates*, %struct.kmp_task_t_with_privates** [[DOTADDR1]], align 8
980*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP4:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES:%.*]], %struct.kmp_task_t_with_privates* [[TMP3]], i32 0, i32 0
981*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP5:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T:%.*]], %struct.kmp_task_t* [[TMP4]], i32 0, i32 2
982*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T]], %struct.kmp_task_t* [[TMP4]], i32 0, i32 0
983*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
984*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.anon*
985*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES]], %struct.kmp_task_t_with_privates* [[TMP3]], i32 0, i32 1
986*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP10:%.*]] = bitcast %struct..kmp_privates.t* [[TMP9]] to i8*
987*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP11:%.*]] = bitcast %struct.kmp_task_t_with_privates* [[TMP3]] to i8*
988*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void @llvm.experimental.noalias.scope.decl(metadata [[META2:![0-9]+]])
989*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void @llvm.experimental.noalias.scope.decl(metadata [[META5:![0-9]+]])
990*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void @llvm.experimental.noalias.scope.decl(metadata [[META7:![0-9]+]])
991*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void @llvm.experimental.noalias.scope.decl(metadata [[META9:![0-9]+]])
992*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32 [[TMP2]], i32* [[DOTGLOBAL_TID__ADDR_I]], align 4, !noalias !11
993*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32* [[TMP5]], i32** [[DOTPART_ID__ADDR_I]], align 8, !noalias !11
994*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP10]], i8** [[DOTPRIVATES__ADDR_I]], align 8, !noalias !11
995*207b08a9SGiorgis Georgakoudis // CHECK2-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 !11
996*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP11]], i8** [[DOTTASK_T__ADDR_I]], align 8, !noalias !11
997*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store %struct.anon* [[TMP8]], %struct.anon** [[__CONTEXT_ADDR_I]], align 8, !noalias !11
998*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP12:%.*]] = load %struct.anon*, %struct.anon** [[__CONTEXT_ADDR_I]], align 8, !noalias !11
999*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP13:%.*]] = load void (i8*, ...)*, void (i8*, ...)** [[DOTCOPY_FN__ADDR_I]], align 8, !noalias !11
1000*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP14:%.*]] = load i8*, i8** [[DOTPRIVATES__ADDR_I]], align 8, !noalias !11
1001*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP15:%.*]] = bitcast void (i8*, ...)* [[TMP13]] to void (i8*, i8***)*
1002*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    call void [[TMP15]](i8* [[TMP14]], i8*** [[DOTFIRSTPRIV_PTR_ADDR_I]]) #[[ATTR5:[0-9]+]]
1003*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP16:%.*]] = load i8**, i8*** [[DOTFIRSTPRIV_PTR_ADDR_I]], align 8, !noalias !11
1004*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP17:%.*]] = getelementptr inbounds [[STRUCT_ANON:%.*]], %struct.anon* [[TMP12]], i32 0, i32 1
1005*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP18:%.*]] = load i32*, i32** [[TMP17]], align 8
1006*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP19:%.*]] = load i8*, i8** [[TMP16]], align 8
1007*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP20:%.*]] = load i32, i32* [[DOTGLOBAL_TID__ADDR_I]], align 4, !noalias !11
1008*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP21:%.*]] = bitcast i32* [[TMP18]] to i8*
1009*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP22:%.*]] = call i8* @__kmpc_task_reduction_get_th_data(i32 [[TMP20]], i8* [[TMP19]], i8* [[TMP21]]) #[[ATTR5]]
1010*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV_I:%.*]] = bitcast i8* [[TMP22]] to i32*
1011*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP12]], i32 0, i32 2
1012*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP24:%.*]] = load i8**, i8*** [[TMP23]], align 8
1013*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP25:%.*]] = load i8*, i8** [[TMP24]], align 8
1014*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP26:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP12]], i32 0, i32 1
1015*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP27:%.*]] = load i32*, i32** [[TMP26]], align 8
1016*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP28:%.*]] = load i32, i32* [[TMP27]], align 4
1017*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP29:%.*]] = sext i32 [[TMP28]] to i64
1018*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[LB_ADD_LEN_I:%.*]] = add nsw i64 -1, [[TMP29]]
1019*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP30:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP12]], i32 0, i32 2
1020*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP31:%.*]] = load i8**, i8*** [[TMP30]], align 8
1021*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARRAYIDX2_I:%.*]] = getelementptr inbounds i8*, i8** [[TMP31]], i64 9
1022*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP32:%.*]] = load i8*, i8** [[ARRAYIDX2_I]], align 8
1023*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ARRAYIDX3_I:%.*]] = getelementptr inbounds i8, i8* [[TMP32]], i64 [[LB_ADD_LEN_I]]
1024*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP33:%.*]] = ptrtoint i8* [[ARRAYIDX3_I]] to i64
1025*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP34:%.*]] = ptrtoint i8* [[TMP25]] to i64
1026*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP35:%.*]] = sub i64 [[TMP33]], [[TMP34]]
1027*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP36:%.*]] = sdiv exact i64 [[TMP35]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
1028*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP37:%.*]] = add nuw i64 [[TMP36]], 1
1029*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP38:%.*]] = mul nuw i64 [[TMP37]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
1030*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i64 [[TMP37]], i64* @{{reduction_size[.].+[.]}}, align 8
1031*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP39:%.*]] = load i8*, i8** [[TMP16]], align 8
1032*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP40:%.*]] = call i8* @__kmpc_task_reduction_get_th_data(i32 [[TMP20]], i8* [[TMP39]], i8* [[TMP25]]) #[[ATTR5]]
1033*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP41:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP12]], i32 0, i32 2
1034*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP42:%.*]] = load i8**, i8*** [[TMP41]], align 8
1035*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP43:%.*]] = load i8*, i8** [[TMP42]], align 8
1036*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP44:%.*]] = ptrtoint i8* [[TMP43]] to i64
1037*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP45:%.*]] = ptrtoint i8* [[TMP25]] to i64
1038*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP46:%.*]] = sub i64 [[TMP44]], [[TMP45]]
1039*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP47:%.*]] = sdiv exact i64 [[TMP46]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
1040*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP48:%.*]] = getelementptr i8, i8* [[TMP40]], i64 [[TMP47]]
1041*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8** [[TMP4_I]], i8*** [[TMP_I]], align 8, !noalias !11
1042*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP48]], i8** [[TMP4_I]], align 8, !noalias !11
1043*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    ret i32 0
1044*207b08a9SGiorgis Georgakoudis //
1045*207b08a9SGiorgis Georgakoudis //
1046*207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func
1047*207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR3]] {
1048*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:  entry:
1049*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR:%.*]] = alloca i8*, align 8
1050*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[DOTADDR1:%.*]] = alloca i8*, align 8
1051*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP0]], i8** [[DOTADDR]], align 8
1052*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8* [[TMP1]], i8** [[DOTADDR1]], align 8
1053*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8
1054*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [3 x i8*]*
1055*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8
1056*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [3 x i8*]*
1057*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP6:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP5]], i64 0, i64 0
1058*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8
1059*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP8:%.*]] = bitcast i8* [[TMP7]] to i32*
1060*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP9:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 0
1061*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8
1062*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP11:%.*]] = bitcast i8* [[TMP10]] to i32*
1063*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP12:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP5]], i64 0, i64 1
1064*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 8
1065*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP14:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 1
1066*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP15:%.*]] = load i8*, i8** [[TMP14]], align 8
1067*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP16:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 2
1068*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 8
1069*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP18:%.*]] = ptrtoint i8* [[TMP17]] to i64
1070*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP19:%.*]] = load i32, i32* [[TMP11]], align 4
1071*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP20:%.*]] = load i32, i32* [[TMP8]], align 4
1072*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ADD:%.*]] = add nsw i32 [[TMP19]], [[TMP20]]
1073*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i32 [[ADD]], i32* [[TMP11]], align 4
1074*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP21:%.*]] = getelementptr i8, i8* [[TMP15]], i64 [[TMP18]]
1075*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[TMP15]], [[TMP21]]
1076*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE5:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]]
1077*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.arraycpy.body:
1078*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[TMP13]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1079*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP15]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ]
1080*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP22:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
1081*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV:%.*]] = sext i8 [[TMP22]] to i32
1082*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[TMP23:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1
1083*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV2:%.*]] = sext i8 [[TMP23]] to i32
1084*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[ADD3:%.*]] = add nsw i32 [[CONV]], [[CONV2]]
1085*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[CONV4:%.*]] = trunc i32 [[ADD3]] to i8
1086*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    store i8 [[CONV4]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1
1087*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1
1088*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1
1089*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP21]]
1090*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE5]], label [[OMP_ARRAYCPY_BODY]]
1091*207b08a9SGiorgis Georgakoudis // CHECK2:       omp.arraycpy.done5:
1092*207b08a9SGiorgis Georgakoudis // CHECK2-NEXT:    ret void
1093*207b08a9SGiorgis Georgakoudis //
1094*207b08a9SGiorgis Georgakoudis //
1095*207b08a9SGiorgis Georgakoudis // CHECK3-LABEL: define {{[^@]+}}@main
1096*207b08a9SGiorgis Georgakoudis // CHECK3-SAME: (i32 [[ARGC:%.*]], i8** [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
1097*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:  entry:
1098*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    [[RETVAL:%.*]] = alloca i32, align 4
1099*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    [[ARGC_ADDR:%.*]] = alloca i32, align 4
1100*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    [[ARGV_ADDR:%.*]] = alloca i8**, align 8
1101*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    [[I:%.*]] = alloca i64, align 8
1102*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    store i32 0, i32* [[RETVAL]], align 4
1103*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    store i32 [[ARGC]], i32* [[ARGC_ADDR]], align 4
1104*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    store i8** [[ARGV]], i8*** [[ARGV_ADDR]], align 8
1105*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    store i64 0, i64* [[I]], align 8
1106*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    br label [[FOR_COND:%.*]]
1107*207b08a9SGiorgis Georgakoudis // CHECK3:       for.cond:
1108*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    [[TMP0:%.*]] = load i64, i64* [[I]], align 8
1109*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    [[CMP:%.*]] = icmp slt i64 [[TMP0]], 10
1110*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]]
1111*207b08a9SGiorgis Georgakoudis // CHECK3:       for.body:
1112*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    br label [[FOR_INC:%.*]]
1113*207b08a9SGiorgis Georgakoudis // CHECK3:       for.inc:
1114*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    [[TMP1:%.*]] = load i64, i64* [[I]], align 8
1115*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    [[INC:%.*]] = add nsw i64 [[TMP1]], 1
1116*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    store i64 [[INC]], i64* [[I]], align 8
1117*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP2:![0-9]+]]
1118*207b08a9SGiorgis Georgakoudis // CHECK3:       for.end:
1119*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    [[TMP2:%.*]] = load i32, i32* [[RETVAL]], align 4
1120*207b08a9SGiorgis Georgakoudis // CHECK3-NEXT:    ret i32 [[TMP2]]
1121*207b08a9SGiorgis Georgakoudis //
1122*207b08a9SGiorgis Georgakoudis //
1123*207b08a9SGiorgis Georgakoudis // CHECK4-LABEL: define {{[^@]+}}@main
1124*207b08a9SGiorgis Georgakoudis // CHECK4-SAME: (i32 [[ARGC:%.*]], i8** [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] !dbg [[DBG6:![0-9]+]] {
1125*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:  entry:
1126*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    [[RETVAL:%.*]] = alloca i32, align 4
1127*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    [[ARGC_ADDR:%.*]] = alloca i32, align 4
1128*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    [[ARGV_ADDR:%.*]] = alloca i8**, align 8
1129*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    [[I:%.*]] = alloca i64, align 8
1130*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    store i32 0, i32* [[RETVAL]], align 4
1131*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    store i32 [[ARGC]], i32* [[ARGC_ADDR]], align 4
1132*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    call void @llvm.dbg.declare(metadata i32* [[ARGC_ADDR]], metadata [[META14:![0-9]+]], metadata !DIExpression()), !dbg [[DBG15:![0-9]+]]
1133*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    store i8** [[ARGV]], i8*** [[ARGV_ADDR]], align 8
1134*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    call void @llvm.dbg.declare(metadata i8*** [[ARGV_ADDR]], metadata [[META16:![0-9]+]], metadata !DIExpression()), !dbg [[DBG17:![0-9]+]]
1135*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    call void @llvm.dbg.declare(metadata i64* [[I]], metadata [[META18:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23:![0-9]+]]
1136*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    store i64 0, i64* [[I]], align 8, !dbg [[DBG23]]
1137*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    br label [[FOR_COND:%.*]], !dbg [[DBG24:![0-9]+]]
1138*207b08a9SGiorgis Georgakoudis // CHECK4:       for.cond:
1139*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    [[TMP0:%.*]] = load i64, i64* [[I]], align 8, !dbg [[DBG25:![0-9]+]]
1140*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    [[CMP:%.*]] = icmp slt i64 [[TMP0]], 10, !dbg [[DBG27:![0-9]+]]
1141*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]], !dbg [[DBG28:![0-9]+]]
1142*207b08a9SGiorgis Georgakoudis // CHECK4:       for.body:
1143*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    br label [[FOR_INC:%.*]], !dbg [[DBG29:![0-9]+]]
1144*207b08a9SGiorgis Georgakoudis // CHECK4:       for.inc:
1145*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    [[TMP1:%.*]] = load i64, i64* [[I]], align 8, !dbg [[DBG31:![0-9]+]]
1146*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    [[INC:%.*]] = add nsw i64 [[TMP1]], 1, !dbg [[DBG31]]
1147*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    store i64 [[INC]], i64* [[I]], align 8, !dbg [[DBG31]]
1148*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    br label [[FOR_COND]], !dbg [[DBG32:![0-9]+]], !llvm.loop [[LOOP33:![0-9]+]]
1149*207b08a9SGiorgis Georgakoudis // CHECK4:       for.end:
1150*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    [[TMP2:%.*]] = load i32, i32* [[RETVAL]], align 4, !dbg [[DBG36:![0-9]+]]
1151*207b08a9SGiorgis Georgakoudis // CHECK4-NEXT:    ret i32 [[TMP2]], !dbg [[DBG36]]
1152*207b08a9SGiorgis Georgakoudis //
1153