[PATCH] D63304: Ignore Singletons in statement domains

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 13:16:19 PDT 2019


Meinersbur added a comment.

In D63304#1543859 <https://reviews.llvm.org/D63304#1543859>, @sabuasal wrote:

> You can detect this simple loop domain directly by using quering "is_singleton" but with nested loops you'll need to project out to find singletons in one dimension out of all the loop nest dimensions.


What I meant is NOT using isl at all for detecting the situation, but deriving it from the control flow graph (such as 'conditional branch found at the end of the loop instead of before'). Keep in mind this is only a [suggestion], not a requirement for me to accept this patch.

In D63304#1543902 <https://reviews.llvm.org/D63304#1543902>, @sabuasal wrote:

> As for numbers, we observed code size saving of around 1 MB when compiling a version of android Q.


What is 1 MB relative to?



================
Comment at: include/polly/ScopInfo.h:69
   DELINEARIZATION,
+  UPPERBOUND,
 };
----------------
sabuasal wrote:
> Meinersbur wrote:
> > Can you use something more descriptive?
> Hmm, I'll change to TRIPCOUNT , how does that sound?
Better, but still does not describe what the assumption is.


================
Comment at: lib/Analysis/ScopInfo.cpp:195
+static cl::opt<bool>
+    HandleDoWhile("polly-model-do-while",
+                  cl::desc("Prune exeution domain of statements to ignore"
----------------
sabuasal wrote:
> Meinersbur wrote:
> > Can you explain the why you chose the name `model-do-while`?
> The problem with disjunction in domains is very common in *do while* style loops  where the domain of the statement has either one iteration (if the loop condition is false) or more than one. 
> 
> The idea in this patch is that if the loop condition is actually false we should really not try to run the transformed version of the loop anyway since it not beneficial for a loop of 1 iteration.
> 
> I am open t other names if you have suggestions :)
The problem I see is that this does not only apply to do-while loops (which is a syntactical element), but e.g. to loop-rotated other loops as well.

[suggestion] `polly-avoid-singular-loops`, `polly-assume-multi-iteration-loops`, `polly-fallback-on-single-iteration-loops`, `-polly-expect-loops-to-loop`, `-polly-optimize-looping-loops-only`, ....

(in compiler lingo, 'assume' usually means the compiler is free to use the fact for optimization without requiring it to be verified, 'expect' that violating the fact must still result in correct code).


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