[polly] r292122 - ScopInfo: Fold SmallVectors used in alias check generation back into loop [NFC]

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


Author: grosser
Date: Mon Jan 16 08:08:02 2017
New Revision: 292122

URL: http://llvm.org/viewvc/llvm-project?rev=292122&view=rev
Log:
ScopInfo: Fold SmallVectors used in alias check generation back into loop [NFC]

Hoisting small vectors out of a loop seems to be a pure performance
optimization, which is unlikely to have great impact in practice. As this
hoisting just increases code-complexity, we fold the SmallVectors back into
the loop.

In subsequent commits, we will further simplify and structure this code, but
we committed this change separately to provide an explanation to make clear
that we purposefully reverted this optimization.

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

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=292122&r1=292121&r2=292122&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Mon Jan 16 08:08:02 2017
@@ -2976,11 +2976,9 @@ bool Scop::buildAliasGroups(AliasAnalysi
   splitAliasGroupsByDomain(AliasGroups);
 
   auto &F = getFunction();
-  MapVector<const Value *, SmallSetVector<MemoryAccess *, 8>> ReadOnlyPairs;
-  SmallPtrSet<const Value *, 4> NonReadOnlyBaseValues;
   for (AliasGroupTy &AG : AliasGroups) {
-    NonReadOnlyBaseValues.clear();
-    ReadOnlyPairs.clear();
+    MapVector<const Value *, SmallSetVector<MemoryAccess *, 8>> ReadOnlyPairs;
+    SmallPtrSet<const Value *, 4> NonReadOnlyBaseValues;
 
     if (AG.size() < 2) {
       AG.clear();




More information about the llvm-commits mailing list