summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpolly/include/polly/ScopInfo.h3
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp34
-rw-r--r--polly/test/ScopInfo/loop_carry.ll2
-rwxr-xr-xpolly/utils/checkout_cloog.sh2
4 files changed, 39 insertions, 2 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h
index 4eb1ece2d55..9bb08efd877 100755
--- a/polly/include/polly/ScopInfo.h
+++ b/polly/include/polly/ScopInfo.h
@@ -443,6 +443,9 @@ class Scop {
/// @brief Build the Context of the Scop.
void buildContext();
+ /// @brief Add the bounds of the parameters to the context.
+ void addParameterBounds();
+
/// Build the Scop and Statement with precalculate scop information.
void buildScop(TempScop &TempScop, const Region &CurRegion,
// Loops in Scop containing CurRegion
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index b1b95c03945..2c9486c5fc8 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -37,6 +37,7 @@
#define DEBUG_TYPE "polly-scops"
#include "llvm/Support/Debug.h"
+#include "isl/int.h"
#include "isl/constraint.h"
#include "isl/set.h"
#include "isl/map.h"
@@ -755,6 +756,38 @@ void Scop::buildContext() {
Context = isl_set_universe (Space);
}
+void Scop::addParameterBounds() {
+ for (unsigned i = 0; i < isl_set_dim(Context, isl_dim_param); ++i) {
+ isl_int V;
+ isl_id *Id;
+ const SCEV *Scev;
+ const IntegerType *T;
+
+ Id = isl_set_get_dim_id(Context, isl_dim_param, i);
+ Scev = (const SCEV*) isl_id_get_user(Id);
+ T = dyn_cast<IntegerType>(Scev->getType());
+ isl_id_free(Id);
+
+ assert(T && "Not an integer type");
+ int Width = T->getBitWidth();
+
+ isl_int_init(V);
+
+ isl_int_set_si(V, 1);
+ isl_int_mul_2exp(V, V, Width-1);
+ isl_int_neg(V, V);
+ isl_set_lower_bound(Context, isl_dim_param, i, V);
+
+ isl_int_set_si(V, 1);
+ isl_int_mul_2exp(V, V, Width-1);
+ isl_int_sub_ui(V, V, 1);
+ isl_set_upper_bound(Context, isl_dim_param, i, V);
+
+ isl_int_clear(V);
+ }
+}
+
+
void Scop::realignParams() {
// Add all parameters into a common model.
isl_space *Space = isl_space_params_alloc(IslCtx, ParameterIds.size());
@@ -790,6 +823,7 @@ Scop::Scop(TempScop &tempScop, LoopInfo &LI, ScalarEvolution &ScalarEvolution,
buildScop(tempScop, getRegion(), NestLoops, Scatter, LI);
realignParams();
+ addParameterBounds();
assert(NestLoops.empty() && "NestLoops not empty at top level!");
}
diff --git a/polly/test/ScopInfo/loop_carry.ll b/polly/test/ScopInfo/loop_carry.ll
index e45fb85e77a..f61bb00fdf1 100644
--- a/polly/test/ScopInfo/loop_carry.ll
+++ b/polly/test/ScopInfo/loop_carry.ll
@@ -47,7 +47,7 @@ bb2: ; preds = %bb, %entry
}
; CHECK: Context:
-; CHECK: [n] -> { : }
+; CHECK: [n] -> { : n >= -9223372036854775808 and n <= 9223372036854775807 }
; CHECK: Statements {
; CHECK: Stmt_bb_nph
; CHECK: Domain :=
diff --git a/polly/utils/checkout_cloog.sh b/polly/utils/checkout_cloog.sh
index b8832dabf05..7d9928d987c 100755
--- a/polly/utils/checkout_cloog.sh
+++ b/polly/utils/checkout_cloog.sh
@@ -1,7 +1,7 @@
#!/bin/sh
CLOOG_HASH="57470e76bfd58a0c38c598e816411663193e0f45"
-ISL_HASH="2b54bb607bfc666dfee01c6332e347d0c253335f"
+ISL_HASH="edfaf3a8006bbf9f4dd7db7fef4035402e14dff6"
PWD=`pwd`
OpenPOWER on IntegriCloud