[polly] r292121 - ScopInfo: Extract out splitAliasGroupsByDomain [NFC]

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 16 06:08:00 PST 2017


Author: grosser
Date: Mon Jan 16 08:08:00 2017
New Revision: 292121

URL: http://llvm.org/viewvc/llvm-project?rev=292121&view=rev
Log:
ScopInfo: Extract out splitAliasGroupsByDomain [NFC]

The function buildAliasGroups got very large. We extract out the splitting
of alias groups to reduce its size and to better document the current behavior.

Modified:
    polly/trunk/include/polly/ScopInfo.h
    polly/trunk/lib/Analysis/ScopInfo.cpp

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=292121&r1=292120&r2=292121&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Mon Jan 16 08:08:00 2017
@@ -2299,6 +2299,15 @@ public:
   std::tuple<AliasGroupVectorTy, DenseSet<Value *>>
   buildAliasGroupsForAccesses(AliasAnalysis &AA);
 
+  ///  Split alias groups by iteration domains.
+  ///
+  ///  We split each group based on the domains of the minimal/maximal accesses.
+  ///  That means two minimal/maximal accesses are only in a group if their
+  ///  access domains intersect. Otherwise, they are in different groups.
+  ///
+  ///  @param AliasGroups The alias groups to split
+  void splitAliasGroupsByDomain(AliasGroupVectorTy &AliasGroups);
+
   /// Return all alias groups for this SCoP.
   const MinMaxVectorPairVectorTy &getAliasGroups() const {
     return MinMaxAliasGroups;

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=292121&r1=292120&r2=292121&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Mon Jan 16 08:08:00 2017
@@ -2938,22 +2938,7 @@ Scop::buildAliasGroupsForAccesses(AliasA
   return std::make_tuple(AliasGroups, HasWriteAccess);
 }
 
-bool Scop::buildAliasGroups(AliasAnalysis &AA) {
-  // To create sound alias checks we perform the following steps:
-  //   o) We divide each group based on the domains of the minimal/maximal
-  //      accesses. That means two minimal/maximal accesses are only in a group
-  //      if their access domains intersect, otherwise they are in different
-  //      ones.
-  //   o) We partition each group into read only and non read only accesses.
-  //   o) For each group with more than one base pointer we then compute minimal
-  //      and maximal accesses to each array of a group in read only and non
-  //      read only partitions separately.
-  AliasGroupVectorTy AliasGroups;
-  DenseSet<Value *> HasWriteAccess;
-
-  std::tie(AliasGroups, HasWriteAccess) = buildAliasGroupsForAccesses(AA);
-
-  // Split the alias groups based on their domain.
+void Scop::splitAliasGroupsByDomain(AliasGroupVectorTy &AliasGroups) {
   for (unsigned u = 0; u < AliasGroups.size(); u++) {
     AliasGroupTy NewAG;
     AliasGroupTy &AG = AliasGroups[u];
@@ -2975,6 +2960,20 @@ bool Scop::buildAliasGroups(AliasAnalysi
       AliasGroups.push_back(std::move(NewAG));
     isl_set_free(AGDomain);
   }
+}
+
+bool Scop::buildAliasGroups(AliasAnalysis &AA) {
+  // To create sound alias checks we perform the following steps:
+  //   o) We partition each group into read only and non read only accesses.
+  //   o) For each group with more than one base pointer we then compute minimal
+  //      and maximal accesses to each array of a group in read only and non
+  //      read only partitions separately.
+  AliasGroupVectorTy AliasGroups;
+  DenseSet<Value *> HasWriteAccess;
+
+  std::tie(AliasGroups, HasWriteAccess) = buildAliasGroupsForAccesses(AA);
+
+  splitAliasGroupsByDomain(AliasGroups);
 
   auto &F = getFunction();
   MapVector<const Value *, SmallSetVector<MemoryAccess *, 8>> ReadOnlyPairs;




More information about the llvm-commits mailing list