[polly] r252750 - ScopInfo: Limit the number of disjuncts in assumed context

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 11 12:24:28 PST 2015


On 11/11/2015 08:54 PM, Johannes Doerfert wrote:
> On 11/11, Tobias Grosser via llvm-commits wrote:
>> Author: grosser
>> Date: Wed Nov 11 10:22:36 2015
>> New Revision: 252750
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=252750&view=rev
>> Log:
>> ScopInfo: Limit the number of disjuncts in assumed context
>>
>> In certain rare cases (mostly -polly-process-unprofitable on large sequences
>> of conditions - often without any loop), we see some compile-time timeouts due
>> to the construction of an overly complex assumption context. This change limits
>> the number of disjuncts to 150 (adjustable), to prevent us from creating
>> assumptions contexts that are too large for even the compilation to finish.
>>
>> The limit has been choosen as large as possible to make sure we do not
>> unnecessarily drop test coverage. If such cases also appear in
>> -polly-process-unprofitable=false mode we may need to think about this again,
>> as the current limitations may still allow assumptions that are way to complex
>> to be checked profitably at run-time.
>>
>> There is also certainly room for improvement regarding how (and how efficient)
>> we construct an assumed context, but this requires some more thinking.
>>
>> This completes llvm.org/PR25458
>>
>> Added:
>>      polly/trunk/test/ScopInfo/long-sequence-of-error-blocks-2.ll
>> 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=252750&r1=252749&r2=252750&view=diff
>> ==============================================================================
>> --- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
>> +++ polly/trunk/lib/Analysis/ScopInfo.cpp Wed Nov 11 10:22:36 2015
>> @@ -91,6 +91,12 @@ static cl::opt<bool> DetectReductions("p
>>                                         cl::Hidden, cl::ZeroOrMore,
>>                                         cl::init(true), cl::cat(PollyCategory));
>>
>> +static cl::opt<int> MaxDisjunctsAssumed(
>> +    "polly-max-disjuncts-assumed",
>> +    cl::desc("The maximal number of disjuncts we allow in the assumption "
>> +             "context (this bounds compile time)"),
>> +    cl::Hidden, cl::ZeroOrMore, cl::init(150), cl::cat(PollyCategory));
>> +
>>   //===----------------------------------------------------------------------===//
>>
>>   // Create a sequence of two schedules. Either argument may be null and is
>> @@ -2851,6 +2857,16 @@ bool Scop::hasFeasibleRuntimeContext() c
>>
>>   void Scop::addAssumption(__isl_take isl_set *Set) {
>>     AssumedContext = isl_set_intersect(AssumedContext, Set);
>> +  isl_basic_set_list *List = isl_set_get_basic_set_list(AssumedContext);
>> +  int NSets = isl_basic_set_list_n_basic_set(List);
>> +  isl_basic_set_list_free(List);
>> +
>> +  if (NSets >= MaxDisjunctsAssumed) {
>> +    isl_space *Space = isl_set_get_space(AssumedContext);
>> +    isl_set_free(AssumedContext);
>> +    AssumedContext = isl_set_universe(Space);
> This should be an empty set and not the universe, right? Otherwise you
> just drop assumptions which is not so

Fixed in r252795. Thank you for noticing.

Best,
Tobias



More information about the llvm-commits mailing list