@@ -77,14 +77,6 @@ ScopedFootprint outputRanges(isl::map access) {
7777 footprint.box = access.get_range_simple_fixed_box_hull ();
7878 return footprint;
7979}
80-
81- // Given a set space, construct a map space with the input as domain and
82- // a range of the given size.
83- isl::space add_range (isl::space space, unsigned dim) {
84- auto range = space.params ().unnamed_set_from_params (dim);
85- return space.map_from_domain_and_range (range);
86- }
87-
8880} // namespace
8981
9082// Access has the shape :: [S -> ref] -> O
@@ -119,14 +111,14 @@ isl::map TensorReferenceGroup::approximateScopedAccesses() const {
119111 auto scopedDomain = scopedAccesses ().domain ();
120112 auto space = approximation.box .get_space ();
121113 auto accessed = isl::map::universe (space).intersect_domain (scopedDomain);
122- auto lspace = isl::local_space (accessed.get_space ().range ());
123114
115+ auto identity = isl::multi_aff::identity (space.range ().map_from_set ());
124116 for (size_t i = 0 ; i < approximation.dim (); ++i) {
125117 auto offset = approximation.lowerBound (i);
126118 auto stride = approximation.stride (i);
127119 auto strideOffset = approximation.strideOffset (i);
128120 auto size = approximation.size (i);
129- auto rhs = isl::aff (lspace, isl::dim_type::set, i);
121+ auto rhs = identity. get_aff ( i);
130122 auto lowerBound = offset * stride + strideOffset;
131123 auto upperBound = (offset + size) * stride + strideOffset;
132124 auto partial =
@@ -160,9 +152,9 @@ isl::set TensorReferenceGroup::promotedFootprint() const {
160152 }
161153
162154 isl::set footprint = isl::set::universe (space);
163- auto lspace = isl::local_space (space);
155+ auto identity = isl::multi_aff::identity (space. map_from_set () );
164156 for (size_t i = 0 , e = sizes.size (); i < e; ++i) {
165- auto aff = isl::aff (lspace, isl::dim_type::out, i);
157+ auto aff = identity. get_aff ( i);
166158 auto size = sizes.get_val (i);
167159 footprint =
168160 footprint & (isl::aff_set (aff) >= 0 ) & (isl::aff_set (aff) < size);
@@ -422,12 +414,13 @@ isl::set tensorElementsSet(const Scop& scop, isl::id tensorId) {
422414 space = space.named_set_from_params_id (tensorId, nDim);
423415
424416 auto tensorElements = isl::set::universe (space);
417+ auto identity = isl::multi_aff::identity (space.range ().map_from_set ());
425418 for (int i = 0 ; i < nDim; ++i) {
426419 auto minAff = halide2isl::makeIslAffFromExpr (
427420 space, halideParameter.min_constraint (i));
428421 auto extentAff = halide2isl::makeIslAffFromExpr (
429422 space, halideParameter.extent_constraint (i));
430- auto aff = isl::aff ( isl::local_space (space), isl::dim_type::set, i);
423+ auto aff = identity. get_aff ( i);
431424 tensorElements = tensorElements & (minAff <= isl::aff_set (aff)) &
432425 (isl::aff_set (aff) < (minAff + extentAff));
433426 }
@@ -456,7 +449,7 @@ isl::multi_aff dropDummyTensorDimensions(
456449 }
457450 }
458451
459- space = add_range (space, list.size ());
452+ space = addRange (space, list.size ());
460453 return isl::multi_aff (space, list);
461454}
462455
0 commit comments