[polly] r211803 - [Refactor] Make the used dependence types explicit

Johannes Doerfert jdoerfert at codeaurora.org
Thu Jun 26 13:24:17 PDT 2014


Author: jdoerfert
Date: Thu Jun 26 15:24:17 2014
New Revision: 211803

URL: http://llvm.org/viewvc/llvm-project?rev=211803&view=rev
Log:
[Refactor] Make the used dependence types explicit

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

Modified: polly/trunk/include/polly/Dependences.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/Dependences.h?rev=211803&r1=211802&r2=211803&view=diff
==============================================================================
--- polly/trunk/include/polly/Dependences.h (original)
+++ polly/trunk/include/polly/Dependences.h Thu Jun 26 15:24:17 2014
@@ -47,11 +47,11 @@ public:
 
   /// @brief The type of the dependences.
   ///
-  /// Reduction dependences are not included in TYPE_ALL dependences because we
-  /// can ignore them during the scheduling. This is the case since the order in
-  /// which the reduction statements are executed does not matter. However, if
-  /// they are executed in parallel we need to take additional measures (e.g.,
-  /// privatization) to ensure a correct result.
+  /// Reduction dependences are seperated because they can be ignored during
+  /// the scheduling. This is the case since the order in which the reduction
+  /// statements are executed does not matter. However, if they are executed
+  /// in parallel we need to take additional measures (e.g., privatization)
+  /// to ensure a correct result.
   enum Type {
     // Write after read
     TYPE_WAR = 0x1,
@@ -64,9 +64,6 @@ public:
 
     // Reduction dependences
     TYPE_RED = 0x8,
-
-    // All (validity) dependences
-    TYPE_ALL = (TYPE_WAR | TYPE_RAW | TYPE_WAW)
   };
 
   typedef std::map<ScopStmt *, isl_map *> StatementToIslMapTy;

Modified: polly/trunk/lib/Analysis/Dependences.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/Dependences.cpp?rev=211803&r1=211802&r2=211803&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/Dependences.cpp (original)
+++ polly/trunk/lib/Analysis/Dependences.cpp Thu Jun 26 15:24:17 2014
@@ -369,7 +369,7 @@ bool Dependences::isValidScattering(Stat
   if (LegalityCheckDisabled)
     return true;
 
-  isl_union_map *Dependences = getDependences(TYPE_ALL);
+  isl_union_map *Dependences = getDependences(TYPE_RAW | TYPE_WAW | TYPE_WAR);
   isl_space *Space = S.getParamSpace();
   isl_union_map *Scattering = isl_union_map_empty(Space);
 
@@ -442,7 +442,7 @@ bool Dependences::isParallelDimension(__
 
   // FIXME: We can remove ignore reduction dependences in case we privatize the
   //        memory locations the reduction statements reduce into.
-  Deps = getDependences(TYPE_ALL | TYPE_RED);
+  Deps = getDependences(TYPE_RAW | TYPE_WAW | TYPE_WAR | TYPE_RED);
 
   if (isl_union_map_is_empty(Deps)) {
     isl_union_map_free(Deps);

Modified: polly/trunk/lib/CodeGen/IslAst.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslAst.cpp?rev=211803&r1=211802&r2=211803&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/IslAst.cpp (original)
+++ polly/trunk/lib/CodeGen/IslAst.cpp Thu Jun 26 15:24:17 2014
@@ -168,7 +168,8 @@ static bool astScheduleDimIsParallel(__i
 
   // FIXME: We can remove ignore reduction dependences in case we privatize the
   //        memory locations the reduction statements reduce into.
-  Deps = D->getDependences(Dependences::TYPE_ALL | Dependences::TYPE_RED);
+  Deps = D->getDependences(Dependences::TYPE_RAW | Dependences::TYPE_WAW |
+                           Dependences::TYPE_WAR | Dependences::TYPE_RED);
   Deps = isl_union_map_apply_range(Deps, isl_union_map_copy(Schedule));
   Deps = isl_union_map_apply_domain(Deps, Schedule);
 





More information about the llvm-commits mailing list