diff options
| author | Tobias Grosser <tobias@grosser.es> | 2013-10-31 11:50:52 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2013-10-31 11:50:52 +0000 |
| commit | d764fcbd5a35d7abdba1ba4735da09c28e240d8a (patch) | |
| tree | 9321aedc57269825b67d95a6a38e0e31d7c00552 | |
| parent | 703da2ea9883a534467a2e04a07c85243e08bf5d (diff) | |
| download | bcm5719-llvm-d764fcbd5a35d7abdba1ba4735da09c28e240d8a.tar.gz bcm5719-llvm-d764fcbd5a35d7abdba1ba4735da09c28e240d8a.zip | |
Update comments to address Sebastian's review
llvm-svn: 193741
| -rwxr-xr-x | polly/include/polly/ScopInfo.h | 2 | ||||
| -rw-r--r-- | polly/lib/CodeGen/IslAst.cpp | 17 |
2 files changed, 15 insertions, 4 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index 38157452987..e4062222b94 100755 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -560,7 +560,7 @@ public: __isl_give isl_set *getContext() const; __isl_give isl_space *getParamSpace() const; - /// @brief Get the assumped context for this Scop. + /// @brief Get the assumed context for this Scop. /// /// @return The assumed context of this Scop. __isl_give isl_set *getAssumedContext() const; diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp index 57f3ae67137..94cc65f4e16 100644 --- a/polly/lib/CodeGen/IslAst.cpp +++ b/polly/lib/CodeGen/IslAst.cpp @@ -60,6 +60,8 @@ public: void pprint(llvm::raw_ostream &OS); __isl_give isl_ast_node *getAst(); + + /// @brief Get the run-time conditions for the Scop. __isl_give isl_ast_expr *getRunCondition(); private: @@ -68,7 +70,7 @@ private: isl_ast_expr *RunCondition; __isl_give isl_union_map *getSchedule(); - void buildAssumedContext(__isl_keep isl_ast_build *Context); + void buildRunCondition(__isl_keep isl_ast_build *Context); }; } // End namespace polly. @@ -315,7 +317,16 @@ static __isl_give isl_ast_node *AtEachDomain(__isl_take isl_ast_node *Node, return isl_ast_node_set_annotation(Node, Id); } -void IslAst::buildAssumedContext(__isl_keep isl_ast_build *Context) { +void IslAst::buildRunCondition(__isl_keep isl_ast_build *Context) { + // The conditions that need to be checked at run-time for this scop are + // available as an isl_set in the AssumedContext. We generate code for this + // check as follows. First, we generate an isl_pw_aff that is 1, if a certain + // combination of parameter values fulfills the conditions in the assumed + // context, and that is 0 otherwise. We then translate this isl_pw_aff into + // an isl_ast_expr. At run-time this expression can be evaluated and the + // optimized scop can be executed conditionally according to the result of the + // run-time check. + isl_aff *Zero = isl_aff_zero_on_domain(isl_local_space_from_space(S->getParamSpace())); isl_aff *One = @@ -368,7 +379,7 @@ IslAst::IslAst(Scop *Scop, Dependences &D) : S(Scop) { &BuildInfo); } - buildAssumedContext(Context); + buildRunCondition(Context); Root = isl_ast_build_ast_from_schedule(Context, Schedule); |

