From d47b9438d7b73dd7f7bf5da723ff3426af6daf9a Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Mon, 5 Aug 2019 18:43:21 +0000 Subject: [OpenMP 5.0] Codegen support for user-defined mappers. This patch implements the code generation for OpenMP 5.0 declare mapper (user-defined mapper) constructs. For each declare mapper, a mapper function is generated. These mapper functions will be called by the runtime and/or other mapper functions to achieve user defined mapping. The design slides can be found at https://github.com/lingda-li/public-sharing/blob/master/mapper_runtime_design.pptx Re-commit after revert in r367773 because r367755 changed the LLVM-IR output such that a CHECK line failed. Patch by Lingda Li Differential Revision: https://reviews.llvm.org/D59474 llvm-svn: 367905 --- clang/lib/CodeGen/CGDecl.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'clang/lib/CodeGen/CGDecl.cpp') diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index c6c2ff57e1c..a9e01619aab 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -2530,10 +2530,11 @@ void CodeGenModule::EmitOMPDeclareReduction(const OMPDeclareReductionDecl *D, } void CodeGenModule::EmitOMPDeclareMapper(const OMPDeclareMapperDecl *D, - CodeGenFunction *CGF) { - if (!LangOpts.OpenMP || (!LangOpts.EmitAllDecls && !D->isUsed())) + CodeGenFunction *CGF) { + if (!LangOpts.OpenMP || LangOpts.OpenMPSimd || + (!LangOpts.EmitAllDecls && !D->isUsed())) return; - // FIXME: need to implement mapper code generation + getOpenMPRuntime().emitUserDefinedMapper(D, CGF); } void CodeGenModule::EmitOMPRequiresDecl(const OMPRequiresDecl *D) { -- cgit v1.2.3