From 6c1a74477efd03a33f7bf109c7cb0aaca639275e Mon Sep 17 00:00:00 2001 From: Philippe Virouleau <philippe.virouleau@imag.fr> Date: Tue, 9 Aug 2016 10:44:28 +0200 Subject: [PATCH] Update name to match the paper. Use data/node/thread as affinity kinds instead of depend/numa/core. --- include/clang/Basic/DiagnosticParseKinds.td | 2 ++ include/clang/Basic/OpenMPKinds.def | 6 +++--- lib/CodeGen/CGOpenMPRuntime.cpp | 20 ++++++++++---------- lib/Parse/ParseOpenMP.cpp | 3 +-- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index 45044e62677..e8bc3436d61 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -980,6 +980,8 @@ def err_omp_expected_reduction_identifier : Error< "expected identifier or one of the following operators: '+', '-', '*', '&', '|', '^', '&&', or '||'">; def err_omp_decl_in_declare_simd : Error< "function declaration is expected after 'declare simd' directive">; +def err_omp_unknown_affinity_kind : Error< + "incorrect affinity kind, expected one of 'data', 'node', or 'thread'">; def err_omp_unknown_map_type : Error< "incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'">; def err_omp_unknown_map_type_modifier : Error< diff --git a/include/clang/Basic/OpenMPKinds.def b/include/clang/Basic/OpenMPKinds.def index 91ffe16babe..b93aee0e6d5 100644 --- a/include/clang/Basic/OpenMPKinds.def +++ b/include/clang/Basic/OpenMPKinds.def @@ -339,9 +339,9 @@ OPENMP_DEFAULTMAP_KIND(scalar) OPENMP_DEFAULTMAP_MODIFIER(tofrom) // Static attributes for 'affinity' clause. -OPENMP_AFFINITY_KIND(depend) -OPENMP_AFFINITY_KIND(numa) -OPENMP_AFFINITY_KIND(core) +OPENMP_AFFINITY_KIND(data) +OPENMP_AFFINITY_KIND(node) +OPENMP_AFFINITY_KIND(thread) // Static attributes for 'depend' clause. OPENMP_DEPEND_KIND(in) diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp index 51dbd1c9fd6..68b91c5be61 100644 --- a/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/lib/CodeGen/CGOpenMPRuntime.cpp @@ -2692,19 +2692,19 @@ void CGOpenMPRuntime::emitTaskAffinityClause(CodeGenFunction &CGF, // Constants for affinity kind accepted by the runtime. enum AffinityKindTy { AffinityNone = 0, - AffinityDepend, - AffinityNuma, - AffinityCore + AffinityData, + AffinityNode, + AffinityThread } RuntimeAffinity; switch (AffKind) { - case OMPC_AFFINITY_numa: - RuntimeAffinity = AffinityNuma; + case OMPC_AFFINITY_node: + RuntimeAffinity = AffinityNode; break; - case OMPC_AFFINITY_core: - RuntimeAffinity = AffinityCore; + case OMPC_AFFINITY_thread: + RuntimeAffinity = AffinityThread; break; - case OMPC_AFFINITY_depend: - RuntimeAffinity = AffinityDepend; + case OMPC_AFFINITY_data: + RuntimeAffinity = AffinityData; break; case OMPC_AFFINITY_unknown: llvm_unreachable("Unsupported affinity value."); @@ -2712,7 +2712,7 @@ void CGOpenMPRuntime::emitTaskAffinityClause(CodeGenFunction &CGF, llvm::Value *Affinity = CGF.EmitScalarExpr(Aff, /*IgnoreResultAssign*/ true); const Type *ExprTy = Aff->getType().getTypePtr(); - if (AffKind == OMPC_AFFINITY_depend && ExprTy->isPointerType()) { + if (AffKind == OMPC_AFFINITY_data && ExprTy->isPointerType()) { Affinity = CGF.Builder.CreatePtrToInt(Affinity, CGF.Int64Ty); } diff --git a/lib/Parse/ParseOpenMP.cpp b/lib/Parse/ParseOpenMP.cpp index 3577b6c70c4..68cbc398e6d 100644 --- a/lib/Parse/ParseOpenMP.cpp +++ b/lib/Parse/ParseOpenMP.cpp @@ -1605,8 +1605,7 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind DKind, Data.DepLinMapLoc = Tok.getLocation(); if (Data.AffKind == OMPC_AFFINITY_unknown) { - //FIXME use correct error message - Diag(Tok, diag::err_omp_unknown_map_type); + Diag(Tok, diag::err_omp_unknown_affinity_kind); } ConsumeToken(); if (Tok.is(tok::colon)) { -- GitLab