diff options
Diffstat (limited to 'polly/lib/Analysis/ScopInfo.cpp')
-rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 57 |
1 files changed, 25 insertions, 32 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index cc28d33a32d..881375b34ad 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -44,6 +44,7 @@ #include "isl/printer.h" #include "isl/local_space.h" #include "isl/options.h" +#include "isl/val.h" #include <sstream> #include <string> #include <vector> @@ -98,8 +99,7 @@ public: __isl_give isl_pw_aff *visitConstant(const SCEVConstant *Constant) { ConstantInt *Value = Constant->getValue(); - isl_int v; - isl_int_init(v); + isl_val *v; // LLVM does not define if an integer value is interpreted as a signed or // unsigned value. Hence, without further information, it is unknown how @@ -111,15 +111,14 @@ public: // demand. // 2. We pass down the signedness of the calculation and use it to interpret // this constant correctly. - MPZ_from_APInt(v, Value->getValue(), /* isSigned */ true); + v = isl_valFromAPInt(Ctx, Value->getValue(), /* isSigned */ true); isl_space *Space = isl_space_set_alloc(Ctx, 0, NbLoopSpaces); isl_local_space *ls = isl_local_space_from_space(isl_space_copy(Space)); isl_aff *Affine = isl_aff_zero_on_domain(ls); isl_set *Domain = isl_set_universe(Space); - Affine = isl_aff_add_constant(Affine, v); - isl_int_clear(v); + Affine = isl_aff_add_constant_val(Affine, v); return isl_pw_aff_alloc(Domain, Affine); } @@ -299,11 +298,10 @@ MemoryAccess::MemoryAccess(const IRAccess &Access, const Instruction *AccInst, // subsequent values of 'i' index two values that are stored next to each // other in memory. By this division we make this characteristic obvious // again. - isl_int v; - isl_int_init(v); - isl_int_set_si(v, Access.getElemSizeInBytes()); - Affine = isl_pw_aff_scale_down(Affine, v); - isl_int_clear(v); + isl_val *v; + v = isl_val_int_from_si(isl_pw_aff_get_ctx(Affine), + Access.getElemSizeInBytes()); + Affine = isl_pw_aff_scale_down_val(Affine, v); AccessRelation = isl_map_from_pw_aff(Affine); isl_space *Space = Statement->getDomainSpace(); @@ -368,16 +366,15 @@ static isl_map *getEqualAndLarger(isl_space *setDomain) { // input[?,?,?,...,iX] -> output[?,?,?,...,oX] : iX < oX // unsigned lastDimension = isl_map_dim(Map, isl_dim_in) - 1; - isl_int v; - isl_int_init(v); + isl_val *v; + isl_ctx *Ctx = isl_map_get_ctx(Map); isl_constraint *c = isl_inequality_alloc(isl_local_space_copy(MapLocalSpace)); - isl_int_set_si(v, -1); - isl_constraint_set_coefficient(c, isl_dim_in, lastDimension, v); - isl_int_set_si(v, 1); - isl_constraint_set_coefficient(c, isl_dim_out, lastDimension, v); - isl_int_set_si(v, -1); - isl_constraint_set_constant(c, v); - isl_int_clear(v); + v = isl_val_int_from_si(Ctx, -1); + c = isl_constraint_set_coefficient_val(c, isl_dim_in, lastDimension, v); + v = isl_val_int_from_si(Ctx, 1); + c = isl_constraint_set_coefficient_val(c, isl_dim_out, lastDimension, v); + v = isl_val_int_from_si(Ctx, -1); + c = isl_constraint_set_constant_val(c, v); Map = isl_map_add_constraint(Map, c); @@ -736,7 +733,7 @@ void Scop::buildContext() { void Scop::addParameterBounds() { for (unsigned i = 0; i < isl_set_dim(Context, isl_dim_param); ++i) { - isl_int V; + isl_val *V; isl_id *Id; const SCEV *Scev; const IntegerType *T; @@ -749,19 +746,15 @@ void Scop::addParameterBounds() { assert(T && "Not an integer type"); int Width = T->getBitWidth(); - isl_int_init(V); + V = isl_val_int_from_si(IslCtx, Width - 1); + V = isl_val_2exp(V); + V = isl_val_neg(V); + Context = isl_set_lower_bound_val(Context, isl_dim_param, i, 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); + V = isl_val_int_from_si(IslCtx, Width - 1); + V = isl_val_2exp(V); + V = isl_val_sub_ui(V, 1); + Context = isl_set_upper_bound_val(Context, isl_dim_param, i, V); } } |