[PATCH] D63304: Ignore Singletons in statement domains

Sameer AbuAsal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 15:30:52 PDT 2019


sabuasal marked 3 inline comments as done.
sabuasal added inline comments.


================
Comment at: lib/Analysis/ScopInfo.cpp:2896
 
+static bool hasSingleton(isl::set Set) {
+  if (Set.is_singleton())
----------------
Meinersbur wrote:
> Please document/doxygen what this function is doing
will do.


================
Comment at: lib/Analysis/ScopInfo.cpp:2905
+      DimOnly = DimOnly.project_out(isl::dim::set, 0, i);
+    if (Dims - i - 1 > 0) // Remove right dimensions.
+      DimOnly = DimOnly.project_out(isl::dim::set, 1, Dims - i - 1);
----------------
Meinersbur wrote:
> Condition not necessary: project_out will not do anything when projecting-out zero dimensions.
will do.


================
Comment at: lib/Analysis/ScopInfo.cpp:2996
+      }
+      UpperBoundParams = UpperBoundParams.unite(BSet.lexmax().params());
+    }
----------------
Meinersbur wrote:
> [serious] Instead of `lexmax` on the scatter function, shouldn't we subtract the parameter conditions that cause the singleton set to be executed? For instance, I imagine this would break the lexmax logic (smaller `n` means more loop iterations):
> ```
> for (int i = 0; i < -n; i+=1)
>   Stmt(i);
> ```
> 
> What is the reason for this logic to be in `addLoopBoundsToHeaderDomain` and not e.g. in a separate function like `intersectBBDomainParams`? I prefer having the logic handling this in one place.
Thanks for the suggestion here, I think this could actually fit in intersectBBDomainParams(), let me experiment with it.


Repository:
  rPLO Polly

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63304/new/

https://reviews.llvm.org/D63304





More information about the llvm-commits mailing list