Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit a92d1fb

Browse files
Sven Verdoolaegeftynse
authored andcommitted
TensorReferenceGroup::promotedFootprint: directly use box sizes
There is no need to collect the sizes in a vector given that they are already available in an isl::multi_val. The isl::multi_val representation also allows for a more natural space compatibility check.
1 parent c9a380b commit a92d1fb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tc/core/polyhedral/memory_promotion.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,18 @@ bool TensorReferenceGroup::isReadOnly() const {
109109

110110
isl::set TensorReferenceGroup::promotedFootprint() const {
111111
auto space = scopedAccesses().get_space().range();
112-
auto sizes = approximationSizes();
113-
if (sizes.size() != space.dim(isl::dim_type::set)) {
112+
auto sizes = approximation.box.get_size();
113+
if (!sizes.get_space().has_equal_tuples(space)) {
114114
throw promotion::GroupingError("unexpected dimensionality mismatch");
115115
}
116116

117117
isl::set footprint = isl::set::universe(space);
118118
auto lspace = isl::local_space(space);
119119
for (size_t i = 0, e = sizes.size(); i < e; ++i) {
120120
auto aff = isl::aff(lspace, isl::dim_type::out, i);
121+
auto size = sizes.get_val(i);
121122
footprint =
122-
footprint & (isl::aff_set(aff) >= 0) & (isl::aff_set(aff) < sizes[i]);
123+
footprint & (isl::aff_set(aff) >= 0) & (isl::aff_set(aff) < size);
123124
}
124125
return footprint;
125126
}

0 commit comments

Comments
 (0)