aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h')
-rw-r--r--contrib/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h62
1 files changed, 56 insertions, 6 deletions
diff --git a/contrib/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h b/contrib/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
index 85dd28ec3159..f60debe8411c 100644
--- a/contrib/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+++ b/contrib/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
@@ -1003,6 +1003,55 @@ public:
llvm::ConstantInt *Size,
const llvm::Twine &Name = Twine(""));
+ /// Create a runtime call for __tgt_interop_init
+ ///
+ /// \param Loc The insert and source location description.
+ /// \param InteropVar variable to be allocated
+ /// \param InteropType type of interop operation
+ /// \param Device devide to which offloading will occur
+ /// \param NumDependences number of dependence variables
+ /// \param DependenceAddress pointer to dependence variables
+ /// \param HaveNowaitClause does nowait clause exist
+ ///
+ /// \returns CallInst to the __tgt_interop_init call
+ CallInst *createOMPInteropInit(const LocationDescription &Loc,
+ Value *InteropVar,
+ omp::OMPInteropType InteropType, Value *Device,
+ Value *NumDependences,
+ Value *DependenceAddress,
+ bool HaveNowaitClause);
+
+ /// Create a runtime call for __tgt_interop_destroy
+ ///
+ /// \param Loc The insert and source location description.
+ /// \param InteropVar variable to be allocated
+ /// \param Device devide to which offloading will occur
+ /// \param NumDependences number of dependence variables
+ /// \param DependenceAddress pointer to dependence variables
+ /// \param HaveNowaitClause does nowait clause exist
+ ///
+ /// \returns CallInst to the __tgt_interop_destroy call
+ CallInst *createOMPInteropDestroy(const LocationDescription &Loc,
+ Value *InteropVar, Value *Device,
+ Value *NumDependences,
+ Value *DependenceAddress,
+ bool HaveNowaitClause);
+
+ /// Create a runtime call for __tgt_interop_use
+ ///
+ /// \param Loc The insert and source location description.
+ /// \param InteropVar variable to be allocated
+ /// \param Device devide to which offloading will occur
+ /// \param NumDependences number of dependence variables
+ /// \param DependenceAddress pointer to dependence variables
+ /// \param HaveNowaitClause does nowait clause exist
+ ///
+ /// \returns CallInst to the __tgt_interop_use call
+ CallInst *createOMPInteropUse(const LocationDescription &Loc,
+ Value *InteropVar, Value *Device,
+ Value *NumDependences, Value *DependenceAddress,
+ bool HaveNowaitClause);
+
/// The `omp target` interface
///
/// For more information about the usage of this interface,
@@ -1167,6 +1216,7 @@ private:
///
/// \param AllocIP Instruction to create AllocaInst before.
/// \param X The target atomic pointer to be updated
+ /// \param XElemTy The element type of the atomic pointer.
/// \param Expr The value to update X with.
/// \param AO Atomic ordering of the generated atomic
/// instructions.
@@ -1183,12 +1233,11 @@ private:
///
/// \returns A pair of the old value of X before the update, and the value
/// used for the update.
- std::pair<Value *, Value *> emitAtomicUpdate(Instruction *AllocIP, Value *X,
- Value *Expr, AtomicOrdering AO,
- AtomicRMWInst::BinOp RMWOp,
- AtomicUpdateCallbackTy &UpdateOp,
- bool VolatileX,
- bool IsXBinopExpr);
+ std::pair<Value *, Value *>
+ emitAtomicUpdate(Instruction *AllocIP, Value *X, Type *XElemTy, Value *Expr,
+ AtomicOrdering AO, AtomicRMWInst::BinOp RMWOp,
+ AtomicUpdateCallbackTy &UpdateOp, bool VolatileX,
+ bool IsXBinopExpr);
/// Emit the binary op. described by \p RMWOp, using \p Src1 and \p Src2 .
///
@@ -1200,6 +1249,7 @@ public:
/// a struct to pack relevant information while generating atomic Ops
struct AtomicOpValue {
Value *Var = nullptr;
+ Type *ElemTy = nullptr;
bool IsSigned = false;
bool IsVolatile = false;
};