[polly] r247781 - Add option to enable/disable reduction usage in dependence analysis

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 02:50:18 PDT 2015


Author: grosser
Date: Wed Sep 16 04:50:17 2015
New Revision: 247781

URL: http://llvm.org/viewvc/llvm-project?rev=247781&view=rev
Log:
Add option to enable/disable reduction usage in dependence analysis

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=247781&r1=247780&r2=247781&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/DependenceInfo.cpp (original)
+++ polly/trunk/lib/Analysis/DependenceInfo.cpp Wed Sep 16 04:50:17 2015
@@ -51,6 +51,12 @@ static cl::opt<bool> LegalityCheckDisabl
     "disable-polly-legality", cl::desc("Disable polly legality check"),
     cl::Hidden, cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory));
 
+static cl::opt<bool>
+    UseReductions("polly-dependences-use-reductions",
+                  cl::desc("Exploit reductions in dependence analysis"),
+                  cl::Hidden, cl::init(true), cl::ZeroOrMore,
+                  cl::cat(PollyCategory));
+
 enum AnalysisType { VALUE_BASED_ANALYSIS, MEMORY_BASED_ANALYSIS };
 
 static cl::opt<enum AnalysisType> OptAnalysisType(
@@ -79,10 +85,11 @@ static void collectInfo(Scop &S, isl_uni
   *StmtSchedule = isl_union_map_empty(Space);
 
   SmallPtrSet<const Value *, 8> ReductionBaseValues;
-  for (ScopStmt &Stmt : S)
-    for (MemoryAccess *MA : Stmt)
-      if (MA->isReductionLike())
-        ReductionBaseValues.insert(MA->getBaseAddr());
+  if (UseReductions)
+    for (ScopStmt &Stmt : S)
+      for (MemoryAccess *MA : Stmt)
+        if (MA->isReductionLike())
+          ReductionBaseValues.insert(MA->getBaseAddr());
 
   for (ScopStmt &Stmt : S) {
     for (MemoryAccess *MA : Stmt) {




More information about the llvm-commits mailing list