From cf9fbd23358480884cdb0d8bebec1f93b087bd10 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 23 Nov 2015 13:33:42 +0000 Subject: [PATCH] [OPENMP] 'out' dependency for 'task' directives must be the same as 'inout'. Runtime library requires, that codegen for 'depend' clause for 'out' dependency kind must be the same as codegen for 'depend' clause with 'inout' dependency. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253866 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGOpenMPRuntime.cpp | 5 ++--- test/OpenMP/task_codegen.cpp | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp index ea4300c7f0..f9fe8d2ecd 100644 --- a/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/lib/CodeGen/CGOpenMPRuntime.cpp @@ -2437,7 +2437,7 @@ void CGOpenMPRuntime::emitTaskCall( unsigned NumDependencies = Dependences.size(); if (NumDependencies) { // Dependence kind for RTL. - enum RTLDependenceKindTy { DepIn = 1, DepOut = 2, DepInOut = 3 }; + enum RTLDependenceKindTy { DepIn = 0x01, DepInOut = 0x3 }; enum RTLDependInfoFieldsTy { BaseAddr, Len, Flags }; RecordDecl *KmpDependInfoRD; QualType FlagsTy = @@ -2496,9 +2496,8 @@ void CGOpenMPRuntime::emitTaskCall( case OMPC_DEPEND_in: DepKind = DepIn; break; + // Out and InOut dependencies must use the same code. case OMPC_DEPEND_out: - DepKind = DepOut; - break; case OMPC_DEPEND_inout: DepKind = DepInOut; break; diff --git a/test/OpenMP/task_codegen.cpp b/test/OpenMP/task_codegen.cpp index ed59b3d381..23dc014aad 100644 --- a/test/OpenMP/task_codegen.cpp +++ b/test/OpenMP/task_codegen.cpp @@ -119,7 +119,7 @@ int main() { // CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 1 // CHECK: store i64 4, i64* // CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 2 -// CHECK: store i8 2, i8* +// CHECK: store i8 3, i8* // CHECK: [[IDX1:%.+]] = mul nsw i64 4, [[A_VAL]] // CHECK: [[START:%.+]] = getelementptr inbounds i32, i32* %{{.+}}, i64 [[IDX1]] // CHECK: [[B_VAL:%.+]] = load i8, i8* [[B]] @@ -141,7 +141,7 @@ int main() { // CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 1 // CHECK: store i64 [[SIZEOF]], i64* // CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 2 -// CHECK: store i8 2, i8* +// CHECK: store i8 3, i8* // CHECK: getelementptr inbounds [2 x [[KMP_DEPEND_INFO]]], [2 x [[KMP_DEPEND_INFO]]]* %{{[^,]+}}, i32 0, i32 0 // CHECK: bitcast [[KMP_DEPEND_INFO]]* %{{.+}} to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps([[IDENT_T]]* @{{.+}}, i32 [[GTID]], i8* [[ORIG_TASK_PTR]], i32 2, i8* %{{[^,]+}}, i32 0, i8* null) -- 2.40.0