From 2e0cbe509242697caec4a119b323475c4d006486 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 8 Mar 2018 15:24:08 +0000 Subject: [OPENMP] Emit sizes/init ptrs etc. data for task reductions before using. We may emit the code in wrong order because of incorrect implementation of the runtime functions for task reductions. Threadprivate storages may be initialized after real initialization of the reduction items. Patch fixes this problem. llvm-svn: 327008 --- clang/test/OpenMP/task_in_reduction_codegen.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/test/OpenMP/task_in_reduction_codegen.cpp') diff --git a/clang/test/OpenMP/task_in_reduction_codegen.cpp b/clang/test/OpenMP/task_in_reduction_codegen.cpp index 30ba9a16e37..39448570175 100644 --- a/clang/test/OpenMP/task_in_reduction_codegen.cpp +++ b/clang/test/OpenMP/task_in_reduction_codegen.cpp @@ -78,9 +78,11 @@ int main(int argc, char **argv) { // CHECK-NEXT: call i8* @__kmpc_task_reduction_get_th_data(i32 [[GTID]], i8* [[TD1]], i8* [[A_PTR]]) // CHECK: [[D_REF:%.+]] = getelementptr inbounds % // CHECK-NEXT: [[D_ADDR:%.+]] = load i16*, i16** [[D_REF]], +// CHECK: call i8* @__kmpc_threadprivate_cached( // CHECK: [[TD2:%.+]] = load i8*, i8** [[TD2_ADDR]], // CHECK-NEXT: [[D_PTR:%.+]] = bitcast i16* [[D_ADDR]] to i8* // CHECK-NEXT: call i8* @__kmpc_task_reduction_get_th_data(i32 [[GTID]], i8* [[TD2]], i8* [[D_PTR]]) // CHECK: add nsw i32 // CHECK: store i32 % +// CHECK-NOT: call i8* @__kmpc_threadprivate_cached( #endif -- cgit v1.2.3