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

Commit 45e32d7

Browse files
author
Sven Verdoolaege
committed
insertCopiesUnder: minor clean-up
The original code uses the arguable incorrectly exported isl_map_from_domain_and_range with additional wrapping, which is the same as computing the product of the two inputs. This latter operation is easier to understand. The calls are also formatted in a way that emphasizes the similarities between approximatedRead and writtenElements.
1 parent c3bb86c commit 45e32d7

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

tc/core/polyhedral/memory_promotion.cc

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -469,20 +469,15 @@ ScheduleTree* insertCopiesUnder(
469469
isl::set::universe(promotionSpace.domain().unwrap().domain());
470470
auto arrayId =
471471
promotionSpace.domain().unwrap().get_tuple_id(isl::dim_type::out);
472-
auto approximatedRead =
473-
isl::map(
474-
scheduleUniverse,
475-
group.approximateFootprint().set_tuple_id(arrayId).intersect(
476-
tensorElements))
477-
.wrap();
478-
approximatedRead = isl::map(approximatedRead, promotedFootprint).wrap();
472+
auto approximatedRead = scheduleUniverse.product(
473+
group.approximateFootprint().set_tuple_id(arrayId).intersect(
474+
tensorElements));
475+
approximatedRead = approximatedRead.product(promotedFootprint);
479476
auto readExtension = extension.intersect_range(approximatedRead)
480477
.set_tuple_id(isl::dim_type::out, readId);
481478
auto writtenElements =
482-
isl::map(
483-
group.scopedWrites().intersect_range(tensorElements).wrap(),
484-
promotedFootprint)
485-
.wrap();
479+
group.scopedWrites().intersect_range(tensorElements).wrap();
480+
writtenElements = writtenElements.product(promotedFootprint);
486481
auto writeExtension = extension.intersect_range(writtenElements)
487482
.set_tuple_id(isl::dim_type::out, writeId);
488483

0 commit comments

Comments
 (0)