Changeset View
Changeset View
Standalone View
Standalone View
include/polly/CodeGen/IslAst.h
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | public: | ||||
using MemoryAccessSet = SmallPtrSet<MemoryAccess *, 4>; | using MemoryAccessSet = SmallPtrSet<MemoryAccess *, 4>; | ||||
/// @brief Payload information used to annotate an AST node. | /// @brief Payload information used to annotate an AST node. | ||||
struct IslAstUserPayload { | struct IslAstUserPayload { | ||||
/// @brief Construct and initialize the payload. | /// @brief Construct and initialize the payload. | ||||
IslAstUserPayload() | IslAstUserPayload() | ||||
: IsInnermost(false), IsInnermostParallel(false), | : IsInnermost(false), IsInnermostParallel(false), | ||||
IsOutermostParallel(false), IsReductionParallel(false), | IsOutermostParallel(false), IsReductionParallel(false), | ||||
MinimalDependenceDistance(nullptr), Build(nullptr) {} | MinimalDependenceDistance(nullptr), NumberOfIterations(nullptr), | ||||
Build(nullptr) {} | |||||
/// @brief Cleanup all isl structs on destruction. | /// @brief Cleanup all isl structs on destruction. | ||||
~IslAstUserPayload(); | ~IslAstUserPayload(); | ||||
/// @brief Flag to mark innermost loops. | /// @brief Flag to mark innermost loops. | ||||
bool IsInnermost; | bool IsInnermost; | ||||
/// @brief Flag to mark innermost parallel loops. | /// @brief Flag to mark innermost parallel loops. | ||||
bool IsInnermostParallel; | bool IsInnermostParallel; | ||||
/// @brief Flag to mark outermost parallel loops. | /// @brief Flag to mark outermost parallel loops. | ||||
bool IsOutermostParallel; | bool IsOutermostParallel; | ||||
/// @brief Flag to mark parallel loops which break reductions. | /// @brief Flag to mark parallel loops which break reductions. | ||||
bool IsReductionParallel; | bool IsReductionParallel; | ||||
/// @brief The minimal dependence distance for non parallel loops. | /// @brief The minimal dependence distance for non parallel loops. | ||||
isl_pw_aff *MinimalDependenceDistance; | isl_pw_aff *MinimalDependenceDistance; | ||||
/// @brief The loop trip count. | |||||
isl_pw_aff *NumberOfIterations; | |||||
/// @brief The build environment at the time this node was constructed. | /// @brief The build environment at the time this node was constructed. | ||||
isl_ast_build *Build; | isl_ast_build *Build; | ||||
/// @brief Set of accesses which break reduction dependences. | /// @brief Set of accesses which break reduction dependences. | ||||
MemoryAccessSet BrokenReductions; | MemoryAccessSet BrokenReductions; | ||||
}; | }; | ||||
private: | private: | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | public: | ||||
getMinimalDependenceDistance(__isl_keep isl_ast_node *Node); | getMinimalDependenceDistance(__isl_keep isl_ast_node *Node); | ||||
/// @brief Get the nodes broken reductions or a nullptr if not available. | /// @brief Get the nodes broken reductions or a nullptr if not available. | ||||
static MemoryAccessSet *getBrokenReductions(__isl_keep isl_ast_node *Node); | static MemoryAccessSet *getBrokenReductions(__isl_keep isl_ast_node *Node); | ||||
/// @brief Get the nodes build context or a nullptr if not available. | /// @brief Get the nodes build context or a nullptr if not available. | ||||
static __isl_give isl_ast_build *getBuild(__isl_keep isl_ast_node *Node); | static __isl_give isl_ast_build *getBuild(__isl_keep isl_ast_node *Node); | ||||
/// @brief Get the number of iterations or a nullptr if not available. | |||||
static __isl_give isl_pw_aff * | |||||
getNumberOfIterations(__isl_keep isl_ast_node *Node); | |||||
jdoerfert: We might consider to move to this interface and do some actual computation on the parametric… | |||||
/// @brief Get the number of iterations as int or -1 if not available. | |||||
static int getNumberOfIterationsAsInt(__isl_keep isl_ast_node *Node); | |||||
///} | ///} | ||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const; | virtual void getAnalysisUsage(AnalysisUsage &AU) const; | ||||
virtual void releaseMemory(); | virtual void releaseMemory(); | ||||
}; | }; | ||||
} | } | ||||
namespace llvm { | namespace llvm { | ||||
class PassRegistry; | class PassRegistry; | ||||
void initializeIslAstInfoPass(llvm::PassRegistry &); | void initializeIslAstInfoPass(llvm::PassRegistry &); | ||||
} | } | ||||
#endif /* POLLY_ISL_AST_H */ | #endif /* POLLY_ISL_AST_H */ |
We might consider to move to this interface and do some actual computation on the parametric loop trip counts instead of limiting ourselfs to integer loop trip counts... often the LLVM vectorizer does not vectorize loops even if they are annotated parallel and have a few simple load-binop-store chains (e.g., bicg when it's parallelized in the outer most dimension and therefore doesn't have a reduction in the innermost loop any more [due to privatization to be exact]).