diff options
author | Arpith Chacko Jacob <acjacob@us.ibm.com> | 2016-03-22 01:48:56 +0000 |
---|---|---|
committer | Arpith Chacko Jacob <acjacob@us.ibm.com> | 2016-03-22 01:48:56 +0000 |
commit | 5c309e475dcf5932f9bd0aafa01297169fff60a6 (patch) | |
tree | cb956e1789b88a007d5d070d311d6e44c293cd05 /clang/lib/CodeGen/CGOpenMPRuntime.h | |
parent | f2be78c07e4607c0e536f25779458e17a06bc42f (diff) | |
download | bcm5719-llvm-5c309e475dcf5932f9bd0aafa01297169fff60a6.tar.gz bcm5719-llvm-5c309e475dcf5932f9bd0aafa01297169fff60a6.zip |
[OpenMP] Base support for target directive codegen on NVPTX device.
Summary:
This patch adds base support for codegen of the target directive on the NVPTX device.
Reviewers: ABataev
Differential Revision: http://reviews.llvm.org/D17877
Reworked test case after buildbot failure on windows.
Updated patch to integrate r263837 and test case nvptx_target_firstprivate_codegen.cpp.
llvm-svn: 264018
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.h')
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntime.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h index e9702170865..1935e93e206 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.h +++ b/clang/lib/CodeGen/CGOpenMPRuntime.h @@ -49,7 +49,31 @@ class CodeGenModule; typedef llvm::function_ref<void(CodeGenFunction &)> RegionCodeGenTy; class CGOpenMPRuntime { +protected: CodeGenModule &CGM; + + /// \brief Creates offloading entry for the provided entry ID \a ID, + /// address \a Addr and size \a Size. + virtual void createOffloadEntry(llvm::Constant *ID, llvm::Constant *Addr, + uint64_t Size); + + /// \brief Helper to emit outlined function for 'target' directive. + /// \param D Directive to emit. + /// \param ParentName Name of the function that encloses the target region. + /// \param OutlinedFn Outlined function value to be defined by this call. + /// \param OutlinedFnID Outlined function ID value to be defined by this call. + /// \param IsOffloadEntry True if the outlined function is an offload entry. + /// \param CodeGen Lambda codegen specific to an accelerator device. + /// An oulined function may not be an entry if, e.g. the if clause always + /// evaluates to false. + virtual void emitTargetOutlinedFunctionHelper(const OMPExecutableDirective &D, + StringRef ParentName, + llvm::Function *&OutlinedFn, + llvm::Constant *&OutlinedFnID, + bool IsOffloadEntry, + const RegionCodeGenTy &CodeGen); + +private: /// \brief Default const ident_t object used for initialization of all other /// ident_t objects. llvm::Constant *DefaultOpenMPPSource = nullptr; @@ -267,11 +291,6 @@ class CGOpenMPRuntime { /// compilation unit. The function that does the registration is returned. llvm::Function *createOffloadingBinaryDescriptorRegistration(); - /// \brief Creates offloading entry for the provided entry ID \a ID, - /// address \a Addr and size \a Size. - void createOffloadEntry(llvm::Constant *ID, llvm::Constant *Addr, - uint64_t Size); - /// \brief Creates all the offload entries in the current compilation unit /// along with the associated metadata. void createOffloadEntriesAndInfoMetadata(); |