[polly] r294567 - [DependenceInfo] Use ScopArrayInfo to keep track of arrays [NFC]

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 00:06:05 PST 2017


Author: grosser
Date: Thu Feb  9 02:06:05 2017
New Revision: 294567

URL: http://llvm.org/viewvc/llvm-project?rev=294567&view=rev
Log:
[DependenceInfo] Use ScopArrayInfo to keep track of arrays [NFC]

When computing reduction dependences we first identify all ScopArrays which are
part of reductions and then only compute for these ScopArrays the more detailed
data dependences that allow us to identify reductions and optimize across them.
Instead of using the base pointer as identifier of a ScopArray, it is clearer
and more understandable to directly use the ScopArray as identifier. This change
implements such a switch.

This change removes unnecessary uses of MemoryAddress::getBaseAddr() in
preparation for https://reviews.llvm.org/D28518.

Modified:
    polly/trunk/lib/Analysis/DependenceInfo.cpp

Modified: polly/trunk/lib/Analysis/DependenceInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/DependenceInfo.cpp?rev=294567&r1=294566&r2=294567&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/DependenceInfo.cpp (original)
+++ polly/trunk/lib/Analysis/DependenceInfo.cpp Thu Feb  9 02:06:05 2017
@@ -123,12 +123,12 @@ static void collectInfo(Scop &S, isl_uni
   *AccessSchedule = isl_union_map_empty(isl_space_copy(Space));
   *StmtSchedule = isl_union_map_empty(Space);
 
-  SmallPtrSet<const Value *, 8> ReductionBaseValues;
+  SmallPtrSet<const ScopArrayInfo *, 8> ReductionArrays;
   if (UseReductions)
     for (ScopStmt &Stmt : S)
       for (MemoryAccess *MA : Stmt)
         if (MA->isReductionLike())
-          ReductionBaseValues.insert(MA->getBaseAddr());
+          ReductionArrays.insert(MA->getScopArrayInfo());
 
   for (ScopStmt &Stmt : S) {
     for (MemoryAccess *MA : Stmt) {
@@ -137,7 +137,7 @@ static void collectInfo(Scop &S, isl_uni
 
       accdom = isl_map_intersect_domain(accdom, domcp);
 
-      if (ReductionBaseValues.count(MA->getBaseAddr())) {
+      if (ReductionArrays.count(MA->getScopArrayInfo())) {
         // Wrap the access domain and adjust the schedule accordingly.
         //
         // An access domain like
@@ -178,7 +178,7 @@ static void collectInfo(Scop &S, isl_uni
         *Write = isl_union_map_add_map(*Write, accdom);
     }
 
-    if (!ReductionBaseValues.empty() && Level == Dependences::AL_Statement)
+    if (!ReductionArrays.empty() && Level == Dependences::AL_Statement)
       *StmtSchedule = isl_union_map_add_map(*StmtSchedule, Stmt.getSchedule());
   }
 




More information about the llvm-commits mailing list