diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2018-11-21 21:04:34 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2018-11-21 21:04:34 +0000 |
commit | ceeaa4805227f2eb679b4a927468f1fc7d8f6944 (patch) | |
tree | 92e036ad07652d3f082b10f43a3d5e38a6ad27d5 /clang/lib/CodeGen/CGOpenMPRuntime.h | |
parent | 20935e0ab50d82de6655fb3b611ef19f44de11a0 (diff) | |
download | bcm5719-llvm-ceeaa4805227f2eb679b4a927468f1fc7d8f6944.tar.gz bcm5719-llvm-ceeaa4805227f2eb679b4a927468f1fc7d8f6944.zip |
[OPENMP][NVPTX]Emit default locations as constant with undefined mode.
For the NVPTX target default locations should be emitted as constants +
additional info must be emitted in the reserved_2 field of the ident_t
structure. The 1st bit controls the execution mode and the 2nd bit
controls use of the lightweight runtime. The combination of the bits for
Non-SPMD mode + lightweight runtime represents special undefined mode,
used outside of the target regions for orphaned directives or functions.
Should allow and additional optimization inside of the target regions.
llvm-svn: 347425
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.h')
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntime.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h index 1a27db15746..489ecdf15e1 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.h +++ b/clang/lib/CodeGen/CGOpenMPRuntime.h @@ -282,12 +282,21 @@ protected: bool AtCurrentPoint = false); void clearLocThreadIdInsertPt(CodeGenFunction &CGF); + /// Check if the default location must be constant. + /// Default is false to support OMPT/OMPD. + virtual bool isDefaultLocationConstant() const { return false; } + + /// Returns additional flags that can be stored in reserved_2 field of the + /// default location. + virtual unsigned getDefaultLocationReserved2Flags() const { return 0; } + private: /// Default const ident_t object used for initialization of all other /// ident_t objects. llvm::Constant *DefaultOpenMPPSource = nullptr; + using FlagsTy = std::pair<unsigned, unsigned>; /// Map of flags and corresponding default locations. - typedef llvm::DenseMap<unsigned, llvm::Value *> OpenMPDefaultLocMapTy; + using OpenMPDefaultLocMapTy = llvm::DenseMap<FlagsTy, llvm::Value *>; OpenMPDefaultLocMapTy OpenMPDefaultLocMap; Address getOrCreateDefaultLocation(unsigned Flags); |