1207b08a9SGiorgis Georgakoudis // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _ 2207b08a9SGiorgis 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 4207b08a9SGiorgis 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 66ff380f4SJohannes Doerfert // RUN: %clang_cc1 -triple x86_64-unknown-linux -verify -fopenmp-simd -x c++ -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}" 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 86ff380f4SJohannes Doerfert // 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 --implicit-check-not="{{__kmpc|__tgt}}" 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 master reduction(task, +: argc, argv[0:10][0:argc]) 158c2f4e0eSAlexey Bataev { 168c2f4e0eSAlexey Bataev #pragma omp task in_reduction(+: argc, argv[0:10][0:argc]) 178c2f4e0eSAlexey Bataev ; 188c2f4e0eSAlexey Bataev } 198c2f4e0eSAlexey Bataev } 208c2f4e0eSAlexey Bataev 218c2f4e0eSAlexey Bataev 228c2f4e0eSAlexey Bataev 238c2f4e0eSAlexey Bataev // Init firstprivate copy of argc 248c2f4e0eSAlexey Bataev 258c2f4e0eSAlexey Bataev // Init firstprivate copy of argv[0:10][0:argc] 268c2f4e0eSAlexey Bataev 278c2f4e0eSAlexey Bataev // Register task reduction. 288c2f4e0eSAlexey Bataev 298c2f4e0eSAlexey Bataev 308c2f4e0eSAlexey Bataev 318c2f4e0eSAlexey Bataev 328c2f4e0eSAlexey Bataev 338c2f4e0eSAlexey Bataev 348c2f4e0eSAlexey Bataev 358c2f4e0eSAlexey Bataev 368c2f4e0eSAlexey Bataev 378c2f4e0eSAlexey Bataev #endif 38207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@main 39207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i32 [[ARGC:%.*]], i8** [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] { 40207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: entry: 41207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4 42207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[ARGV_ADDR:%.*]] = alloca i8**, align 8 43*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_OUTLINED_ARG_AGG_:%.*]] = alloca [[STRUCT_ANON:%.*]], align 8 44207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i32 [[ARGC]], i32* [[ARGC_ADDR]], align 4 45207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8** [[ARGV]], i8*** [[ARGV_ADDR]], align 8 46*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[OMP_OUTLINED_ARG_AGG_]], i32 0, i32 0 47*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i32* [[ARGC_ADDR]], i32** [[TMP0]], align 8 48*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[OMP_OUTLINED_ARG_AGG_]], i32 0, i32 1 49*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP2:%.*]] = load i8**, i8*** [[ARGV_ADDR]], align 8 50*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8** [[TMP2]], i8*** [[TMP1]], align 8 51*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1:[0-9]+]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.anon*)* @.omp_outlined. to void (i32*, i32*, ...)*), %struct.anon* [[OMP_OUTLINED_ARG_AGG_]]) 52207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: ret i32 0 53207b08a9SGiorgis Georgakoudis // 54207b08a9SGiorgis Georgakoudis // 55207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.omp_outlined. 56*e9c7291cSGiorgis Georgakoudis // CHECK1-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], %struct.anon* noalias [[__CONTEXT:%.*]]) #[[ATTR1:[0-9]+]] { 57207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: entry: 58207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8 59207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8 60*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[__CONTEXT_ADDR:%.*]] = alloca %struct.anon*, align 8 61*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[ARGC:%.*]] = alloca i32, align 4 62207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[SAVED_STACK:%.*]] = alloca i8*, align 8 63207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8 64207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP:%.*]] = alloca i8**, align 8 65*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[_TMP4:%.*]] = alloca i8*, align 8 66207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTRD_INPUT_:%.*]] = alloca [2 x %struct.kmp_taskred_input_t], align 8 67207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTTASK_RED_:%.*]] = alloca i8*, align 8 68*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[AGG_CAPTURED:%.*]] = alloca [[STRUCT_ANON_0:%.*]], align 8 69207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [3 x i8*], align 8 70207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[ATOMIC_TEMP:%.*]] = alloca i8, align 1 71*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[_TMP23:%.*]] = alloca i8, align 1 72207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8 73207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8 74*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store %struct.anon* [[__CONTEXT]], %struct.anon** [[__CONTEXT_ADDR]], align 8 75*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP0:%.*]] = load %struct.anon*, %struct.anon** [[__CONTEXT_ADDR]], align 8 76*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_ANON:%.*]], %struct.anon* [[TMP0]], i32 0, i32 0 77*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP2:%.*]] = load i32*, i32** [[TMP1]], align 8 78*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP0]], i32 0, i32 1 79*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i32 0, i32* [[ARGC]], align 4 80*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP4:%.*]] = load i8**, i8*** [[TMP3]], align 8 81*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8*, i8** [[TMP4]], i64 0 82*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP5:%.*]] = load i8*, i8** [[ARRAYIDX]], align 8 83*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i8, i8* [[TMP5]], i64 0 84*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP2]], align 4 85*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP7:%.*]] = sext i32 [[TMP6]] to i64 86*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[LB_ADD_LEN:%.*]] = add nsw i64 -1, [[TMP7]] 87*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP8:%.*]] = load i8**, i8*** [[TMP3]], align 8 88*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds i8*, i8** [[TMP8]], i64 9 89*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP9:%.*]] = load i8*, i8** [[ARRAYIDX2]], align 8 90*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i8, i8* [[TMP9]], i64 [[LB_ADD_LEN]] 91*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP10:%.*]] = ptrtoint i8* [[ARRAYIDX3]] to i64 92*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP11:%.*]] = ptrtoint i8* [[ARRAYIDX1]] to i64 93*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP12:%.*]] = sub i64 [[TMP10]], [[TMP11]] 94*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP13:%.*]] = sdiv exact i64 [[TMP12]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 95*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP14:%.*]] = add nuw i64 [[TMP13]], 1 96*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP15:%.*]] = mul nuw i64 [[TMP14]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 97*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP16:%.*]] = call i8* @llvm.stacksave() 98*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP16]], i8** [[SAVED_STACK]], align 8 99*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[VLA:%.*]] = alloca i8, i64 [[TMP14]], align 16 100*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i64 [[TMP14]], i64* [[__VLA_EXPR0]], align 8 101*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr i8, i8* [[VLA]], i64 [[TMP14]] 102*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq i8* [[VLA]], [[TMP17]] 103207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]] 104207b08a9SGiorgis Georgakoudis // CHECK1: omp.arrayinit.body: 105207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[VLA]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ] 106207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8 0, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1 107207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1 108*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP17]] 109207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]] 110207b08a9SGiorgis Georgakoudis // CHECK1: omp.arrayinit.done: 111*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP18:%.*]] = load i8**, i8*** [[TMP3]], align 8 112*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP19:%.*]] = load i8*, i8** [[TMP18]], align 8 113*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP20:%.*]] = ptrtoint i8* [[TMP19]] to i64 114*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP21:%.*]] = ptrtoint i8* [[ARRAYIDX1]] to i64 115*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP22:%.*]] = sub i64 [[TMP20]], [[TMP21]] 116*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP23:%.*]] = sdiv exact i64 [[TMP22]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 117*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr i8, i8* [[VLA]], i64 [[TMP23]] 118*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8** [[_TMP4]], i8*** [[TMP]], align 8 119*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP24]], i8** [[_TMP4]], align 8 120207b08a9SGiorgis 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 121*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T:%.*]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 0 122*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP26:%.*]] = bitcast i32* [[ARGC]] to i8* 123*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP26]], i8** [[TMP25]], align 8 124*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 1 125*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP28:%.*]] = bitcast i32* [[TMP2]] to i8* 126*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP28]], i8** [[TMP27]], align 8 127*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 2 128*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i64 4, i64* [[TMP29]], align 8 129*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 3 130*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* bitcast (void (i8*, i8*)* @.red_init. to i8*), i8** [[TMP30]], align 8 131*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 4 132*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* null, i8** [[TMP31]], align 8 133*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 5 134*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* bitcast (void (i8*, i8*)* @.red_comb. to i8*), i8** [[TMP32]], align 8 135*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 6 136*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP34:%.*]] = bitcast i32* [[TMP33]] to i8* 137*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP34]], i8 0, i64 4, i1 false) 138*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[DOTRD_INPUT_GEP_5:%.*]] = getelementptr inbounds [2 x %struct.kmp_taskred_input_t], [2 x %struct.kmp_taskred_input_t]* [[DOTRD_INPUT_]], i64 0, i64 1 139*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 0 140*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP36:%.*]] = load i8**, i8*** [[TMP3]], align 8 141*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds i8*, i8** [[TMP36]], i64 0 142*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP37:%.*]] = load i8*, i8** [[ARRAYIDX6]], align 8 143*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[ARRAYIDX7:%.*]] = getelementptr inbounds i8, i8* [[TMP37]], i64 0 144*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP38:%.*]] = load i32, i32* [[TMP2]], align 4 145*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP39:%.*]] = sext i32 [[TMP38]] to i64 146*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[LB_ADD_LEN8:%.*]] = add nsw i64 -1, [[TMP39]] 147*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP40:%.*]] = load i8**, i8*** [[TMP3]], align 8 148*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds i8*, i8** [[TMP40]], i64 9 149*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP41:%.*]] = load i8*, i8** [[ARRAYIDX9]], align 8 150*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds i8, i8* [[TMP41]], i64 [[LB_ADD_LEN8]] 151*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[VLA]], i8** [[TMP35]], align 8 152*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 1 153*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[ARRAYIDX7]], i8** [[TMP42]], align 8 154*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP43:%.*]] = ptrtoint i8* [[ARRAYIDX10]] to i64 155*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP44:%.*]] = ptrtoint i8* [[ARRAYIDX7]] to i64 156*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP45:%.*]] = sub i64 [[TMP43]], [[TMP44]] 157*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP46:%.*]] = sdiv exact i64 [[TMP45]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 158*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP47:%.*]] = add nuw i64 [[TMP46]], 1 159*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP48:%.*]] = mul nuw i64 [[TMP47]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 160*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 2 161*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i64 [[TMP48]], i64* [[TMP49]], align 8 162*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 3 163*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* bitcast (void (i8*, i8*)* @.red_init..1 to i8*), i8** [[TMP50]], align 8 164*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 4 165*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* null, i8** [[TMP51]], align 8 166*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 5 167*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* bitcast (void (i8*, i8*)* @.red_comb..2 to i8*), i8** [[TMP52]], align 8 168*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 6 169*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i32 1, i32* [[TMP53]], align 8 170*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP54:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 171*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP55:%.*]] = load i32, i32* [[TMP54]], align 4 172*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP56:%.*]] = bitcast [2 x %struct.kmp_taskred_input_t]* [[DOTRD_INPUT_]] to i8* 173*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP57:%.*]] = call i8* @__kmpc_taskred_modifier_init(%struct.ident_t* @[[GLOB1]], i32 [[TMP55]], i32 0, i32 2, i8* [[TMP56]]) 174*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP57]], i8** [[DOTTASK_RED_]], align 8 175*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP58:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 176*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP59:%.*]] = load i32, i32* [[TMP58]], align 4 177*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP60:%.*]] = call i32 @__kmpc_master(%struct.ident_t* @[[GLOB1]], i32 [[TMP59]]) 178*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP61:%.*]] = icmp ne i32 [[TMP60]], 0 179*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[TMP61]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_END:%.*]] 180207b08a9SGiorgis Georgakoudis // CHECK1: omp_if.then: 181*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP62:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[AGG_CAPTURED]], i32 0, i32 0 182*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8** [[DOTTASK_RED_]], i8*** [[TMP62]], align 8 183*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP63:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[AGG_CAPTURED]], i32 0, i32 1 184*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i32* [[ARGC]], i32** [[TMP63]], align 8 185*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP64:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[AGG_CAPTURED]], i32 0, i32 2 186*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP65:%.*]] = load i8**, i8*** [[TMP]], align 8 187*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8** [[TMP65]], i8*** [[TMP64]], align 8 188*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP66:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 189*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP67:%.*]] = load i32, i32* [[TMP66]], align 4 190*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP68:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @[[GLOB1]], i32 [[TMP67]], 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*)*)) 191*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP69:%.*]] = bitcast i8* [[TMP68]] to %struct.kmp_task_t_with_privates* 192*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP70:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES:%.*]], %struct.kmp_task_t_with_privates* [[TMP69]], i32 0, i32 0 193*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP71:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T:%.*]], %struct.kmp_task_t* [[TMP70]], i32 0, i32 0 194*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP72:%.*]] = load i8*, i8** [[TMP71]], align 8 195*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP73:%.*]] = bitcast %struct.anon.0* [[AGG_CAPTURED]] to i8* 196*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[TMP72]], i8* align 8 [[TMP73]], i64 24, i1 false) 197*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP74:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES]], %struct.kmp_task_t_with_privates* [[TMP69]], i32 0, i32 1 198*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP75:%.*]] = getelementptr inbounds [[STRUCT__KMP_PRIVATES_T:%.*]], %struct..kmp_privates.t* [[TMP74]], i32 0, i32 0 199*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP76:%.*]] = load i8*, i8** [[DOTTASK_RED_]], align 8 200*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP76]], i8** [[TMP75]], align 8 201207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP77:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 202207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP78:%.*]] = load i32, i32* [[TMP77]], align 4 203*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP79:%.*]] = call i32 @__kmpc_omp_task(%struct.ident_t* @[[GLOB1]], i32 [[TMP78]], i8* [[TMP68]]) 204*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: call void @__kmpc_end_master(%struct.ident_t* @[[GLOB1]], i32 [[TMP59]]) 205*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: br label [[OMP_IF_END]] 206*e9c7291cSGiorgis Georgakoudis // CHECK1: omp_if.end: 207*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP80:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 208*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP81:%.*]] = load i32, i32* [[TMP80]], align 4 209*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: call void @__kmpc_task_reduction_modifier_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP81]], i32 0) 210*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP82:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0 211*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP83:%.*]] = bitcast i32* [[ARGC]] to i8* 212207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP83]], i8** [[TMP82]], align 8 213*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP84:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1 214*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[VLA]], i8** [[TMP84]], align 8 215*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP85:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 2 216*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP86:%.*]] = inttoptr i64 [[TMP14]] to i8* 217*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP86]], i8** [[TMP85]], align 8 218*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP87:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 219*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP88:%.*]] = load i32, i32* [[TMP87]], align 4 220*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP89:%.*]] = bitcast [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* 221*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP90:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP88]], i32 2, i64 24, i8* [[TMP89]], void (i8*, i8*)* @.omp.reduction.reduction_func, [8 x i32]* @.gomp_critical_user_.reduction.var) 222*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: switch i32 [[TMP90]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [ 223207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]] 224207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]] 225207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: ] 226207b08a9SGiorgis Georgakoudis // CHECK1: .omp.reduction.case1: 227*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP91:%.*]] = load i32, i32* [[TMP2]], align 4 228*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP92:%.*]] = load i32, i32* [[ARGC]], align 4 229*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP91]], [[TMP92]] 230*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i32 [[ADD]], i32* [[TMP2]], align 4 231*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP93:%.*]] = getelementptr i8, i8* [[ARRAYIDX1]], i64 [[TMP14]] 232*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[ARRAYIDX1]], [[TMP93]] 233*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE17:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]] 234207b08a9SGiorgis Georgakoudis // CHECK1: omp.arraycpy.body: 235207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[VLA]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ] 236*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST11:%.*]] = phi i8* [ [[ARRAYIDX1]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT15:%.*]], [[OMP_ARRAYCPY_BODY]] ] 237*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP94:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST11]], align 1 238*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[CONV:%.*]] = sext i8 [[TMP94]] to i32 239*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP95:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1 240*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[CONV12:%.*]] = sext i8 [[TMP95]] to i32 241*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[ADD13:%.*]] = add nsw i32 [[CONV]], [[CONV12]] 242*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[CONV14:%.*]] = trunc i32 [[ADD13]] to i8 243*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8 [[CONV14]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST11]], align 1 244*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT15]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST11]], i32 1 245207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1 246*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE16:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT15]], [[TMP93]] 247*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE16]], label [[OMP_ARRAYCPY_DONE17]], label [[OMP_ARRAYCPY_BODY]] 248*e9c7291cSGiorgis Georgakoudis // CHECK1: omp.arraycpy.done17: 249*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP88]], [8 x i32]* @.gomp_critical_user_.reduction.var) 250207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]] 251207b08a9SGiorgis Georgakoudis // CHECK1: .omp.reduction.case2: 252*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP96:%.*]] = load i32, i32* [[ARGC]], align 4 253*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP97:%.*]] = atomicrmw add i32* [[TMP2]], i32 [[TMP96]] monotonic, align 4 254*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP98:%.*]] = getelementptr i8, i8* [[ARRAYIDX1]], i64 [[TMP14]] 255*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY18:%.*]] = icmp eq i8* [[ARRAYIDX1]], [[TMP98]] 256*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY18]], label [[OMP_ARRAYCPY_DONE31:%.*]], label [[OMP_ARRAYCPY_BODY19:%.*]] 257*e9c7291cSGiorgis Georgakoudis // CHECK1: omp.arraycpy.body19: 258*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST20:%.*]] = phi i8* [ [[VLA]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT29:%.*]], [[ATOMIC_EXIT:%.*]] ] 259*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST21:%.*]] = phi i8* [ [[ARRAYIDX1]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT28:%.*]], [[ATOMIC_EXIT]] ] 260*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP99:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST20]], align 1 261*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[CONV22:%.*]] = sext i8 [[TMP99]] to i32 262*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[ATOMIC_LOAD:%.*]] = load atomic i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST21]] monotonic, align 1 263207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: br label [[ATOMIC_CONT:%.*]] 264207b08a9SGiorgis Georgakoudis // CHECK1: atomic_cont: 265*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP100:%.*]] = phi i8 [ [[ATOMIC_LOAD]], [[OMP_ARRAYCPY_BODY19]] ], [ [[TMP105:%.*]], [[ATOMIC_CONT]] ] 266*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8 [[TMP100]], i8* [[_TMP23]], align 1 267*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP101:%.*]] = load i8, i8* [[_TMP23]], align 1 268*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[CONV24:%.*]] = sext i8 [[TMP101]] to i32 269*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP102:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST20]], align 1 270*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[CONV25:%.*]] = sext i8 [[TMP102]] to i32 271*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[ADD26:%.*]] = add nsw i32 [[CONV24]], [[CONV25]] 272*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[CONV27:%.*]] = trunc i32 [[ADD26]] to i8 273*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store i8 [[CONV27]], i8* [[ATOMIC_TEMP]], align 1 274*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP103:%.*]] = load i8, i8* [[ATOMIC_TEMP]], align 1 275*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP104:%.*]] = cmpxchg i8* [[OMP_ARRAYCPY_DESTELEMENTPAST21]], i8 [[TMP100]], i8 [[TMP103]] monotonic monotonic, align 1 276*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP105]] = extractvalue { i8, i1 } [[TMP104]], 0 277*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP106:%.*]] = extractvalue { i8, i1 } [[TMP104]], 1 278*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[TMP106]], label [[ATOMIC_EXIT]], label [[ATOMIC_CONT]] 279207b08a9SGiorgis Georgakoudis // CHECK1: atomic_exit: 280*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT28]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST21]], i32 1 281*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT29]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST20]], i32 1 282*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE30:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT28]], [[TMP98]] 283*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE30]], label [[OMP_ARRAYCPY_DONE31]], label [[OMP_ARRAYCPY_BODY19]] 284*e9c7291cSGiorgis Georgakoudis // CHECK1: omp.arraycpy.done31: 285207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]] 286207b08a9SGiorgis Georgakoudis // CHECK1: .omp.reduction.default: 287*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP107:%.*]] = load i8*, i8** [[SAVED_STACK]], align 8 288*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: call void @llvm.stackrestore(i8* [[TMP107]]) 289207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: ret void 290207b08a9SGiorgis Georgakoudis // 291207b08a9SGiorgis Georgakoudis // 292207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.red_init. 293207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i8* noalias [[TMP0:%.*]], i8* noalias [[TMP1:%.*]]) #[[ATTR3:[0-9]+]] { 294207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: entry: 295207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 296207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i8*, align 8 297207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 298207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP1]], i8** [[DOTADDR1]], align 8 299207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8 300207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32* 301207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i32 0, i32* [[TMP3]], align 8 302207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: ret void 303207b08a9SGiorgis Georgakoudis // 304207b08a9SGiorgis Georgakoudis // 305207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.red_comb. 306207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR3]] { 307207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: entry: 308207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 309207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i8*, align 8 310207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 311207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP1]], i8** [[DOTADDR1]], align 8 312207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8 313207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32* 314207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8 315207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to i32* 316207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP3]], align 8 317207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP5]], align 8 318207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP6]], [[TMP7]] 319207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i32 [[ADD]], i32* [[TMP3]], align 8 320207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: ret void 321207b08a9SGiorgis Georgakoudis // 322207b08a9SGiorgis Georgakoudis // 323207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.red_init..1 324207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i8* noalias [[TMP0:%.*]], i8* noalias [[TMP1:%.*]]) #[[ATTR3]] { 325207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: entry: 326207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 327207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i8*, align 8 328207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 329207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP1]], i8** [[DOTADDR1]], align 8 330207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8 331207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP3:%.*]] = load i64, i64* @{{reduction_size[.].+[.]}}, align 8 332207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr i8, i8* [[TMP2]], i64 [[TMP3]] 333207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq i8* [[TMP2]], [[TMP4]] 334207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]] 335207b08a9SGiorgis Georgakoudis // CHECK1: omp.arrayinit.body: 336207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP2]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ] 337207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8 0, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1 338207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1 339207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP4]] 340207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]] 341207b08a9SGiorgis Georgakoudis // CHECK1: omp.arrayinit.done: 342207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: ret void 343207b08a9SGiorgis Georgakoudis // 344207b08a9SGiorgis Georgakoudis // 345207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.red_comb..2 346207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR3]] { 347207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: entry: 348207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 349207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i8*, align 8 350207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 351207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP1]], i8** [[DOTADDR1]], align 8 352207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP2:%.*]] = load i64, i64* @{{reduction_size[.].+[.]}}, align 8 353207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 8 354207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8 355207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr i8, i8* [[TMP3]], i64 [[TMP2]] 356207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[TMP3]], [[TMP5]] 357207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE4:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]] 358207b08a9SGiorgis Georgakoudis // CHECK1: omp.arraycpy.body: 359207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[TMP4]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ] 360207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP3]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ] 361207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP6:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1 362207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[CONV:%.*]] = sext i8 [[TMP6]] to i32 363207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP7:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1 364207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[CONV2:%.*]] = sext i8 [[TMP7]] to i32 365207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[CONV]], [[CONV2]] 366207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[CONV3:%.*]] = trunc i32 [[ADD]] to i8 367207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8 [[CONV3]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1 368207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1 369207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1 370207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP5]] 371207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE4]], label [[OMP_ARRAYCPY_BODY]] 372207b08a9SGiorgis Georgakoudis // CHECK1: omp.arraycpy.done4: 373207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: ret void 374207b08a9SGiorgis Georgakoudis // 375207b08a9SGiorgis Georgakoudis // 376207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.omp_task_privates_map. 377207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (%struct..kmp_privates.t* noalias [[TMP0:%.*]], i8*** noalias [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] { 378207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: entry: 379207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca %struct..kmp_privates.t*, align 8 380207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i8***, align 8 381207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store %struct..kmp_privates.t* [[TMP0]], %struct..kmp_privates.t** [[DOTADDR]], align 8 382207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8*** [[TMP1]], i8**** [[DOTADDR1]], align 8 383207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP2:%.*]] = load %struct..kmp_privates.t*, %struct..kmp_privates.t** [[DOTADDR]], align 8 384207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT__KMP_PRIVATES_T:%.*]], %struct..kmp_privates.t* [[TMP2]], i32 0, i32 0 385207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP4:%.*]] = load i8***, i8**** [[DOTADDR1]], align 8 386207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8** [[TMP3]], i8*** [[TMP4]], align 8 387207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: ret void 388207b08a9SGiorgis Georgakoudis // 389207b08a9SGiorgis Georgakoudis // 390207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.omp_task_entry. 391207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i32 [[TMP0:%.*]], %struct.kmp_task_t_with_privates* noalias [[TMP1:%.*]]) #[[ATTR3]] { 392207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: entry: 393207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR_I:%.*]] = alloca i32, align 4 394207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTPART_ID__ADDR_I:%.*]] = alloca i32*, align 8 395207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTPRIVATES__ADDR_I:%.*]] = alloca i8*, align 8 396207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTCOPY_FN__ADDR_I:%.*]] = alloca void (i8*, ...)*, align 8 397207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTTASK_T__ADDR_I:%.*]] = alloca i8*, align 8 398*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[__CONTEXT_ADDR_I:%.*]] = alloca %struct.anon.0*, align 8 399207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTFIRSTPRIV_PTR_ADDR_I:%.*]] = alloca i8**, align 8 400207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP_I:%.*]] = alloca i8**, align 8 401207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP4_I:%.*]] = alloca i8*, align 8 402207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i32, align 4 403207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca %struct.kmp_task_t_with_privates*, align 8 404207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i32 [[TMP0]], i32* [[DOTADDR]], align 4 405207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store %struct.kmp_task_t_with_privates* [[TMP1]], %struct.kmp_task_t_with_privates** [[DOTADDR1]], align 8 406207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP2:%.*]] = load i32, i32* [[DOTADDR]], align 4 407207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP3:%.*]] = load %struct.kmp_task_t_with_privates*, %struct.kmp_task_t_with_privates** [[DOTADDR1]], align 8 408207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES:%.*]], %struct.kmp_task_t_with_privates* [[TMP3]], i32 0, i32 0 409207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T:%.*]], %struct.kmp_task_t* [[TMP4]], i32 0, i32 2 410207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T]], %struct.kmp_task_t* [[TMP4]], i32 0, i32 0 411207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8 412*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.anon.0* 413207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES]], %struct.kmp_task_t_with_privates* [[TMP3]], i32 0, i32 1 414207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP10:%.*]] = bitcast %struct..kmp_privates.t* [[TMP9]] to i8* 415207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP11:%.*]] = bitcast %struct.kmp_task_t_with_privates* [[TMP3]] to i8* 4169ce02ea8SJoseph Huber // CHECK1-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META3:![0-9]+]]) 4179ce02ea8SJoseph Huber // CHECK1-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META6:![0-9]+]]) 4189ce02ea8SJoseph Huber // CHECK1-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META8:![0-9]+]]) 4199ce02ea8SJoseph Huber // CHECK1-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META10:![0-9]+]]) 4209ce02ea8SJoseph Huber // CHECK1-NEXT: store i32 [[TMP2]], i32* [[DOTGLOBAL_TID__ADDR_I]], align 4, !noalias !12 4219ce02ea8SJoseph Huber // CHECK1-NEXT: store i32* [[TMP5]], i32** [[DOTPART_ID__ADDR_I]], align 8, !noalias !12 4229ce02ea8SJoseph Huber // CHECK1-NEXT: store i8* [[TMP10]], i8** [[DOTPRIVATES__ADDR_I]], align 8, !noalias !12 4239ce02ea8SJoseph Huber // CHECK1-NEXT: store void (i8*, ...)* bitcast (void (%struct..kmp_privates.t*, i8***)* @.omp_task_privates_map. to void (i8*, ...)*), void (i8*, ...)** [[DOTCOPY_FN__ADDR_I]], align 8, !noalias !12 4249ce02ea8SJoseph Huber // CHECK1-NEXT: store i8* [[TMP11]], i8** [[DOTTASK_T__ADDR_I]], align 8, !noalias !12 425*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: store %struct.anon.0* [[TMP8]], %struct.anon.0** [[__CONTEXT_ADDR_I]], align 8, !noalias !12 426*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP12:%.*]] = load %struct.anon.0*, %struct.anon.0** [[__CONTEXT_ADDR_I]], align 8, !noalias !12 4279ce02ea8SJoseph Huber // CHECK1-NEXT: [[TMP13:%.*]] = load void (i8*, ...)*, void (i8*, ...)** [[DOTCOPY_FN__ADDR_I]], align 8, !noalias !12 4289ce02ea8SJoseph Huber // CHECK1-NEXT: [[TMP14:%.*]] = load i8*, i8** [[DOTPRIVATES__ADDR_I]], align 8, !noalias !12 429207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP15:%.*]] = bitcast void (i8*, ...)* [[TMP13]] to void (i8*, i8***)* 430207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: call void [[TMP15]](i8* [[TMP14]], i8*** [[DOTFIRSTPRIV_PTR_ADDR_I]]) #[[ATTR5:[0-9]+]] 4319ce02ea8SJoseph Huber // CHECK1-NEXT: [[TMP16:%.*]] = load i8**, i8*** [[DOTFIRSTPRIV_PTR_ADDR_I]], align 8, !noalias !12 432*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT_ANON_0:%.*]], %struct.anon.0* [[TMP12]], i32 0, i32 1 433207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP18:%.*]] = load i32*, i32** [[TMP17]], align 8 434207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP19:%.*]] = load i8*, i8** [[TMP16]], align 8 4359ce02ea8SJoseph Huber // CHECK1-NEXT: [[TMP20:%.*]] = load i32, i32* [[DOTGLOBAL_TID__ADDR_I]], align 4, !noalias !12 436207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP21:%.*]] = bitcast i32* [[TMP18]] to i8* 437207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP22:%.*]] = call i8* @__kmpc_task_reduction_get_th_data(i32 [[TMP20]], i8* [[TMP19]], i8* [[TMP21]]) #[[ATTR5]] 438207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[CONV_I:%.*]] = bitcast i8* [[TMP22]] to i32* 439*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[TMP12]], i32 0, i32 2 440207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP24:%.*]] = load i8**, i8*** [[TMP23]], align 8 441207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP25:%.*]] = load i8*, i8** [[TMP24]], align 8 442*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[TMP12]], i32 0, i32 1 443207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP27:%.*]] = load i32*, i32** [[TMP26]], align 8 444207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP28:%.*]] = load i32, i32* [[TMP27]], align 4 445207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP29:%.*]] = sext i32 [[TMP28]] to i64 446207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[LB_ADD_LEN_I:%.*]] = add nsw i64 -1, [[TMP29]] 447*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[TMP12]], i32 0, i32 2 448207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP31:%.*]] = load i8**, i8*** [[TMP30]], align 8 449207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[ARRAYIDX2_I:%.*]] = getelementptr inbounds i8*, i8** [[TMP31]], i64 9 450207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP32:%.*]] = load i8*, i8** [[ARRAYIDX2_I]], align 8 451207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[ARRAYIDX3_I:%.*]] = getelementptr inbounds i8, i8* [[TMP32]], i64 [[LB_ADD_LEN_I]] 452207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP33:%.*]] = ptrtoint i8* [[ARRAYIDX3_I]] to i64 453207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP34:%.*]] = ptrtoint i8* [[TMP25]] to i64 454207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP35:%.*]] = sub i64 [[TMP33]], [[TMP34]] 455207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP36:%.*]] = sdiv exact i64 [[TMP35]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 456207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP37:%.*]] = add nuw i64 [[TMP36]], 1 457207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP38:%.*]] = mul nuw i64 [[TMP37]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 458207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i64 [[TMP37]], i64* @{{reduction_size[.].+[.]}}, align 8 459207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP39:%.*]] = load i8*, i8** [[TMP16]], align 8 460207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP40:%.*]] = call i8* @__kmpc_task_reduction_get_th_data(i32 [[TMP20]], i8* [[TMP39]], i8* [[TMP25]]) #[[ATTR5]] 461*e9c7291cSGiorgis Georgakoudis // CHECK1-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[TMP12]], i32 0, i32 2 462207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP42:%.*]] = load i8**, i8*** [[TMP41]], align 8 463207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP43:%.*]] = load i8*, i8** [[TMP42]], align 8 464207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP44:%.*]] = ptrtoint i8* [[TMP43]] to i64 465207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP45:%.*]] = ptrtoint i8* [[TMP25]] to i64 466207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP46:%.*]] = sub i64 [[TMP44]], [[TMP45]] 467207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP47:%.*]] = sdiv exact i64 [[TMP46]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 468207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP48:%.*]] = getelementptr i8, i8* [[TMP40]], i64 [[TMP47]] 4699ce02ea8SJoseph Huber // CHECK1-NEXT: store i8** [[TMP4_I]], i8*** [[TMP_I]], align 8, !noalias !12 4709ce02ea8SJoseph Huber // CHECK1-NEXT: store i8* [[TMP48]], i8** [[TMP4_I]], align 8, !noalias !12 471207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: ret i32 0 472207b08a9SGiorgis Georgakoudis // 473207b08a9SGiorgis Georgakoudis // 474207b08a9SGiorgis Georgakoudis // CHECK1-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func 475207b08a9SGiorgis Georgakoudis // CHECK1-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR3]] { 476207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: entry: 477207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 478207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i8*, align 8 479207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 480207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8* [[TMP1]], i8** [[DOTADDR1]], align 8 481207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8 482207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [3 x i8*]* 483207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8 484207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [3 x i8*]* 485207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP5]], i64 0, i64 0 486207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8 487207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP8:%.*]] = bitcast i8* [[TMP7]] to i32* 488207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 0 489207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8 490207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP11:%.*]] = bitcast i8* [[TMP10]] to i32* 491207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP5]], i64 0, i64 1 492207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 8 493207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 1 494207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP15:%.*]] = load i8*, i8** [[TMP14]], align 8 495207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 2 496207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 8 497207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP18:%.*]] = ptrtoint i8* [[TMP17]] to i64 498207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP19:%.*]] = load i32, i32* [[TMP11]], align 4 499207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP20:%.*]] = load i32, i32* [[TMP8]], align 4 500207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP19]], [[TMP20]] 501207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i32 [[ADD]], i32* [[TMP11]], align 4 502207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr i8, i8* [[TMP15]], i64 [[TMP18]] 503207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[TMP15]], [[TMP21]] 504207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE5:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]] 505207b08a9SGiorgis Georgakoudis // CHECK1: omp.arraycpy.body: 506207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[TMP13]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ] 507207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP15]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ] 508207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP22:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1 509207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[CONV:%.*]] = sext i8 [[TMP22]] to i32 510207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[TMP23:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1 511207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[CONV2:%.*]] = sext i8 [[TMP23]] to i32 512207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[CONV]], [[CONV2]] 513207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[CONV4:%.*]] = trunc i32 [[ADD3]] to i8 514207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: store i8 [[CONV4]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1 515207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1 516207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1 517207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP21]] 518207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE5]], label [[OMP_ARRAYCPY_BODY]] 519207b08a9SGiorgis Georgakoudis // CHECK1: omp.arraycpy.done5: 520207b08a9SGiorgis Georgakoudis // CHECK1-NEXT: ret void 521207b08a9SGiorgis Georgakoudis // 522207b08a9SGiorgis Georgakoudis // 523207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@main 524207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i32 [[ARGC:%.*]], i8** [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] { 525207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: entry: 526207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4 527207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[ARGV_ADDR:%.*]] = alloca i8**, align 8 528*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_OUTLINED_ARG_AGG_:%.*]] = alloca [[STRUCT_ANON:%.*]], align 8 529207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i32 [[ARGC]], i32* [[ARGC_ADDR]], align 4 530207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8** [[ARGV]], i8*** [[ARGV_ADDR]], align 8 531*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[OMP_OUTLINED_ARG_AGG_]], i32 0, i32 0 532*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i32* [[ARGC_ADDR]], i32** [[TMP0]], align 8 533*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[OMP_OUTLINED_ARG_AGG_]], i32 0, i32 1 534*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP2:%.*]] = load i8**, i8*** [[ARGV_ADDR]], align 8 535*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8** [[TMP2]], i8*** [[TMP1]], align 8 536*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1:[0-9]+]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.anon*)* @.omp_outlined. to void (i32*, i32*, ...)*), %struct.anon* [[OMP_OUTLINED_ARG_AGG_]]) 537207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: ret i32 0 538207b08a9SGiorgis Georgakoudis // 539207b08a9SGiorgis Georgakoudis // 540207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.omp_outlined. 541*e9c7291cSGiorgis Georgakoudis // CHECK2-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], %struct.anon* noalias [[__CONTEXT:%.*]]) #[[ATTR1:[0-9]+]] { 542207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: entry: 543207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8 544207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8 545*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[__CONTEXT_ADDR:%.*]] = alloca %struct.anon*, align 8 546*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[ARGC:%.*]] = alloca i32, align 4 547207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[SAVED_STACK:%.*]] = alloca i8*, align 8 548207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8 549207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP:%.*]] = alloca i8**, align 8 550*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[_TMP4:%.*]] = alloca i8*, align 8 551207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTRD_INPUT_:%.*]] = alloca [2 x %struct.kmp_taskred_input_t], align 8 552207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTTASK_RED_:%.*]] = alloca i8*, align 8 553*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[AGG_CAPTURED:%.*]] = alloca [[STRUCT_ANON_0:%.*]], align 8 554207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [3 x i8*], align 8 555207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[ATOMIC_TEMP:%.*]] = alloca i8, align 1 556*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[_TMP23:%.*]] = alloca i8, align 1 557207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8 558207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8 559*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store %struct.anon* [[__CONTEXT]], %struct.anon** [[__CONTEXT_ADDR]], align 8 560*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP0:%.*]] = load %struct.anon*, %struct.anon** [[__CONTEXT_ADDR]], align 8 561*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_ANON:%.*]], %struct.anon* [[TMP0]], i32 0, i32 0 562*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP2:%.*]] = load i32*, i32** [[TMP1]], align 8 563*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT_ANON]], %struct.anon* [[TMP0]], i32 0, i32 1 564*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i32 0, i32* [[ARGC]], align 4 565*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP4:%.*]] = load i8**, i8*** [[TMP3]], align 8 566*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8*, i8** [[TMP4]], i64 0 567*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP5:%.*]] = load i8*, i8** [[ARRAYIDX]], align 8 568*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i8, i8* [[TMP5]], i64 0 569*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP2]], align 4 570*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP7:%.*]] = sext i32 [[TMP6]] to i64 571*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[LB_ADD_LEN:%.*]] = add nsw i64 -1, [[TMP7]] 572*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP8:%.*]] = load i8**, i8*** [[TMP3]], align 8 573*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds i8*, i8** [[TMP8]], i64 9 574*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP9:%.*]] = load i8*, i8** [[ARRAYIDX2]], align 8 575*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i8, i8* [[TMP9]], i64 [[LB_ADD_LEN]] 576*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP10:%.*]] = ptrtoint i8* [[ARRAYIDX3]] to i64 577*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP11:%.*]] = ptrtoint i8* [[ARRAYIDX1]] to i64 578*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP12:%.*]] = sub i64 [[TMP10]], [[TMP11]] 579*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP13:%.*]] = sdiv exact i64 [[TMP12]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 580*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP14:%.*]] = add nuw i64 [[TMP13]], 1 581*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP15:%.*]] = mul nuw i64 [[TMP14]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 582*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP16:%.*]] = call i8* @llvm.stacksave() 583*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP16]], i8** [[SAVED_STACK]], align 8 584*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[VLA:%.*]] = alloca i8, i64 [[TMP14]], align 16 585*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i64 [[TMP14]], i64* [[__VLA_EXPR0]], align 8 586*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP17:%.*]] = getelementptr i8, i8* [[VLA]], i64 [[TMP14]] 587*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq i8* [[VLA]], [[TMP17]] 588207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]] 589207b08a9SGiorgis Georgakoudis // CHECK2: omp.arrayinit.body: 590207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[VLA]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ] 591207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8 0, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1 592207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1 593*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP17]] 594207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]] 595207b08a9SGiorgis Georgakoudis // CHECK2: omp.arrayinit.done: 596*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP18:%.*]] = load i8**, i8*** [[TMP3]], align 8 597*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP19:%.*]] = load i8*, i8** [[TMP18]], align 8 598*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP20:%.*]] = ptrtoint i8* [[TMP19]] to i64 599*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP21:%.*]] = ptrtoint i8* [[ARRAYIDX1]] to i64 600*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP22:%.*]] = sub i64 [[TMP20]], [[TMP21]] 601*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP23:%.*]] = sdiv exact i64 [[TMP22]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 602*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP24:%.*]] = getelementptr i8, i8* [[VLA]], i64 [[TMP23]] 603*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8** [[_TMP4]], i8*** [[TMP]], align 8 604*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP24]], i8** [[_TMP4]], align 8 605207b08a9SGiorgis 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 606*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T:%.*]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 0 607*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP26:%.*]] = bitcast i32* [[ARGC]] to i8* 608*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP26]], i8** [[TMP25]], align 8 609*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 1 610*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP28:%.*]] = bitcast i32* [[TMP2]] to i8* 611*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP28]], i8** [[TMP27]], align 8 612*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 2 613*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i64 4, i64* [[TMP29]], align 8 614*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 3 615*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* bitcast (void (i8*, i8*)* @.red_init. to i8*), i8** [[TMP30]], align 8 616*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 4 617*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* null, i8** [[TMP31]], align 8 618*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 5 619*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* bitcast (void (i8*, i8*)* @.red_comb. to i8*), i8** [[TMP32]], align 8 620*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 6 621*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP34:%.*]] = bitcast i32* [[TMP33]] to i8* 622*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP34]], i8 0, i64 4, i1 false) 623*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[DOTRD_INPUT_GEP_5:%.*]] = getelementptr inbounds [2 x %struct.kmp_taskred_input_t], [2 x %struct.kmp_taskred_input_t]* [[DOTRD_INPUT_]], i64 0, i64 1 624*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 0 625*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP36:%.*]] = load i8**, i8*** [[TMP3]], align 8 626*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds i8*, i8** [[TMP36]], i64 0 627*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP37:%.*]] = load i8*, i8** [[ARRAYIDX6]], align 8 628*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[ARRAYIDX7:%.*]] = getelementptr inbounds i8, i8* [[TMP37]], i64 0 629*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP38:%.*]] = load i32, i32* [[TMP2]], align 4 630*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP39:%.*]] = sext i32 [[TMP38]] to i64 631*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[LB_ADD_LEN8:%.*]] = add nsw i64 -1, [[TMP39]] 632*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP40:%.*]] = load i8**, i8*** [[TMP3]], align 8 633*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds i8*, i8** [[TMP40]], i64 9 634*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP41:%.*]] = load i8*, i8** [[ARRAYIDX9]], align 8 635*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds i8, i8* [[TMP41]], i64 [[LB_ADD_LEN8]] 636*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[VLA]], i8** [[TMP35]], align 8 637*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 1 638*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[ARRAYIDX7]], i8** [[TMP42]], align 8 639*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP43:%.*]] = ptrtoint i8* [[ARRAYIDX10]] to i64 640*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP44:%.*]] = ptrtoint i8* [[ARRAYIDX7]] to i64 641*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP45:%.*]] = sub i64 [[TMP43]], [[TMP44]] 642*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP46:%.*]] = sdiv exact i64 [[TMP45]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 643*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP47:%.*]] = add nuw i64 [[TMP46]], 1 644*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP48:%.*]] = mul nuw i64 [[TMP47]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 645*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 2 646*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i64 [[TMP48]], i64* [[TMP49]], align 8 647*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 3 648*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* bitcast (void (i8*, i8*)* @.red_init..1 to i8*), i8** [[TMP50]], align 8 649*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 4 650*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* null, i8** [[TMP51]], align 8 651*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 5 652*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* bitcast (void (i8*, i8*)* @.red_comb..2 to i8*), i8** [[TMP52]], align 8 653*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASKRED_INPUT_T]], %struct.kmp_taskred_input_t* [[DOTRD_INPUT_GEP_5]], i32 0, i32 6 654*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i32 1, i32* [[TMP53]], align 8 655*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP54:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 656*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP55:%.*]] = load i32, i32* [[TMP54]], align 4 657*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP56:%.*]] = bitcast [2 x %struct.kmp_taskred_input_t]* [[DOTRD_INPUT_]] to i8* 658*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP57:%.*]] = call i8* @__kmpc_taskred_modifier_init(%struct.ident_t* @[[GLOB1]], i32 [[TMP55]], i32 0, i32 2, i8* [[TMP56]]) 659*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP57]], i8** [[DOTTASK_RED_]], align 8 660*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP58:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 661*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP59:%.*]] = load i32, i32* [[TMP58]], align 4 662*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP60:%.*]] = call i32 @__kmpc_master(%struct.ident_t* @[[GLOB1]], i32 [[TMP59]]) 663*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP61:%.*]] = icmp ne i32 [[TMP60]], 0 664*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[TMP61]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_END:%.*]] 665207b08a9SGiorgis Georgakoudis // CHECK2: omp_if.then: 666*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP62:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[AGG_CAPTURED]], i32 0, i32 0 667*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8** [[DOTTASK_RED_]], i8*** [[TMP62]], align 8 668*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP63:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[AGG_CAPTURED]], i32 0, i32 1 669*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i32* [[ARGC]], i32** [[TMP63]], align 8 670*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP64:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[AGG_CAPTURED]], i32 0, i32 2 671*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP65:%.*]] = load i8**, i8*** [[TMP]], align 8 672*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8** [[TMP65]], i8*** [[TMP64]], align 8 673*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP66:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 674*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP67:%.*]] = load i32, i32* [[TMP66]], align 4 675*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP68:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @[[GLOB1]], i32 [[TMP67]], 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*)*)) 676*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP69:%.*]] = bitcast i8* [[TMP68]] to %struct.kmp_task_t_with_privates* 677*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP70:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES:%.*]], %struct.kmp_task_t_with_privates* [[TMP69]], i32 0, i32 0 678*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP71:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T:%.*]], %struct.kmp_task_t* [[TMP70]], i32 0, i32 0 679*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP72:%.*]] = load i8*, i8** [[TMP71]], align 8 680*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP73:%.*]] = bitcast %struct.anon.0* [[AGG_CAPTURED]] to i8* 681*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[TMP72]], i8* align 8 [[TMP73]], i64 24, i1 false) 682*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP74:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES]], %struct.kmp_task_t_with_privates* [[TMP69]], i32 0, i32 1 683*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP75:%.*]] = getelementptr inbounds [[STRUCT__KMP_PRIVATES_T:%.*]], %struct..kmp_privates.t* [[TMP74]], i32 0, i32 0 684*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP76:%.*]] = load i8*, i8** [[DOTTASK_RED_]], align 8 685*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP76]], i8** [[TMP75]], align 8 686207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP77:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 687207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP78:%.*]] = load i32, i32* [[TMP77]], align 4 688*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP79:%.*]] = call i32 @__kmpc_omp_task(%struct.ident_t* @[[GLOB1]], i32 [[TMP78]], i8* [[TMP68]]) 689*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: call void @__kmpc_end_master(%struct.ident_t* @[[GLOB1]], i32 [[TMP59]]) 690*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: br label [[OMP_IF_END]] 691*e9c7291cSGiorgis Georgakoudis // CHECK2: omp_if.end: 692*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP80:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 693*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP81:%.*]] = load i32, i32* [[TMP80]], align 4 694*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: call void @__kmpc_task_reduction_modifier_fini(%struct.ident_t* @[[GLOB1]], i32 [[TMP81]], i32 0) 695*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP82:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0 696*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP83:%.*]] = bitcast i32* [[ARGC]] to i8* 697207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP83]], i8** [[TMP82]], align 8 698*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP84:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1 699*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[VLA]], i8** [[TMP84]], align 8 700*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP85:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 2 701*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP86:%.*]] = inttoptr i64 [[TMP14]] to i8* 702*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP86]], i8** [[TMP85]], align 8 703*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP87:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 704*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP88:%.*]] = load i32, i32* [[TMP87]], align 4 705*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP89:%.*]] = bitcast [3 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* 706*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP90:%.*]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP88]], i32 2, i64 24, i8* [[TMP89]], void (i8*, i8*)* @.omp.reduction.reduction_func, [8 x i32]* @.gomp_critical_user_.reduction.var) 707*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: switch i32 [[TMP90]], label [[DOTOMP_REDUCTION_DEFAULT:%.*]] [ 708207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: i32 1, label [[DOTOMP_REDUCTION_CASE1:%.*]] 709207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: i32 2, label [[DOTOMP_REDUCTION_CASE2:%.*]] 710207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: ] 711207b08a9SGiorgis Georgakoudis // CHECK2: .omp.reduction.case1: 712*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP91:%.*]] = load i32, i32* [[TMP2]], align 4 713*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP92:%.*]] = load i32, i32* [[ARGC]], align 4 714*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP91]], [[TMP92]] 715*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i32 [[ADD]], i32* [[TMP2]], align 4 716*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP93:%.*]] = getelementptr i8, i8* [[ARRAYIDX1]], i64 [[TMP14]] 717*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[ARRAYIDX1]], [[TMP93]] 718*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE17:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]] 719207b08a9SGiorgis Georgakoudis // CHECK2: omp.arraycpy.body: 720207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[VLA]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ] 721*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST11:%.*]] = phi i8* [ [[ARRAYIDX1]], [[DOTOMP_REDUCTION_CASE1]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT15:%.*]], [[OMP_ARRAYCPY_BODY]] ] 722*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP94:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST11]], align 1 723*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[CONV:%.*]] = sext i8 [[TMP94]] to i32 724*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP95:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1 725*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[CONV12:%.*]] = sext i8 [[TMP95]] to i32 726*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[ADD13:%.*]] = add nsw i32 [[CONV]], [[CONV12]] 727*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[CONV14:%.*]] = trunc i32 [[ADD13]] to i8 728*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8 [[CONV14]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST11]], align 1 729*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT15]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST11]], i32 1 730207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1 731*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DONE16:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT15]], [[TMP93]] 732*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[OMP_ARRAYCPY_DONE16]], label [[OMP_ARRAYCPY_DONE17]], label [[OMP_ARRAYCPY_BODY]] 733*e9c7291cSGiorgis Georgakoudis // CHECK2: omp.arraycpy.done17: 734*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: call void @__kmpc_end_reduce_nowait(%struct.ident_t* @[[GLOB2]], i32 [[TMP88]], [8 x i32]* @.gomp_critical_user_.reduction.var) 735207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]] 736207b08a9SGiorgis Georgakoudis // CHECK2: .omp.reduction.case2: 737*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP96:%.*]] = load i32, i32* [[ARGC]], align 4 738*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP97:%.*]] = atomicrmw add i32* [[TMP2]], i32 [[TMP96]] monotonic, align 4 739*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP98:%.*]] = getelementptr i8, i8* [[ARRAYIDX1]], i64 [[TMP14]] 740*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_ISEMPTY18:%.*]] = icmp eq i8* [[ARRAYIDX1]], [[TMP98]] 741*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY18]], label [[OMP_ARRAYCPY_DONE31:%.*]], label [[OMP_ARRAYCPY_BODY19:%.*]] 742*e9c7291cSGiorgis Georgakoudis // CHECK2: omp.arraycpy.body19: 743*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST20:%.*]] = phi i8* [ [[VLA]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT29:%.*]], [[ATOMIC_EXIT:%.*]] ] 744*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST21:%.*]] = phi i8* [ [[ARRAYIDX1]], [[DOTOMP_REDUCTION_CASE2]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT28:%.*]], [[ATOMIC_EXIT]] ] 745*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP99:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST20]], align 1 746*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[CONV22:%.*]] = sext i8 [[TMP99]] to i32 747*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[ATOMIC_LOAD:%.*]] = load atomic i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST21]] monotonic, align 1 748207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: br label [[ATOMIC_CONT:%.*]] 749207b08a9SGiorgis Georgakoudis // CHECK2: atomic_cont: 750*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP100:%.*]] = phi i8 [ [[ATOMIC_LOAD]], [[OMP_ARRAYCPY_BODY19]] ], [ [[TMP105:%.*]], [[ATOMIC_CONT]] ] 751*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8 [[TMP100]], i8* [[_TMP23]], align 1 752*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP101:%.*]] = load i8, i8* [[_TMP23]], align 1 753*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[CONV24:%.*]] = sext i8 [[TMP101]] to i32 754*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP102:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST20]], align 1 755*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[CONV25:%.*]] = sext i8 [[TMP102]] to i32 756*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[ADD26:%.*]] = add nsw i32 [[CONV24]], [[CONV25]] 757*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[CONV27:%.*]] = trunc i32 [[ADD26]] to i8 758*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store i8 [[CONV27]], i8* [[ATOMIC_TEMP]], align 1 759*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP103:%.*]] = load i8, i8* [[ATOMIC_TEMP]], align 1 760*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP104:%.*]] = cmpxchg i8* [[OMP_ARRAYCPY_DESTELEMENTPAST21]], i8 [[TMP100]], i8 [[TMP103]] monotonic monotonic, align 1 761*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP105]] = extractvalue { i8, i1 } [[TMP104]], 0 762*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP106:%.*]] = extractvalue { i8, i1 } [[TMP104]], 1 763*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[TMP106]], label [[ATOMIC_EXIT]], label [[ATOMIC_CONT]] 764207b08a9SGiorgis Georgakoudis // CHECK2: atomic_exit: 765*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT28]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST21]], i32 1 766*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT29]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST20]], i32 1 767*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DONE30:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT28]], [[TMP98]] 768*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[OMP_ARRAYCPY_DONE30]], label [[OMP_ARRAYCPY_DONE31]], label [[OMP_ARRAYCPY_BODY19]] 769*e9c7291cSGiorgis Georgakoudis // CHECK2: omp.arraycpy.done31: 770207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: br label [[DOTOMP_REDUCTION_DEFAULT]] 771207b08a9SGiorgis Georgakoudis // CHECK2: .omp.reduction.default: 772*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP107:%.*]] = load i8*, i8** [[SAVED_STACK]], align 8 773*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: call void @llvm.stackrestore(i8* [[TMP107]]) 774207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: ret void 775207b08a9SGiorgis Georgakoudis // 776207b08a9SGiorgis Georgakoudis // 777207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.red_init. 778207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i8* noalias [[TMP0:%.*]], i8* noalias [[TMP1:%.*]]) #[[ATTR3:[0-9]+]] { 779207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: entry: 780207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 781207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i8*, align 8 782207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 783207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP1]], i8** [[DOTADDR1]], align 8 784207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8 785207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32* 786207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i32 0, i32* [[TMP3]], align 8 787207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: ret void 788207b08a9SGiorgis Georgakoudis // 789207b08a9SGiorgis Georgakoudis // 790207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.red_comb. 791207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR3]] { 792207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: entry: 793207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 794207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i8*, align 8 795207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 796207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP1]], i8** [[DOTADDR1]], align 8 797207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8 798207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32* 799207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8 800207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to i32* 801207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP3]], align 8 802207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP5]], align 8 803207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP6]], [[TMP7]] 804207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i32 [[ADD]], i32* [[TMP3]], align 8 805207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: ret void 806207b08a9SGiorgis Georgakoudis // 807207b08a9SGiorgis Georgakoudis // 808207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.red_init..1 809207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i8* noalias [[TMP0:%.*]], i8* noalias [[TMP1:%.*]]) #[[ATTR3]] { 810207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: entry: 811207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 812207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i8*, align 8 813207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 814207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP1]], i8** [[DOTADDR1]], align 8 815207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8 816207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP3:%.*]] = load i64, i64* @{{reduction_size[.].+[.]}}, align 8 817207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP4:%.*]] = getelementptr i8, i8* [[TMP2]], i64 [[TMP3]] 818207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYINIT_ISEMPTY:%.*]] = icmp eq i8* [[TMP2]], [[TMP4]] 819207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[OMP_ARRAYINIT_ISEMPTY]], label [[OMP_ARRAYINIT_DONE:%.*]], label [[OMP_ARRAYINIT_BODY:%.*]] 820207b08a9SGiorgis Georgakoudis // CHECK2: omp.arrayinit.body: 821207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP2]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYINIT_BODY]] ] 822207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8 0, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1 823207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1 824207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP4]] 825207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYINIT_DONE]], label [[OMP_ARRAYINIT_BODY]] 826207b08a9SGiorgis Georgakoudis // CHECK2: omp.arrayinit.done: 827207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: ret void 828207b08a9SGiorgis Georgakoudis // 829207b08a9SGiorgis Georgakoudis // 830207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.red_comb..2 831207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR3]] { 832207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: entry: 833207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 834207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i8*, align 8 835207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 836207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP1]], i8** [[DOTADDR1]], align 8 837207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP2:%.*]] = load i64, i64* @{{reduction_size[.].+[.]}}, align 8 838207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 8 839207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8 840207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP5:%.*]] = getelementptr i8, i8* [[TMP3]], i64 [[TMP2]] 841207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[TMP3]], [[TMP5]] 842207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE4:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]] 843207b08a9SGiorgis Georgakoudis // CHECK2: omp.arraycpy.body: 844207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[TMP4]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ] 845207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP3]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ] 846207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP6:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1 847207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[CONV:%.*]] = sext i8 [[TMP6]] to i32 848207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP7:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1 849207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[CONV2:%.*]] = sext i8 [[TMP7]] to i32 850207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[CONV]], [[CONV2]] 851207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[CONV3:%.*]] = trunc i32 [[ADD]] to i8 852207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8 [[CONV3]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1 853207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1 854207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1 855207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP5]] 856207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE4]], label [[OMP_ARRAYCPY_BODY]] 857207b08a9SGiorgis Georgakoudis // CHECK2: omp.arraycpy.done4: 858207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: ret void 859207b08a9SGiorgis Georgakoudis // 860207b08a9SGiorgis Georgakoudis // 861207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.omp_task_privates_map. 862207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (%struct..kmp_privates.t* noalias [[TMP0:%.*]], i8*** noalias [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] { 863207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: entry: 864207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca %struct..kmp_privates.t*, align 8 865207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i8***, align 8 866207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store %struct..kmp_privates.t* [[TMP0]], %struct..kmp_privates.t** [[DOTADDR]], align 8 867207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8*** [[TMP1]], i8**** [[DOTADDR1]], align 8 868207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP2:%.*]] = load %struct..kmp_privates.t*, %struct..kmp_privates.t** [[DOTADDR]], align 8 869207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT__KMP_PRIVATES_T:%.*]], %struct..kmp_privates.t* [[TMP2]], i32 0, i32 0 870207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP4:%.*]] = load i8***, i8**** [[DOTADDR1]], align 8 871207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8** [[TMP3]], i8*** [[TMP4]], align 8 872207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: ret void 873207b08a9SGiorgis Georgakoudis // 874207b08a9SGiorgis Georgakoudis // 875207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.omp_task_entry. 876207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i32 [[TMP0:%.*]], %struct.kmp_task_t_with_privates* noalias [[TMP1:%.*]]) #[[ATTR3]] { 877207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: entry: 878207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR_I:%.*]] = alloca i32, align 4 879207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTPART_ID__ADDR_I:%.*]] = alloca i32*, align 8 880207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTPRIVATES__ADDR_I:%.*]] = alloca i8*, align 8 881207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTCOPY_FN__ADDR_I:%.*]] = alloca void (i8*, ...)*, align 8 882207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTTASK_T__ADDR_I:%.*]] = alloca i8*, align 8 883*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[__CONTEXT_ADDR_I:%.*]] = alloca %struct.anon.0*, align 8 884207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTFIRSTPRIV_PTR_ADDR_I:%.*]] = alloca i8**, align 8 885207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP_I:%.*]] = alloca i8**, align 8 886207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP4_I:%.*]] = alloca i8*, align 8 887207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i32, align 4 888207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca %struct.kmp_task_t_with_privates*, align 8 889207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i32 [[TMP0]], i32* [[DOTADDR]], align 4 890207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store %struct.kmp_task_t_with_privates* [[TMP1]], %struct.kmp_task_t_with_privates** [[DOTADDR1]], align 8 891207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP2:%.*]] = load i32, i32* [[DOTADDR]], align 4 892207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP3:%.*]] = load %struct.kmp_task_t_with_privates*, %struct.kmp_task_t_with_privates** [[DOTADDR1]], align 8 893207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES:%.*]], %struct.kmp_task_t_with_privates* [[TMP3]], i32 0, i32 0 894207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T:%.*]], %struct.kmp_task_t* [[TMP4]], i32 0, i32 2 895207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T]], %struct.kmp_task_t* [[TMP4]], i32 0, i32 0 896207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8 897*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP8:%.*]] = bitcast i8* [[TMP7]] to %struct.anon.0* 898207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_T_WITH_PRIVATES]], %struct.kmp_task_t_with_privates* [[TMP3]], i32 0, i32 1 899207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP10:%.*]] = bitcast %struct..kmp_privates.t* [[TMP9]] to i8* 900207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP11:%.*]] = bitcast %struct.kmp_task_t_with_privates* [[TMP3]] to i8* 9019ce02ea8SJoseph Huber // CHECK2-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META3:![0-9]+]]) 9029ce02ea8SJoseph Huber // CHECK2-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META6:![0-9]+]]) 9039ce02ea8SJoseph Huber // CHECK2-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META8:![0-9]+]]) 9049ce02ea8SJoseph Huber // CHECK2-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META10:![0-9]+]]) 9059ce02ea8SJoseph Huber // CHECK2-NEXT: store i32 [[TMP2]], i32* [[DOTGLOBAL_TID__ADDR_I]], align 4, !noalias !12 9069ce02ea8SJoseph Huber // CHECK2-NEXT: store i32* [[TMP5]], i32** [[DOTPART_ID__ADDR_I]], align 8, !noalias !12 9079ce02ea8SJoseph Huber // CHECK2-NEXT: store i8* [[TMP10]], i8** [[DOTPRIVATES__ADDR_I]], align 8, !noalias !12 9089ce02ea8SJoseph Huber // 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 !12 9099ce02ea8SJoseph Huber // CHECK2-NEXT: store i8* [[TMP11]], i8** [[DOTTASK_T__ADDR_I]], align 8, !noalias !12 910*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: store %struct.anon.0* [[TMP8]], %struct.anon.0** [[__CONTEXT_ADDR_I]], align 8, !noalias !12 911*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP12:%.*]] = load %struct.anon.0*, %struct.anon.0** [[__CONTEXT_ADDR_I]], align 8, !noalias !12 9129ce02ea8SJoseph Huber // CHECK2-NEXT: [[TMP13:%.*]] = load void (i8*, ...)*, void (i8*, ...)** [[DOTCOPY_FN__ADDR_I]], align 8, !noalias !12 9139ce02ea8SJoseph Huber // CHECK2-NEXT: [[TMP14:%.*]] = load i8*, i8** [[DOTPRIVATES__ADDR_I]], align 8, !noalias !12 914207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP15:%.*]] = bitcast void (i8*, ...)* [[TMP13]] to void (i8*, i8***)* 915207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: call void [[TMP15]](i8* [[TMP14]], i8*** [[DOTFIRSTPRIV_PTR_ADDR_I]]) #[[ATTR5:[0-9]+]] 9169ce02ea8SJoseph Huber // CHECK2-NEXT: [[TMP16:%.*]] = load i8**, i8*** [[DOTFIRSTPRIV_PTR_ADDR_I]], align 8, !noalias !12 917*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT_ANON_0:%.*]], %struct.anon.0* [[TMP12]], i32 0, i32 1 918207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP18:%.*]] = load i32*, i32** [[TMP17]], align 8 919207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP19:%.*]] = load i8*, i8** [[TMP16]], align 8 9209ce02ea8SJoseph Huber // CHECK2-NEXT: [[TMP20:%.*]] = load i32, i32* [[DOTGLOBAL_TID__ADDR_I]], align 4, !noalias !12 921207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP21:%.*]] = bitcast i32* [[TMP18]] to i8* 922207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP22:%.*]] = call i8* @__kmpc_task_reduction_get_th_data(i32 [[TMP20]], i8* [[TMP19]], i8* [[TMP21]]) #[[ATTR5]] 923207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[CONV_I:%.*]] = bitcast i8* [[TMP22]] to i32* 924*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[TMP12]], i32 0, i32 2 925207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP24:%.*]] = load i8**, i8*** [[TMP23]], align 8 926207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP25:%.*]] = load i8*, i8** [[TMP24]], align 8 927*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[TMP12]], i32 0, i32 1 928207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP27:%.*]] = load i32*, i32** [[TMP26]], align 8 929207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP28:%.*]] = load i32, i32* [[TMP27]], align 4 930207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP29:%.*]] = sext i32 [[TMP28]] to i64 931207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[LB_ADD_LEN_I:%.*]] = add nsw i64 -1, [[TMP29]] 932*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[TMP12]], i32 0, i32 2 933207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP31:%.*]] = load i8**, i8*** [[TMP30]], align 8 934207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[ARRAYIDX2_I:%.*]] = getelementptr inbounds i8*, i8** [[TMP31]], i64 9 935207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP32:%.*]] = load i8*, i8** [[ARRAYIDX2_I]], align 8 936207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[ARRAYIDX3_I:%.*]] = getelementptr inbounds i8, i8* [[TMP32]], i64 [[LB_ADD_LEN_I]] 937207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP33:%.*]] = ptrtoint i8* [[ARRAYIDX3_I]] to i64 938207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP34:%.*]] = ptrtoint i8* [[TMP25]] to i64 939207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP35:%.*]] = sub i64 [[TMP33]], [[TMP34]] 940207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP36:%.*]] = sdiv exact i64 [[TMP35]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 941207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP37:%.*]] = add nuw i64 [[TMP36]], 1 942207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP38:%.*]] = mul nuw i64 [[TMP37]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 943207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i64 [[TMP37]], i64* @{{reduction_size[.].+[.]}}, align 8 944207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP39:%.*]] = load i8*, i8** [[TMP16]], align 8 945207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP40:%.*]] = call i8* @__kmpc_task_reduction_get_th_data(i32 [[TMP20]], i8* [[TMP39]], i8* [[TMP25]]) #[[ATTR5]] 946*e9c7291cSGiorgis Georgakoudis // CHECK2-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT_ANON_0]], %struct.anon.0* [[TMP12]], i32 0, i32 2 947207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP42:%.*]] = load i8**, i8*** [[TMP41]], align 8 948207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP43:%.*]] = load i8*, i8** [[TMP42]], align 8 949207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP44:%.*]] = ptrtoint i8* [[TMP43]] to i64 950207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP45:%.*]] = ptrtoint i8* [[TMP25]] to i64 951207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP46:%.*]] = sub i64 [[TMP44]], [[TMP45]] 952207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP47:%.*]] = sdiv exact i64 [[TMP46]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64) 953207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP48:%.*]] = getelementptr i8, i8* [[TMP40]], i64 [[TMP47]] 9549ce02ea8SJoseph Huber // CHECK2-NEXT: store i8** [[TMP4_I]], i8*** [[TMP_I]], align 8, !noalias !12 9559ce02ea8SJoseph Huber // CHECK2-NEXT: store i8* [[TMP48]], i8** [[TMP4_I]], align 8, !noalias !12 956207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: ret i32 0 957207b08a9SGiorgis Georgakoudis // 958207b08a9SGiorgis Georgakoudis // 959207b08a9SGiorgis Georgakoudis // CHECK2-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func 960207b08a9SGiorgis Georgakoudis // CHECK2-SAME: (i8* [[TMP0:%.*]], i8* [[TMP1:%.*]]) #[[ATTR3]] { 961207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: entry: 962207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 963207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i8*, align 8 964207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 965207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8* [[TMP1]], i8** [[DOTADDR1]], align 8 966207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP2:%.*]] = load i8*, i8** [[DOTADDR]], align 8 967207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to [3 x i8*]* 968207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR1]], align 8 969207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [3 x i8*]* 970207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP5]], i64 0, i64 0 971207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP7:%.*]] = load i8*, i8** [[TMP6]], align 8 972207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP8:%.*]] = bitcast i8* [[TMP7]] to i32* 973207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 0 974207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8 975207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP11:%.*]] = bitcast i8* [[TMP10]] to i32* 976207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP5]], i64 0, i64 1 977207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 8 978207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 1 979207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP15:%.*]] = load i8*, i8** [[TMP14]], align 8 980207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[TMP3]], i64 0, i64 2 981207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 8 982207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP18:%.*]] = ptrtoint i8* [[TMP17]] to i64 983207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP19:%.*]] = load i32, i32* [[TMP11]], align 4 984207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP20:%.*]] = load i32, i32* [[TMP8]], align 4 985207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP19]], [[TMP20]] 986207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i32 [[ADD]], i32* [[TMP11]], align 4 987207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP21:%.*]] = getelementptr i8, i8* [[TMP15]], i64 [[TMP18]] 988207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_ISEMPTY:%.*]] = icmp eq i8* [[TMP15]], [[TMP21]] 989207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[OMP_ARRAYCPY_ISEMPTY]], label [[OMP_ARRAYCPY_DONE5:%.*]], label [[OMP_ARRAYCPY_BODY:%.*]] 990207b08a9SGiorgis Georgakoudis // CHECK2: omp.arraycpy.body: 991207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_SRCELEMENTPAST:%.*]] = phi i8* [ [[TMP13]], [[ENTRY:%.*]] ], [ [[OMP_ARRAYCPY_SRC_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ] 992207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DESTELEMENTPAST:%.*]] = phi i8* [ [[TMP15]], [[ENTRY]] ], [ [[OMP_ARRAYCPY_DEST_ELEMENT:%.*]], [[OMP_ARRAYCPY_BODY]] ] 993207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP22:%.*]] = load i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1 994207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[CONV:%.*]] = sext i8 [[TMP22]] to i32 995207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[TMP23:%.*]] = load i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], align 1 996207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[CONV2:%.*]] = sext i8 [[TMP23]] to i32 997207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[ADD3:%.*]] = add nsw i32 [[CONV]], [[CONV2]] 998207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[CONV4:%.*]] = trunc i32 [[ADD3]] to i8 999207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: store i8 [[CONV4]], i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], align 1 1000207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DEST_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_DESTELEMENTPAST]], i32 1 1001207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_SRC_ELEMENT]] = getelementptr i8, i8* [[OMP_ARRAYCPY_SRCELEMENTPAST]], i32 1 1002207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: [[OMP_ARRAYCPY_DONE:%.*]] = icmp eq i8* [[OMP_ARRAYCPY_DEST_ELEMENT]], [[TMP21]] 1003207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: br i1 [[OMP_ARRAYCPY_DONE]], label [[OMP_ARRAYCPY_DONE5]], label [[OMP_ARRAYCPY_BODY]] 1004207b08a9SGiorgis Georgakoudis // CHECK2: omp.arraycpy.done5: 1005207b08a9SGiorgis Georgakoudis // CHECK2-NEXT: ret void 1006207b08a9SGiorgis Georgakoudis // 1007