[llvm-commits] [polly] r149503 - /polly/trunk/lib/Analysis/ScopInfo.cpp
Tobias Grosser
grosser at fim.uni-passau.de
Wed Feb 1 06:23:37 PST 2012
Author: grosser
Date: Wed Feb 1 08:23:36 2012
New Revision: 149503
URL: http://llvm.org/viewvc/llvm-project?rev=149503&view=rev
Log:
ScopInfo: Simplify some isl code
Modified:
polly/trunk/lib/Analysis/ScopInfo.cpp
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=149503&r1=149502&r2=149503&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Wed Feb 1 08:23:36 2012
@@ -383,35 +383,23 @@
// : i0 = o0, i1 = o1, ..., i(X-1) = o(X-1), iX < oX
//
static isl_map *getEqualAndLarger(isl_space *setDomain) {
- isl_space *mapDomain = isl_space_map_from_set(setDomain);
- isl_basic_map *bmap = isl_basic_map_universe(isl_space_copy(mapDomain));
- isl_local_space *MapLocalSpace = isl_local_space_from_space(mapDomain);
+ isl_space *Space = isl_space_map_from_set(setDomain);
+ isl_map *Map = isl_map_universe(isl_space_copy(Space));
+ isl_local_space *MapLocalSpace = isl_local_space_from_space(Space);
// Set all but the last dimension to be equal for the input and output
//
// input[i0, i1, ..., iX] -> output[o0, o1, ..., oX]
// : i0 = o0, i1 = o1, ..., i(X-1) = o(X-1)
- for (unsigned i = 0; i < isl_basic_map_n_in(bmap) - 1; ++i) {
- isl_int v;
- isl_int_init(v);
- isl_constraint *c = isl_equality_alloc(isl_local_space_copy(MapLocalSpace));
-
- isl_int_set_si(v, 1);
- isl_constraint_set_coefficient(c, isl_dim_in, i, v);
- isl_int_set_si(v, -1);
- isl_constraint_set_coefficient(c, isl_dim_out, i, v);
-
- bmap = isl_basic_map_add_constraint(bmap, c);
-
- isl_int_clear(v);
- }
+ for (unsigned i = 0; i < isl_map_dim(Map, isl_dim_in) - 1; ++i)
+ Map = isl_map_equate(Map, isl_dim_in, i, isl_dim_out, i);
// Set the last dimension of the input to be strict smaller than the
// last dimension of the output.
//
// input[?,?,?,...,iX] -> output[?,?,?,...,oX] : iX < oX
//
- unsigned lastDimension = isl_basic_map_n_in(bmap) - 1;
+ unsigned lastDimension = isl_map_dim(Map, isl_dim_in) - 1;
isl_int v;
isl_int_init(v);
isl_constraint *c = isl_inequality_alloc(isl_local_space_copy(MapLocalSpace));
@@ -423,10 +411,10 @@
isl_constraint_set_constant(c, v);
isl_int_clear(v);
- bmap = isl_basic_map_add_constraint(bmap, c);
+ Map = isl_map_add_constraint(Map, c);
isl_local_space_free(MapLocalSpace);
- return isl_map_from_basic_map(bmap);
+ return Map;
}
isl_set *MemoryAccess::getStride(__isl_take const isl_set *domainSubset) const {
More information about the llvm-commits
mailing list