[polly] r267532 - Do not use the number of parameters in the complexity check

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 02:20:41 PDT 2016


Author: jdoerfert
Date: Tue Apr 26 04:20:41 2016
New Revision: 267532

URL: http://llvm.org/viewvc/llvm-project?rev=267532&view=rev
Log:
Do not use the number of parameters in the complexity check


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=267532&r1=267531&r2=267532&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Tue Apr 26 04:20:41 2016
@@ -1329,15 +1329,22 @@ buildConditionSets(ScopStmt &Stmt, Value
   ConsequenceCondSet = isl_set_coalesce(
       isl_set_intersect(ConsequenceCondSet, isl_set_copy(Domain)));
 
-  isl_set *AlternativeCondSet;
-  unsigned NumParams = isl_set_n_param(ConsequenceCondSet);
-  unsigned NumBasicSets = isl_set_n_basic_set(ConsequenceCondSet);
-  if (NumBasicSets + NumParams < MaxConjunctsInDomain) {
+  isl_set *AlternativeCondSet = nullptr;
+  bool ToComplex =
+      isl_set_n_basic_set(ConsequenceCondSet) >= MaxConjunctsInDomain;
+
+  if (!ToComplex) {
     AlternativeCondSet = isl_set_subtract(isl_set_copy(Domain),
                                           isl_set_copy(ConsequenceCondSet));
-  } else {
+    ToComplex = isl_set_n_basic_set(AlternativeCondSet) >= MaxConjunctsInDomain;
+  }
+
+  if (ToComplex) {
     S.invalidate(COMPLEXITY, TI ? TI->getDebugLoc() : DebugLoc());
+    isl_set_free(AlternativeCondSet);
     AlternativeCondSet = isl_set_empty(isl_set_get_space(ConsequenceCondSet));
+    isl_set_free(ConsequenceCondSet);
+    ConsequenceCondSet = isl_set_empty(isl_set_get_space(AlternativeCondSet));
   }
 
   ConditionSets.push_back(ConsequenceCondSet);




More information about the llvm-commits mailing list