[polly] r193741 - Update comments to address Sebastian's review

Tobias Grosser tobias at grosser.es
Thu Oct 31 04:50:52 PDT 2013


Author: grosser
Date: Thu Oct 31 06:50:52 2013
New Revision: 193741

URL: http://llvm.org/viewvc/llvm-project?rev=193741&view=rev
Log:
Update comments to address Sebastian's review

Modified:
    polly/trunk/include/polly/ScopInfo.h
    polly/trunk/lib/CodeGen/IslAst.cpp

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=193741&r1=193740&r2=193741&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Thu Oct 31 06:50:52 2013
@@ -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;

Modified: polly/trunk/lib/CodeGen/IslAst.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslAst.cpp?rev=193741&r1=193740&r2=193741&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/IslAst.cpp (original)
+++ polly/trunk/lib/CodeGen/IslAst.cpp Thu Oct 31 06:50:52 2013
@@ -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 *AtEachDo
   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 &
                                                &BuildInfo);
   }
 
-  buildAssumedContext(Context);
+  buildRunCondition(Context);
 
   Root = isl_ast_build_ast_from_schedule(Context, Schedule);
 





More information about the llvm-commits mailing list