summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-10-27 14:17:40 -0700
committerMatt Arsenault <arsenm2@gmail.com>2019-10-27 21:26:55 -0700
commit40ab8ae9fb70f1550815bf0f867148b5101a4f66 (patch)
tree052013ecf4d7878efa78ebb3819197d71de54392 /clang/lib/CodeGen/CodeGenModule.cpp
parent7af8d5267b3cf2a41044b04b918db1ae7a8ef32f (diff)
downloadbcm5719-llvm-40ab8ae9fb70f1550815bf0f867148b5101a4f66.tar.gz
bcm5719-llvm-40ab8ae9fb70f1550815bf0f867148b5101a4f66.zip
OpenMP: Add helper function for convergent runtime calls
Most of the functions emitted here should probably be convergent, but only barriers are currently marked. Introduce this helper before adding convergent to more functions.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index b05a58848e8..75708d6e496 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -3332,8 +3332,14 @@ GetRuntimeFunctionDecl(ASTContext &C, StringRef Name) {
/// type and name.
llvm::FunctionCallee
CodeGenModule::CreateRuntimeFunction(llvm::FunctionType *FTy, StringRef Name,
- llvm::AttributeList ExtraAttrs,
- bool Local) {
+ llvm::AttributeList ExtraAttrs, bool Local,
+ bool AssumeConvergent) {
+ if (AssumeConvergent) {
+ ExtraAttrs =
+ ExtraAttrs.addAttribute(VMContext, llvm::AttributeList::FunctionIndex,
+ llvm::Attribute::Convergent);
+ }
+
llvm::Constant *C =
GetOrCreateLLVMFunction(Name, FTy, GlobalDecl(), /*ForVTable=*/false,
/*DontDefer=*/false, /*IsThunk=*/false,
OpenPOWER on IntegriCloud