diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-10-27 14:17:40 -0700 |
---|---|---|
committer | Matt Arsenault <arsenm2@gmail.com> | 2019-10-27 21:26:55 -0700 |
commit | 40ab8ae9fb70f1550815bf0f867148b5101a4f66 (patch) | |
tree | 052013ecf4d7878efa78ebb3819197d71de54392 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 7af8d5267b3cf2a41044b04b918db1ae7a8ef32f (diff) | |
download | llvm-40ab8ae9fb70f1550815bf0f867148b5101a4f66.zip llvm-40ab8ae9fb70f1550815bf0f867148b5101a4f66.tar.gz llvm-40ab8ae9fb70f1550815bf0f867148b5101a4f66.tar.bz2 |
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.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index b05a588..75708d6 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, |