From ed6563d96b882687a8bc08965345d65c99b2de5d Mon Sep 17 00:00:00 2001
From: Thierry <thierry.gautier@inrialpes.fr>
Date: Tue, 17 Jan 2017 22:02:29 +0100
Subject: [PATCH] =?UTF-8?q?[fix]=C2=A0add=20concurrent=20as=20an=20alias?=
 =?UTF-8?q?=20of=20cw;=20add=20commute=20for=20StarPU=20related=20commute?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 include/clang/Basic/OpenMPKinds.def | 2 ++
 lib/CodeGen/CGOpenMPRuntime.cpp     | 8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/clang/Basic/OpenMPKinds.def b/include/clang/Basic/OpenMPKinds.def
index 143cb3fb609..1ece2ec4f49 100644
--- a/include/clang/Basic/OpenMPKinds.def
+++ b/include/clang/Basic/OpenMPKinds.def
@@ -348,6 +348,8 @@ OPENMP_AFFINITY_KIND(thread)
 OPENMP_DEPEND_KIND(in)
 OPENMP_DEPEND_KIND(out)
 OPENMP_DEPEND_KIND(inout)
+OPENMP_DEPEND_KIND(concurrent)
+OPENMP_DEPEND_KIND(commute)
 OPENMP_DEPEND_KIND(cw)
 OPENMP_DEPEND_KIND(source)
 OPENMP_DEPEND_KIND(sink)
diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp
index c5f72e518dd..42eb59d23ec 100644
--- a/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -4032,7 +4032,7 @@ void CGOpenMPRuntime::emitTaskCall(CodeGenFunction &CGF, SourceLocation Loc,
   unsigned NumDependencies = Data.Dependences.size();
   if (NumDependencies) {
     // Dependence kind for RTL.
-    enum RTLDependenceKindTy { DepIn = 0x01, DepOut = 0x02, DepInOut = 0x3, DepCW = 0x04 };
+    enum RTLDependenceKindTy { DepIn = 0x01, DepOut = 0x02, DepInOut = 0x3, DepCW = 0x04, DepCommute = 0x08 };
     enum RTLDependInfoFieldsTy { BaseAddr, Len, Flags };
     RecordDecl *KmpDependInfoRD;
     QualType FlagsTy =
@@ -4096,8 +4096,12 @@ void CGOpenMPRuntime::emitTaskCall(CodeGenFunction &CGF, SourceLocation Loc,
       case OMPC_DEPEND_inout:
         DepKind = DepInOut;
         break;
+      case OMPC_DEPEND_concurrent:
       case OMPC_DEPEND_cw:
-        DepKind = DepCW;
+        DepKind = RTLDependenceKindTy(int(DepCW)|int(DepInOut));
+        break;
+      case OMPC_DEPEND_commute:
+        DepKind = RTLDependenceKindTy(int(DepCommute)|int(DepInOut));
         break;
       case OMPC_DEPEND_source:
       case OMPC_DEPEND_sink:
-- 
GitLab