diff options
-rw-r--r-- | polly/include/polly/CodeGen/IslAst.h | 11 | ||||
-rw-r--r-- | polly/lib/CodeGen/IslAst.cpp | 9 |
2 files changed, 16 insertions, 4 deletions
diff --git a/polly/include/polly/CodeGen/IslAst.h b/polly/include/polly/CodeGen/IslAst.h index ea007b74737..0ee9dffa20e 100644 --- a/polly/include/polly/CodeGen/IslAst.h +++ b/polly/include/polly/CodeGen/IslAst.h @@ -56,6 +56,15 @@ public: /// @brief Get the run-time conditions for the Scop. __isl_give isl_ast_expr *getRunCondition(); + /// @brief Build run-time condition for scop. + /// + /// @param S The scop to build the condition for. + /// @param Build The isl_build object to use to build the condition. + /// + /// @returns An ast expression that describes the necessary run-time check. + static isl_ast_expr *buildRunCondition(Scop *S, + __isl_keep isl_ast_build *Build); + private: Scop *S; isl_ast_node *Root; @@ -64,8 +73,6 @@ private: IslAst(Scop *Scop); void init(const Dependences &D); - - void buildRunCondition(__isl_keep isl_ast_build *Build); }; class IslAstInfo : public ScopPass { diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp index 71b43af8229..7cf8b3bc759 100644 --- a/polly/lib/CodeGen/IslAst.cpp +++ b/polly/lib/CodeGen/IslAst.cpp @@ -329,7 +329,10 @@ buildCondition(__isl_keep isl_ast_build *Build, const Scop::MinMaxAccessTy *It0, return NonAliasGroup; } -void IslAst::buildRunCondition(__isl_keep isl_ast_build *Build) { +__isl_give isl_ast_expr * +IslAst::buildRunCondition(Scop *S, __isl_keep isl_ast_build *Build) { + isl_ast_expr *RunCondition; + // The conditions that need to be checked at run-time for this scop are // available as an isl_set in the runtime check context from which we can // directly derive a run-time condition. @@ -355,6 +358,8 @@ void IslAst::buildRunCondition(__isl_keep isl_ast_build *Build) { RunCondition, buildCondition(Build, RWAccIt0, &ROAccIt)); } } + + return RunCondition; } /// @brief Simple cost analysis for a given SCoP @@ -418,7 +423,7 @@ void IslAst::init(const Dependences &D) { &BuildInfo); } - buildRunCondition(Build); + RunCondition = buildRunCondition(S, Build); Root = isl_ast_build_node_from_schedule(Build, S->getScheduleTree()); |