[PATCH] D45066: [Polly] [ScopInfo] Remove bail out condition in buildMinMaxAccess()

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 29 22:29:45 PDT 2018


Meinersbur added a comment.

Thanks your contribution!

With the infos provided you should be able to fix the assertions.



================
Comment at: lib/Analysis/ScopInfo.cpp:2304
 
-  Set = Set.remove_divs();
-
+  Set = Set.simple_hull();
   if (isl_set_n_basic_set(Set.get()) >= MaxDisjunctsInDomain)
----------------
Did you try with `affine_hull` as well?


================
Comment at: lib/Analysis/ScopInfo.cpp:2335-2345
   if (isl_ctx_last_error(Ctx.get()) == isl_error_quota)
     return isl::stat::error;
 
   MinPMA = MinPMA.coalesce();
   MaxPMA = MaxPMA.coalesce();
 
   // Adjust the last dimension of the maximal access by one as we want to
----------------
As Eli already mentioned, these lines are indeed the issue. I assume commit r303404 meant to protect the assertion by checking for an error before, but coalescing can already max-out the quote.

I think it is safer to use 
`assert((!MaxPMA || MaxPMA.dim(isl::dim::out)) && "Assumed at least one output dimension");` instead since even `add_constant_si` below can trigger the quota. That we'll need to check for the error anyway (And do, at the end of IslMaxOperationsGuard scope)


================
Comment at: lib/Analysis/ScopInfo.cpp:2377
   isl::union_set Locations = Accesses.range();
-  Locations = Locations.coalesce();
   Locations = Locations.detect_equalities();
 
----------------
The `detect_equalities` should also have become unnecessary.


================
Comment at: lib/Analysis/ScopInfo.cpp:3195
     if (isl_ctx_last_error(getIslCtx().get()) == isl_error_quota) {
       invalidate(COMPLEXITY, DebugLoc());
       return false;
----------------
[different issue] `buildAliasGroup` can also return false if the complexity limit is hit, but only if it passes through we actually invalidate the SCoP?!?


Repository:
  rPLO Polly

https://reviews.llvm.org/D45066





More information about the llvm-commits mailing list