summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis/ScopInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/Analysis/ScopInfo.cpp')
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 319d0722dad..385ee44f97c 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -1663,8 +1663,18 @@ void Scop::realignParams() {
static __isl_give isl_set *
simplifyAssumptionContext(__isl_take isl_set *AssumptionContext,
const Scop &S) {
- isl_set *DomainParameters = isl_union_set_params(S.getDomains());
- AssumptionContext = isl_set_gist_params(AssumptionContext, DomainParameters);
+ // If we modelt all blocks in the SCoP that have side effects we can simplify
+ // the context with the constraints that are needed for anything to be
+ // executed at all. However, if we have error blocks in the SCoP we already
+ // assumed some parameter combinations cannot occure and removed them from the
+ // domains, thus we cannot use the remaining domain to simplify the
+ // assumptions.
+ if (!S.hasErrorBlock()) {
+ isl_set *DomainParameters = isl_union_set_params(S.getDomains());
+ AssumptionContext =
+ isl_set_gist_params(AssumptionContext, DomainParameters);
+ }
+
AssumptionContext = isl_set_gist_params(AssumptionContext, S.getContext());
return AssumptionContext;
}
@@ -1918,8 +1928,10 @@ void Scop::buildDomainsWithBranchConstraints(Region *R) {
// the predecessors and can therefor look at the domain of a error block.
// That allows us to generate the assumptions needed for them not to be
// executed at runtime.
- if (containsErrorBlock(RN, getRegion(), LI, DT))
+ if (containsErrorBlock(RN, getRegion(), LI, DT)) {
+ HasErrorBlock = true;
continue;
+ }
BasicBlock *BB = getRegionNodeBasicBlock(RN);
TerminatorInst *TI = BB->getTerminator();
@@ -2443,9 +2455,10 @@ Scop::Scop(Region &R, AccFuncMapType &AccFuncMap, ScopDetection &SD,
isl_ctx *Context, unsigned MaxLoopDepth)
: LI(LI), DT(DT), SE(&ScalarEvolution), SD(SD), R(R),
AccFuncMap(AccFuncMap), IsOptimized(false),
- HasSingleExitEdge(R.getExitingBlock()), MaxLoopDepth(MaxLoopDepth),
- IslCtx(Context), Context(nullptr), Affinator(this),
- AssumedContext(nullptr), BoundaryContext(nullptr), Schedule(nullptr) {}
+ HasSingleExitEdge(R.getExitingBlock()), HasErrorBlock(false),
+ MaxLoopDepth(MaxLoopDepth), IslCtx(Context), Context(nullptr),
+ Affinator(this), AssumedContext(nullptr), BoundaryContext(nullptr),
+ Schedule(nullptr) {}
void Scop::init(AliasAnalysis &AA) {
buildContext();
OpenPOWER on IntegriCloud