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.h | |
parent | 7af8d5267b3cf2a41044b04b918db1ae7a8ef32f (diff) | |
download | bcm5719-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.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 73f81adae35..f5014c05b06 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -1027,11 +1027,22 @@ public: } /// Create or return a runtime function declaration with the specified type - /// and name. + /// and name. If \p AssumeConvergent is true, the call will have the + /// convergent attribute added. llvm::FunctionCallee CreateRuntimeFunction(llvm::FunctionType *Ty, StringRef Name, llvm::AttributeList ExtraAttrs = llvm::AttributeList(), - bool Local = false); + bool Local = false, bool AssumeConvergent = false); + + /// Create or return a runtime function declaration with the specified type + /// and name. This will automatically add the convergent attribute to the + /// function declaration. + llvm::FunctionCallee CreateConvergentRuntimeFunction( + llvm::FunctionType *Ty, StringRef Name, + llvm::AttributeList ExtraAttrs = llvm::AttributeList(), + bool Local = false) { + return CreateRuntimeFunction(Ty, Name, ExtraAttrs, Local, true); + } /// Create a new runtime global variable with the specified type and name. llvm::Constant *CreateRuntimeVariable(llvm::Type *Ty, |