1*8be5a0feSAlexey Bataev // RUN: %clang_cc1 -fopenmp -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -fnoopenmp-use-tls -std=c++98 | FileCheck %s 260e51c48SAlexey Bataev 3*8be5a0feSAlexey Bataev // RUN: %clang_cc1 -fopenmp-simd -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -fnoopenmp-use-tls -std=c++98 | FileCheck --check-prefix SIMD-ONLY0 %s 460e51c48SAlexey Bataev // SIMD-ONLY0-NOT: {{__kmpc|__tgt}} 560e51c48SAlexey Bataev // expected-no-diagnostics 660e51c48SAlexey Bataev 760e51c48SAlexey Bataev struct S { 860e51c48SAlexey Bataev float a; 960e51c48SAlexey Bataev S() : a(0.0f) {} 1060e51c48SAlexey Bataev ~S() {} 1160e51c48SAlexey Bataev }; 1260e51c48SAlexey Bataev 1360e51c48SAlexey Bataev #pragma omp declare reduction(+:S:omp_out.a += omp_in.a) initializer(omp_priv = omp_orig) 1460e51c48SAlexey Bataev 1560e51c48SAlexey Bataev float g; 1660e51c48SAlexey Bataev 1760e51c48SAlexey Bataev int a; 1860e51c48SAlexey Bataev #pragma omp threadprivate(a) 1960e51c48SAlexey Bataev int main (int argc, char *argv[]) 2060e51c48SAlexey Bataev { 2160e51c48SAlexey Bataev int i, n; 2260e51c48SAlexey Bataev float a[100], b[100], sum, e[argc + 100]; 2360e51c48SAlexey Bataev S c[100]; 2460e51c48SAlexey Bataev float &d = g; 2560e51c48SAlexey Bataev 2660e51c48SAlexey Bataev /* Some initializations */ 2760e51c48SAlexey Bataev n = 100; 2860e51c48SAlexey Bataev for (i=0; i < n; i++) 2960e51c48SAlexey Bataev a[i] = b[i] = i * 1.0; 3060e51c48SAlexey Bataev sum = 0.0; 3160e51c48SAlexey Bataev 3260e51c48SAlexey Bataev #pragma omp master taskloop reduction(+:sum, c[:n], d, e) 3360e51c48SAlexey Bataev for (i=0; i < n; i++) { 3460e51c48SAlexey Bataev sum = sum + (a[i] * b[i]); 3560e51c48SAlexey Bataev c[i].a = i*i; 3660e51c48SAlexey Bataev d += i*i; 3760e51c48SAlexey Bataev e[i] = i; 3860e51c48SAlexey Bataev } 3960e51c48SAlexey Bataev 4060e51c48SAlexey Bataev } 4160e51c48SAlexey Bataev 4260e51c48SAlexey Bataev // CHECK-LABEL: @main( 4360e51c48SAlexey Bataev // CHECK: [[RETVAL:%.*]] = alloca i32, 4460e51c48SAlexey Bataev // CHECK: [[ARGC_ADDR:%.*]] = alloca i32, 4560e51c48SAlexey Bataev // CHECK: [[ARGV_ADDR:%.*]] = alloca i8**, 4660e51c48SAlexey Bataev // CHECK: [[I:%.*]] = alloca i32, 4760e51c48SAlexey Bataev // CHECK: [[N:%.*]] = alloca i32, 4860e51c48SAlexey Bataev // CHECK: [[A:%.*]] = alloca [100 x float], 4960e51c48SAlexey Bataev // CHECK: [[B:%.*]] = alloca [100 x float], 5060e51c48SAlexey Bataev // CHECK: [[SUM:%.*]] = alloca float, 5160e51c48SAlexey Bataev // CHECK: [[SAVED_STACK:%.*]] = alloca i8*, 5260e51c48SAlexey Bataev // CHECK: [[C:%.*]] = alloca [100 x %struct.S], 5360e51c48SAlexey Bataev // CHECK: [[D:%.*]] = alloca float*, 5460e51c48SAlexey Bataev // CHECK: [[AGG_CAPTURED:%.*]] = alloca [[STRUCT_ANON:%.*]], 5560e51c48SAlexey Bataev // CHECK: [[DOTRD_INPUT_:%.*]] = alloca [4 x %struct.kmp_task_red_input_t], 5660e51c48SAlexey Bataev // CHECK: alloca i32, 5760e51c48SAlexey Bataev // CHECK: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, 5860e51c48SAlexey Bataev // CHECK: [[DOTCAPTURE_EXPR_9:%.*]] = alloca i32, 5960e51c48SAlexey Bataev // CHECK: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* 6060e51c48SAlexey Bataev // CHECK: store i32 0, i32* [[RETVAL]], 6160e51c48SAlexey Bataev // CHECK: store i32 [[ARGC:%.*]], i32* [[ARGC_ADDR]], 6260e51c48SAlexey Bataev // CHECK: store i8** [[ARGV:%.*]], i8*** [[ARGV_ADDR]], 6360e51c48SAlexey Bataev // CHECK: [[TMP1:%.*]] = load i32, i32* [[ARGC_ADDR]], 6460e51c48SAlexey Bataev // CHECK: [[ADD:%.*]] = add nsw i32 [[TMP1]], 100 6560e51c48SAlexey Bataev // CHECK: [[TMP2:%.*]] = zext i32 [[ADD]] to i64 6660e51c48SAlexey Bataev // CHECK: [[VLA:%.+]] = alloca float, i64 % 6760e51c48SAlexey Bataev 6860e51c48SAlexey Bataev // CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master( 6960e51c48SAlexey Bataev // CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0 7060e51c48SAlexey Bataev // CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:[^,]+]] 7160e51c48SAlexey Bataev // CHECK: [[THEN]] 7260e51c48SAlexey Bataev // CHECK: call void @__kmpc_taskgroup(%struct.ident_t* 7360e51c48SAlexey Bataev // CHECK-DAG: [[TMP21:%.*]] = bitcast float* [[SUM]] to i8* 7460e51c48SAlexey Bataev // CHECK-DAG: store i8* [[TMP21]], i8** [[TMP20:%[^,]+]], 7560e51c48SAlexey Bataev // CHECK-DAG: [[TMP20]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T:%.+]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_:%.+]], i32 0, i32 0 7660e51c48SAlexey Bataev // CHECK-DAG: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 1 7760e51c48SAlexey Bataev // CHECK-DAG: store i64 4, i64* [[TMP22]], 7860e51c48SAlexey Bataev // CHECK-DAG: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 2 7960e51c48SAlexey Bataev // CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT1:.+]] to i8*), i8** [[TMP23]], 8060e51c48SAlexey Bataev // CHECK-DAG: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 3 8160e51c48SAlexey Bataev // CHECK-DAG: store i8* null, i8** [[TMP24]], 8260e51c48SAlexey Bataev // CHECK-DAG: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 4 8360e51c48SAlexey Bataev // CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB1:.+]] to i8*), i8** [[TMP25]], 8460e51c48SAlexey Bataev // CHECK-DAG: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 5 8560e51c48SAlexey Bataev // CHECK-DAG: [[TMP27:%.*]] = bitcast i32* [[TMP26]] to i8* 8660e51c48SAlexey Bataev // CHECK-DAG: call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP27]], i8 0, i64 4, i1 false) 8760e51c48SAlexey Bataev // CHECK-DAG: [[ARRAYIDX5:%.*]] = getelementptr inbounds [100 x %struct.S], [100 x %struct.S]* [[C]], i64 0, i64 0 8860e51c48SAlexey Bataev // CHECK-DAG: [[LB_ADD_LEN:%.*]] = add nsw i64 -1, % 8960e51c48SAlexey Bataev // CHECK-DAG: [[ARRAYIDX6:%.*]] = getelementptr inbounds [100 x %struct.S], [100 x %struct.S]* [[C]], i64 0, i64 [[LB_ADD_LEN]] 9060e51c48SAlexey Bataev // CHECK-DAG: [[TMP31:%.*]] = bitcast %struct.S* [[ARRAYIDX5]] to i8* 9160e51c48SAlexey Bataev // CHECK-DAG: store i8* [[TMP31]], i8** [[TMP28:%[^,]+]], 9260e51c48SAlexey Bataev // CHECK-DAG: [[TMP28]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4:%.+]], i32 0, i32 0 9360e51c48SAlexey Bataev // CHECK-DAG: [[TMP32:%.*]] = ptrtoint %struct.S* [[ARRAYIDX6]] to i64 9460e51c48SAlexey Bataev // CHECK-DAG: [[TMP33:%.*]] = ptrtoint %struct.S* [[ARRAYIDX5]] to i64 9560e51c48SAlexey Bataev // CHECK-DAG: [[TMP34:%.*]] = sub i64 [[TMP32]], [[TMP33]] 9660e51c48SAlexey Bataev // CHECK-DAG: [[TMP35:%.*]] = sdiv exact i64 [[TMP34]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64) 9760e51c48SAlexey Bataev // CHECK-DAG: [[TMP36:%.*]] = add nuw i64 [[TMP35]], 1 9860e51c48SAlexey Bataev // CHECK-DAG: [[TMP37:%.*]] = mul nuw i64 [[TMP36]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64) 9960e51c48SAlexey Bataev // CHECK-DAG: store i64 [[TMP37]], i64* [[TMP38:%[^,]+]], 10060e51c48SAlexey Bataev // CHECK-DAG: [[TMP38]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 1 10160e51c48SAlexey Bataev // CHECK-DAG: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 2 10260e51c48SAlexey Bataev // CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT2:.+]] to i8*), i8** [[TMP39]], 10360e51c48SAlexey Bataev // CHECK-DAG: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 3 10460e51c48SAlexey Bataev // CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_FINI2:.+]] to i8*), i8** [[TMP40]], 10560e51c48SAlexey Bataev // CHECK-DAG: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 4 10660e51c48SAlexey Bataev // CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB2:.+]] to i8*), i8** [[TMP41]], 10760e51c48SAlexey Bataev // CHECK-DAG: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 5 10860e51c48SAlexey Bataev // CHECK-DAG: store i32 1, i32* [[TMP42]], 10960e51c48SAlexey Bataev // CHECK-DAG: [[TMP44:%.*]] = load float*, float** [[D]], 11060e51c48SAlexey Bataev // CHECK-DAG: [[TMP45:%.*]] = bitcast float* [[TMP44]] to i8* 11160e51c48SAlexey Bataev // CHECK-DAG: store i8* [[TMP45]], i8** [[TMP43:%[^,]+]], 11260e51c48SAlexey Bataev // CHECK-DAG: [[TMP43]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7:%.+]], i32 0, i32 0 11360e51c48SAlexey Bataev // CHECK-DAG: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 1 11460e51c48SAlexey Bataev // CHECK-DAG: store i64 4, i64* [[TMP46]], 11560e51c48SAlexey Bataev // CHECK-DAG: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 2 11660e51c48SAlexey Bataev // CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT3:.+]] to i8*), i8** [[TMP47]], 11760e51c48SAlexey Bataev // CHECK-DAG: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 3 11860e51c48SAlexey Bataev // CHECK-DAG: store i8* null, i8** [[TMP48]], 11960e51c48SAlexey Bataev // CHECK-DAG: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 4 12060e51c48SAlexey Bataev // CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB3:.+]] to i8*), i8** [[TMP49]], 12160e51c48SAlexey Bataev // CHECK-DAG: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 5 12260e51c48SAlexey Bataev // CHECK-DAG: [[TMP51:%.*]] = bitcast i32* [[TMP50]] to i8* 12360e51c48SAlexey Bataev // CHECK-DAG: call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP51]], i8 0, i64 4, i1 false) 12460e51c48SAlexey Bataev // CHECK-DAG: [[TMP53:%.*]] = bitcast float* [[VLA]] to i8* 12560e51c48SAlexey Bataev // CHECK-DAG: store i8* [[TMP53]], i8** [[TMP52:%[^,]+]], 12660e51c48SAlexey Bataev // CHECK-DAG: [[TMP52]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8:%.+]], i32 0, i32 0 12760e51c48SAlexey Bataev // CHECK-DAG: [[TMP54:%.*]] = mul nuw i64 [[TMP2]], 4 12860e51c48SAlexey Bataev // CHECK-DAG: [[TMP55:%.*]] = udiv exact i64 [[TMP54]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64) 12960e51c48SAlexey Bataev // CHECK-DAG: store i64 [[TMP54]], i64* [[TMP56:%[^,]+]], 13060e51c48SAlexey Bataev // CHECK-DAG: [[TMP56]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 1 13160e51c48SAlexey Bataev // CHECK-DAG: [[TMP57:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 2 13260e51c48SAlexey Bataev // CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT4:.+]] to i8*), i8** [[TMP57]], 13360e51c48SAlexey Bataev // CHECK-DAG: [[TMP58:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 3 13460e51c48SAlexey Bataev // CHECK-DAG: store i8* null, i8** [[TMP58]], 13560e51c48SAlexey Bataev // CHECK-DAG: [[TMP59:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 4 13660e51c48SAlexey Bataev // CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB4:.+]] to i8*), i8** [[TMP59]], 13760e51c48SAlexey Bataev // CHECK-DAG: [[TMP60:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 5 13860e51c48SAlexey Bataev // CHECK-DAG: store i32 1, i32* [[TMP60]], 13960e51c48SAlexey Bataev // CHECK-DAG: [[DOTRD_INPUT_GEP_]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64 14060e51c48SAlexey Bataev // CHECK-DAG: [[DOTRD_INPUT_GEP_4]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64 14160e51c48SAlexey Bataev // CHECK-DAG: [[DOTRD_INPUT_GEP_7]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64 14260e51c48SAlexey Bataev // CHECK-DAG: [[DOTRD_INPUT_GEP_8]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64 14360e51c48SAlexey Bataev // CHECK: [[TMP61:%.*]] = bitcast [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]] to i8* 14460e51c48SAlexey Bataev // CHECK: [[TMP62:%.*]] = call i8* @__kmpc_task_reduction_init(i32 [[TMP0]], i32 4, i8* [[TMP61]]) 14560e51c48SAlexey Bataev // CHECK: [[TMP63:%.*]] = load i32, i32* [[N]], 14660e51c48SAlexey Bataev // CHECK: store i32 [[TMP63]], i32* [[DOTCAPTURE_EXPR_]], 14760e51c48SAlexey Bataev // CHECK: [[TMP64:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], 14860e51c48SAlexey Bataev // CHECK: [[SUB:%.*]] = sub nsw i32 [[TMP64]], 0 14960e51c48SAlexey Bataev // CHECK: [[SUB10:%.*]] = sub nsw i32 [[SUB]], 1 15060e51c48SAlexey Bataev // CHECK: [[ADD11:%.*]] = add nsw i32 [[SUB10]], 1 15160e51c48SAlexey Bataev // CHECK: [[DIV:%.*]] = sdiv i32 [[ADD11]], 1 15260e51c48SAlexey Bataev // CHECK: [[SUB12:%.*]] = sub nsw i32 [[DIV]], 1 15360e51c48SAlexey Bataev // CHECK: store i32 [[SUB12]], i32* [[DOTCAPTURE_EXPR_9]], 15460e51c48SAlexey Bataev // CHECK: [[TMP65:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i32 1, i64 888, i64 64, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @[[TASK:.+]] to i32 (i32, i8*)*)) 15560e51c48SAlexey Bataev // CHECK: call void @__kmpc_taskloop(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i8* [[TMP65]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null) 15660e51c48SAlexey Bataev // CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t* 15760e51c48SAlexey Bataev // CHECK: call {{.*}}void @__kmpc_end_master( 15860e51c48SAlexey Bataev // CHECK-NEXT: br label {{%?}}[[EXIT]] 15960e51c48SAlexey Bataev // CHECK: [[EXIT]] 16060e51c48SAlexey Bataev 16160e51c48SAlexey Bataev // CHECK: ret i32 16260e51c48SAlexey Bataev 16360e51c48SAlexey Bataev // CHECK: define internal void @[[RED_INIT1]](i8* %0) 16460e51c48SAlexey Bataev // CHECK: store float 0.000000e+00, float* % 16560e51c48SAlexey Bataev // CHECK: ret void 16660e51c48SAlexey Bataev 16760e51c48SAlexey Bataev // CHECK: define internal void @[[RED_COMB1]](i8* %0, i8* %1) 16860e51c48SAlexey Bataev // CHECK: fadd float % 16960e51c48SAlexey Bataev // CHECK: store float %{{.+}}, float* % 17060e51c48SAlexey Bataev // CHECK: ret void 17160e51c48SAlexey Bataev 17260e51c48SAlexey Bataev // CHECK: define internal void @[[RED_INIT2]](i8* %0) 17360e51c48SAlexey Bataev // CHECK: call i8* @__kmpc_threadprivate_cached( 17460e51c48SAlexey Bataev // CHECK: [[ORIG_PTR_ADDR:%.+]] = call i8* @__kmpc_threadprivate_cached( 17560e51c48SAlexey Bataev // CHECK: [[ORIG_PTR_REF:%.+]] = bitcast i8* [[ORIG_PTR_ADDR]] to i8** 17660e51c48SAlexey Bataev // CHECK: load i8*, i8** [[ORIG_PTR_REF]], 17760e51c48SAlexey Bataev // CHECK: call void [[OMP_INIT1:@.+]]( 17860e51c48SAlexey Bataev // CHECK: ret void 17960e51c48SAlexey Bataev 18060e51c48SAlexey Bataev // CHECK: define internal void [[OMP_COMB1:@.+]](%struct.S* noalias %0, %struct.S* noalias %1) 18160e51c48SAlexey Bataev // CHECK: fadd float % 18260e51c48SAlexey Bataev 18360e51c48SAlexey Bataev // CHECK: define internal void [[OMP_INIT1]](%struct.S* noalias %0, %struct.S* noalias %1) 18460e51c48SAlexey Bataev // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64( 18560e51c48SAlexey Bataev 18660e51c48SAlexey Bataev // CHECK: define internal void @[[RED_FINI2]](i8* %0) 18760e51c48SAlexey Bataev // CHECK: call i8* @__kmpc_threadprivate_cached( 18860e51c48SAlexey Bataev // CHECK: call void @ 18960e51c48SAlexey Bataev // CHECK: ret void 19060e51c48SAlexey Bataev 19160e51c48SAlexey Bataev // CHECK: define internal void @[[RED_COMB2]](i8* %0, i8* %1) 19260e51c48SAlexey Bataev // CHECK: call i8* @__kmpc_threadprivate_cached( 19360e51c48SAlexey Bataev // CHECK: call void [[OMP_COMB1]]( 19460e51c48SAlexey Bataev // CHECK: ret void 19560e51c48SAlexey Bataev 19660e51c48SAlexey Bataev // CHECK: define internal void @[[RED_INIT3]](i8* %0) 19760e51c48SAlexey Bataev // CHECK: store float 0.000000e+00, float* % 19860e51c48SAlexey Bataev // CHECK: ret void 19960e51c48SAlexey Bataev 20060e51c48SAlexey Bataev // CHECK: define internal void @[[RED_COMB3]](i8* %0, i8* %1) 20160e51c48SAlexey Bataev // CHECK: fadd float % 20260e51c48SAlexey Bataev // CHECK: store float %{{.+}}, float* % 20360e51c48SAlexey Bataev // CHECK: ret void 20460e51c48SAlexey Bataev 20560e51c48SAlexey Bataev // CHECK: define internal void @[[RED_INIT4]](i8* %0) 20660e51c48SAlexey Bataev // CHECK: call i8* @__kmpc_threadprivate_cached( 20760e51c48SAlexey Bataev // CHECK: store float 0.000000e+00, float* % 20860e51c48SAlexey Bataev // CHECK: ret void 20960e51c48SAlexey Bataev 21060e51c48SAlexey Bataev // CHECK: define internal void @[[RED_COMB4]](i8* %0, i8* %1) 21160e51c48SAlexey Bataev // CHECK: call i8* @__kmpc_threadprivate_cached( 21260e51c48SAlexey Bataev // CHECK: fadd float % 21360e51c48SAlexey Bataev // CHECK: store float %{{.+}}, float* % 21460e51c48SAlexey Bataev // CHECK: ret void 21560e51c48SAlexey Bataev 21660e51c48SAlexey Bataev // CHECK-NOT: call i8* @__kmpc_threadprivate_cached( 21760e51c48SAlexey Bataev // CHECK: call i8* @__kmpc_task_reduction_get_th_data( 21860e51c48SAlexey Bataev // CHECK: call i8* @__kmpc_threadprivate_cached( 21960e51c48SAlexey Bataev // CHECK: call i8* @__kmpc_threadprivate_cached( 22060e51c48SAlexey Bataev // CHECK: call i8* @__kmpc_task_reduction_get_th_data( 22160e51c48SAlexey Bataev // CHECK-NOT: call i8* @__kmpc_threadprivate_cached( 22260e51c48SAlexey Bataev // CHECK: call i8* @__kmpc_task_reduction_get_th_data( 22360e51c48SAlexey Bataev // CHECK: call i8* @__kmpc_threadprivate_cached( 22460e51c48SAlexey Bataev // CHECK: call i8* @__kmpc_task_reduction_get_th_data( 22560e51c48SAlexey Bataev // CHECK-NOT: call i8* @__kmpc_threadprivate_cached( 22660e51c48SAlexey Bataev 22760e51c48SAlexey Bataev // CHECK-DAG: distinct !DISubprogram(linkageName: "[[TASK]]", scope: ! 22860e51c48SAlexey Bataev // CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT1]]" 22960e51c48SAlexey Bataev // CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB1]]" 23060e51c48SAlexey Bataev // CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT2]]" 23160e51c48SAlexey Bataev // CHECK-DAG: !DISubprogram(linkageName: "[[RED_FINI2]]" 23260e51c48SAlexey Bataev // CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB2]]" 23360e51c48SAlexey Bataev // CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT3]]" 23460e51c48SAlexey Bataev // CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB3]]" 23560e51c48SAlexey Bataev // CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT4]]" 23660e51c48SAlexey Bataev // CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB4]]" 237