diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2018-03-15 15:47:20 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2018-03-15 15:47:20 +0000 |
commit | 4f4bf7c3482598c02bea7fbe9bbcca56ac720313 (patch) | |
tree | 9d22d71fca84678cbb814b489d172fb2d714b35d /clang/lib/CodeGen/CGOpenMPRuntime.h | |
parent | 1110c4d33675f4351c080e621dbf8ee298ef13ae (diff) | |
download | bcm5719-llvm-4f4bf7c3482598c02bea7fbe9bbcca56ac720313.tar.gz bcm5719-llvm-4f4bf7c3482598c02bea7fbe9bbcca56ac720313.zip |
[OPENMP] Codegen for `omp declare target` construct.
Added initial codegen for device side of declarations inside `omp
declare target` construct + codegen for implicit `declare target`
functions, which are used in the target regions.
llvm-svn: 327636
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.h')
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntime.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h index 0f18d13296f..410241b6189 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.h +++ b/clang/lib/CodeGen/CGOpenMPRuntime.h @@ -199,6 +199,18 @@ public: }; class CGOpenMPRuntime { +public: + /// Allows to disable automatic handling of functions used in target regions + /// as those marked as `omp declare target`. + class DisableAutoDeclareTargetRAII { + CodeGenModule &CGM; + bool SavedShouldMarkAsGlobal; + + public: + DisableAutoDeclareTargetRAII(CodeGenModule &CGM); + ~DisableAutoDeclareTargetRAII(); + }; + protected: CodeGenModule &CGM; @@ -488,6 +500,9 @@ private: }; OffloadEntriesInfoManagerTy OffloadEntriesInfoManager; + bool ShouldMarkAsGlobal = true; + llvm::SmallDenseSet<const FunctionDecl *> AlreadyEmittedTargetFunctions; + /// \brief Creates and registers offloading binary descriptor for the current /// compilation unit. The function that does the registration is returned. llvm::Function *createOffloadingBinaryDescriptorRegistration(); @@ -1370,6 +1385,11 @@ public: /// Gets the OpenMP-specific address of the local variable. virtual Address getAddressOfLocalVariable(CodeGenFunction &CGF, const VarDecl *VD); + + /// Marks the declaration as alread emitted for the device code and returns + /// true, if it was marked already, and false, otherwise. + bool markAsGlobalTarget(const FunctionDecl *D); + }; /// Class supports emissionof SIMD-only code. |