22 if (
auto parallelOp = dyn_cast<omp::ParallelOp>(owner)) {
23 if (llvm::is_contained(parallelOp.getReductionVars(), use.
get()))
25 }
else if (
auto callOp = dyn_cast<CallOpInterface>(owner)) {
26 if (llvm::is_contained(callOp.getArgOperands(), use.
get()))
33 if (
auto argIface = dyn_cast<omp::BlockArgOpenMPOpInterface>(owner)) {
35 auto it = llvm::find(privateVars, use.
get());
36 if (it != privateVars.end()) {
38 size_t idx = std::distance(privateVars.begin(), it);
41 owner, cast<SymbolRefAttr>(privateSyms[idx]));
42 return privateOp.getDataSharingType() !=
43 omp::DataSharingClauseType::Private;
54 if (isa<LLVM::AddrSpaceCastOp, LLVM::GEPOp>(owner)) {
56 return allocaUsesRequireSharedMem(result);
67 if (isa<omp::ParallelOp>(op))
71 if (!offloadIface || !offloadIface.getIsTargetDevice())
79 if (!targetOp || targetOp->isProperAncestor(parallelOp))
87 targetOp = dyn_cast<omp::TargetOp>(op);
90 if (targetOp.getKernelExecFlags(targetOp.getInnermostCapturedOmpOp()) !=
91 omp::TargetExecMode::generic)
94 auto declTargetIface = op.
getParentOfType<omp::DeclareTargetInterface>();
95 if (!declTargetIface || !declTargetIface.isDeclareTarget() ||
96 declTargetIface.getDeclareTargetDeviceType() ==
97 omp::DeclareTargetDeviceType::host)
static bool allocaUseRequiresSharedMem(const OpOperand &use)
IRValueT get() const
Return the current value being used by this operand.
This class represents an operand of an operation.
This class implements the operand iterators for the Operation class.
Operation is the basic unit of execution within MLIR.
AttrClass getAttrOfType(StringAttr name)
OpTy getParentOfType()
Return the closest surrounding parent operation that is of type 'OpTy'.
result_range getResults()
static Operation * lookupNearestSymbolFrom(Operation *from, StringAttr symbol)
Returns the operation registered with the given symbol name within the closest parent operation of,...
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
use_range getUses() const
Returns a range of all uses, which is useful for iterating over all uses.
Operation * getOwner() const
Return the owner of this operand.
bool opInSharedDeviceContext(Operation &op)
Check whether the given operation is located in a context where an allocation to be used by multiple ...
bool allocaUsesRequireSharedMem(Value alloc)
Check whether the value representing an allocation, assumed to have been defined in a shared device c...
Include the generated interface declarations.