From 2df884f95a39b3588324ec2af5903b9eb0ebd162 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Tue, 1 Sep 2015 18:17:41 +0000 Subject: [PATCH] ScopInfo: use project_out instead of remove_dims By just removing dimensions (and the constraints they are involved in) we may loose information about the dimensions we do not remove. By instead using project_out, we are sure all constraints on the outer dimensions are preserved. No test case, as this error condition is very unlikely to be triggered by isl's current code. We still 'fix' this, as isl gives little guarantees regarding the behavior of remove_divs. llvm-svn: 246567 --- polly/lib/Analysis/ScopInfo.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 199f92bafdfa..1e4b582cb950 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -1584,13 +1584,14 @@ void Scop::buildDomainsWithBranchConstraints(Region *R, LoopInfo &LI, // and enter a new one we need to drop the old constraints. int SuccBBLoopDepth = getRelativeLoopDepth(SuccBBLoop); assert(std::abs(BBLoopDepth - SuccBBLoopDepth) <= 1); - if (BBLoopDepth > SuccBBLoopDepth) - CondSet = isl_set_remove_dims(CondSet, isl_dim_set, BBLoopDepth, 1); - else if (SuccBBLoopDepth > BBLoopDepth) + if (BBLoopDepth > SuccBBLoopDepth) { + CondSet = isl_set_project_out(CondSet, isl_dim_set, BBLoopDepth, 1); + } else if (SuccBBLoopDepth > BBLoopDepth) { CondSet = isl_set_add_dims(CondSet, isl_dim_set, 1); - else if (BBLoopDepth >= 0) - CondSet = isl_set_drop_constraints_involving_dims( - CondSet, isl_dim_set, BBLoopDepth, 1); + } else if (BBLoopDepth >= 0) { + CondSet = isl_set_project_out(CondSet, isl_dim_set, BBLoopDepth, 1); + CondSet = isl_set_add_dims(CondSet, isl_dim_set, 1); + } } // Set the domain for the successor or merge it with an existing domain in