diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2019-12-19 10:01:10 -0500 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-12-23 10:04:46 -0500 |
| commit | 0860db966a7d2ab61b26e41426a55189986924b4 (patch) | |
| tree | d90f8ba8208077ca27a6ebc27db727c97bda583c /clang/lib/CodeGen/CGOpenMPRuntime.h | |
| parent | e40ac74dacda99ff6330945f0f105252b7c28c9c (diff) | |
| download | bcm5719-llvm-0860db966a7d2ab61b26e41426a55189986924b4.tar.gz bcm5719-llvm-0860db966a7d2ab61b26e41426a55189986924b4.zip | |
[OPENMP50]Codegen for nontemporal clause.
Summary:
Basic codegen for the declarations marked as nontemporal. Also, if the
base declaration in the member expression is marked as nontemporal,
lvalue for member decl access inherits nonteporal flag from the base
lvalue.
Reviewers: rjmccall, hfinkel, jdoerfert
Subscribers: guansong, arphaman, caomhin, kkwli0, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71708
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.h')
| -rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntime.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h index d806c27fdcb..f1582457ed2 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.h +++ b/clang/lib/CodeGen/CGOpenMPRuntime.h @@ -211,6 +211,16 @@ public: ~DisableAutoDeclareTargetRAII(); }; + /// Manages list of nontemporal decls for the specified directive. + class NontemporalDeclsRAII { + CodeGenModule &CGM; + const bool NeedToPush; + + public: + NontemporalDeclsRAII(CodeGenModule &CGM, const OMPLoopDirective &S); + ~NontemporalDeclsRAII(); + }; + protected: CodeGenModule &CGM; StringRef FirstSeparator, Separator; @@ -650,6 +660,11 @@ private: std::pair<GlobalDecl, GlobalDecl>> DeferredVariantFunction; + using NontemporalDeclsSet = llvm::SmallDenseSet<CanonicalDeclPtr<const Decl>>; + /// Stack for list of declarations in current context marked as nontemporal. + /// The set is the union of all current stack elements. + llvm::SmallVector<NontemporalDeclsSet, 4> NontemporalDeclsStack; + /// Flag for keeping track of weather a requires unified_shared_memory /// directive is present. bool HasRequiresUnifiedSharedMemory = false; @@ -1663,6 +1678,10 @@ public: /// Emits the definition of the declare variant function. virtual bool emitDeclareVariant(GlobalDecl GD, bool IsForDefinition); + + /// Checks if the \p VD variable is marked as nontemporal declaration in + /// current context. + bool isNontemporalDecl(const ValueDecl *VD) const; }; /// Class supports emissionof SIMD-only code. |

