summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.h
diff options
context:
space:
mode:
authorYaxun Liu <Yaxun.Liu@amd.com>2017-08-04 18:16:31 +0000
committerYaxun Liu <Yaxun.Liu@amd.com>2017-08-04 18:16:31 +0000
commit39195062c20c5fd7d01678ff87c9c2851644a669 (patch)
tree91440b8bb2b2bd18fe5a3fa684ae01cca7179ce8 /clang/lib/CodeGen/TargetInfo.h
parent0afcef27a12db3730941b257d9535f7e32479fdb (diff)
downloadbcm5719-llvm-39195062c20c5fd7d01678ff87c9c2851644a669.tar.gz
bcm5719-llvm-39195062c20c5fd7d01678ff87c9c2851644a669.zip
Add OpenCL 2.0 atomic builtin functions as Clang builtin
OpenCL 2.0 atomic builtin functions have a scope argument which is ideally represented as synchronization scope argument in LLVM atomic instructions. Clang supports translating Clang atomic builtin functions to LLVM atomic instructions. However it currently does not support synchronization scope of LLVM atomic instructions. Without this, users have to use LLVM assembly code to implement OpenCL atomic builtin functions. This patch adds OpenCL 2.0 atomic builtin functions as Clang builtin functions, which supports generating LLVM atomic instructions with synchronization scope operand. Currently only constant memory scope argument is supported. Support of non-constant memory scope argument will be added later. Differential Revision: https://reviews.llvm.org/D28691 llvm-svn: 310082
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.h')
-rw-r--r--clang/lib/CodeGen/TargetInfo.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.h b/clang/lib/CodeGen/TargetInfo.h
index 7149dec1dad..c26d7c710c1 100644
--- a/clang/lib/CodeGen/TargetInfo.h
+++ b/clang/lib/CodeGen/TargetInfo.h
@@ -19,6 +19,7 @@
#include "CGValue.h"
#include "clang/AST/Type.h"
#include "clang/Basic/LLVM.h"
+#include "clang/Basic/SyncScope.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
@@ -260,6 +261,10 @@ public:
virtual llvm::Constant *
performAddrSpaceCast(CodeGenModule &CGM, llvm::Constant *V, unsigned SrcAddr,
unsigned DestAddr, llvm::Type *DestTy) const;
+
+ /// Get the syncscope used in LLVM IR.
+ virtual llvm::SyncScope::ID getLLVMSyncScopeID(SyncScope S,
+ llvm::LLVMContext &C) const;
};
} // namespace CodeGen
OpenPOWER on IntegriCloud