diff options
Diffstat (limited to 'polly/lib/Analysis')
-rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 20084cd0623..2b0c1829507 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -3651,12 +3651,28 @@ void Scop::addRecordedAssumptions() { while (!RecordedAssumptions.empty()) { const Assumption &AS = RecordedAssumptions.pop_back_val(); - isl_set *S = AS.Set; + if (!AS.BB) { + addAssumption(AS.Kind, AS.Set, AS.Loc, AS.Sign); + continue; + } + // If a basic block was given use its domain to simplify the assumption. - if (AS.BB) - S = isl_set_params(isl_set_intersect(S, getDomainConditions(AS.BB))); + // In case of restrictions we know they only have to hold on the domain, + // thus we can intersect them with the domain of the block. However, for + // assumptions the domain has to imply them, thus: + // _ _____ + // Dom => S <==> A v B <==> A - B + // + // To avoid the complement we will register A - B as a restricton not an + // assumption. + isl_set *S = AS.Set; + isl_set *Dom = getDomainConditions(AS.BB); + if (AS.Sign == AS_RESTRICTION) + S = isl_set_params(isl_set_intersect(S, Dom)); + else /* (AS.Sign == AS_ASSUMPTION) */ + S = isl_set_params(isl_set_subtract(Dom, S)); - addAssumption(AS.Kind, S, AS.Loc, AS.Sign); + addAssumption(AS.Kind, S, AS.Loc, AS_RESTRICTION); } } |