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

Commit d1673af

Browse files
ftynseSven Verdoolaege
authored andcommitted
merge ScopedFootprint::footprint into TensorReferenceGroup::approximateFootprint
ScopedFootprint::footprint has only one call site and requires the domain to be communicated from TensorReferenceGroup. Arguably, only the footprint of the entire group ever needs to be computed. Merge the code of ScopedFootprint::footprint into TensorReferenceGroup::approximateFootprint. This prepares for inclusion of stride information.
1 parent 693d85a commit d1673af

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

tc/core/polyhedral/memory_promotion.cc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,17 @@ std::unique_ptr<TensorReferenceGroup> TensorReferenceGroup::makeSingleton(
7777
return group;
7878
}
7979

80-
isl::set ScopedFootprint::footprint(isl::set domain) const {
81-
auto space = box.get_space();
82-
auto accessed = isl::map::universe(space).intersect_domain(domain);
80+
isl::set TensorReferenceGroup::approximateFootprint() const {
81+
auto scopedDomain = scopedAccesses().domain();
82+
auto space = approximation.box.get_space();
83+
auto accessed = isl::map::universe(space).intersect_domain(scopedDomain);
8384
auto lspace = isl::local_space(accessed.get_space().range());
8485

85-
for (size_t i = 0; i < dim(); ++i) {
86-
auto dimLowerBound = lowerBound(i);
86+
for (size_t i = 0; i < approximation.dim(); ++i) {
87+
auto dimLowerBound = approximation.lowerBound(i);
8788
auto rhs = isl::aff(lspace, isl::dim_type::set, i);
8889
isl::map partial = (isl::aff_map(dimLowerBound) <= rhs) &
89-
(isl::aff_map(dimLowerBound + size(i)) > rhs);
90+
(isl::aff_map(dimLowerBound + approximation.size(i)) > rhs);
9091
accessed = accessed & partial;
9192
}
9293
return accessed.range();

tc/core/polyhedral/memory_promotion.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ struct ScopedFootprint {
4949
return box.get_offset().get_aff(pos);
5050
}
5151
isl::fixed_box box;
52-
isl::set footprint(isl::set domain) const;
5352
isl::multi_aff lowerBounds() const;
5453
};
5554

@@ -131,9 +130,7 @@ class TensorReferenceGroup {
131130

132131
// Rectangular overapproximation of the set of tensor elements accessed below
133132
// the scoping point.
134-
isl::set approximateFootprint() const {
135-
return approximation.footprint(scopedAccesses().domain());
136-
}
133+
isl::set approximateFootprint() const;
137134

138135
isl::multi_aff promotion() const;
139136
isl::set promotedFootprint() const;

0 commit comments

Comments
 (0)