9#ifndef MLIR_DIALECT_OPENACC_OPENACCUTILS_H_
10#define MLIR_DIALECT_OPENACC_OPENACCUTILS_H_
14#include "llvm/ADT/SmallVector.h"
15#include "llvm/ADT/StringRef.h"
42std::optional<ClauseDefaultValue>
getDefaultAttr(mlir::Operation *op);
54std::string
getRecipeName(mlir::acc::RecipeKind kind, mlir::Type type);
69 mlir::Operation **definingOpPtr =
nullptr);
99llvm::SmallVector<mlir::Value>
101 mlir::DominanceInfo &domInfo,
102 mlir::PostDominanceInfo &postDomInfo);
114remark::detail::InFlightRemark
115emitRemark(mlir::Operation *op,
const std::function<std::string()> &messageFn,
116 llvm::StringRef category =
"openacc");
125inline remark::detail::InFlightRemark
127 llvm::StringRef category =
"openacc") {
129 op, std::function<std::string()>([msg = message.str()]() { return msg; }),
A class for computing basic dominance information.
Operation is the basic unit of execution within MLIR.
A class for computing basic postdominance information.
mlir::acc::VariableTypeCategory getTypeCategory(mlir::Value var)
Get the type category of an OpenACC variable.
std::string getVariableName(mlir::Value v)
Attempts to extract the variable name from a value by walking through view-like operations until an a...
bool isValidSymbolUse(mlir::Operation *user, mlir::SymbolRefAttr symbol, mlir::Operation **definingOpPtr=nullptr)
Check if a symbol use is valid for use in an OpenACC region.
std::optional< ClauseDefaultValue > getDefaultAttr(mlir::Operation *op)
Looks for an OpenACC default attribute on the current operation op or in a parent operation which enc...
bool isOnlyUsedByReductionClauses(mlir::Value val, mlir::Region ®ion)
Returns true if this value is only used by acc.reduction operations in the region.
bool isValidValueUse(mlir::Value val, mlir::Region ®ion)
Check if a value use is valid in an OpenACC region.
mlir::Operation * getEnclosingComputeOp(mlir::Region ®ion)
Used to obtain the enclosing compute construct operation that contains the provided region.
llvm::SmallVector< mlir::Value > getDominatingDataClauses(mlir::Operation *computeConstructOp, mlir::DominanceInfo &domInfo, mlir::PostDominanceInfo &postDomInfo)
Collects all data clauses that dominate the compute construct.
std::string getRecipeName(mlir::acc::RecipeKind kind, mlir::Type type)
Get the recipe name for a given recipe kind and type.
remark::detail::InFlightRemark emitRemark(mlir::Operation *op, const std::function< std::string()> &messageFn, llvm::StringRef category="openacc")
Emit an OpenACC remark with lazy message generation.
bool isDeviceValue(mlir::Value val)
Check if a value represents device data.
mlir::Value getBaseEntity(mlir::Value val)
bool isOnlyUsedByPrivateClauses(mlir::Value val, mlir::Region ®ion)
Returns true if this value is only used by acc.private operations in the region.
Include the generated interface declarations.