[polly] r267285 - Improve accuracy of Scop::hasFeasibleRuntimeContext

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 23 06:00:28 PDT 2016


Author: jdoerfert
Date: Sat Apr 23 08:00:27 2016
New Revision: 267285

URL: http://llvm.org/viewvc/llvm-project?rev=267285&view=rev
Log:
Improve accuracy of Scop::hasFeasibleRuntimeContext

  If the AssumptionContext is a subset of the InvalidContext the runtime
  context is not feasible.


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=267285&r1=267284&r2=267285&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sat Apr 23 08:00:27 2016
@@ -3477,13 +3477,16 @@ __isl_give isl_set *Scop::getAssumedCont
 
 bool Scop::hasFeasibleRuntimeContext() const {
   auto *PositiveContext = getAssumedContext();
+  auto *NegativeContext = getInvalidContext();
   PositiveContext = addNonEmptyDomainConstraints(PositiveContext);
-  bool IsFeasible = !isl_set_is_empty(PositiveContext);
+  bool IsFeasible = !(isl_set_is_empty(PositiveContext) ||
+                      isl_set_is_subset(PositiveContext, NegativeContext));
   isl_set_free(PositiveContext);
-  if (!IsFeasible)
+  if (!IsFeasible) {
+    isl_set_free(NegativeContext);
     return false;
+  }
 
-  auto *NegativeContext = getInvalidContext();
   auto *DomainContext = isl_union_set_params(getDomains());
   IsFeasible = !isl_set_is_subset(DomainContext, NegativeContext);
   IsFeasible &= !isl_set_is_subset(Context, NegativeContext);




More information about the llvm-commits mailing list