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

Commit fbbfcb0

Browse files
committed
promoteGroup: disallow double promotion
1 parent 720d077 commit fbbfcb0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/core/polyhedral/scop.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,22 @@ void Scop::promoteGroup(
187187
const std::unordered_set<isl::id, isl::IslIdIslHash>& activeStmts,
188188
isl::union_map schedule,
189189
bool forceLastExtentOdd) {
190+
for (const auto& id : activeStmts) {
191+
for (const auto& prom : activePromotions_[id]) {
192+
if (promotedDecls_.count(prom.groupId) != 0 &&
193+
promotedDecls_[prom.groupId].tensorId == tensorId) {
194+
// FIXME: allow double promotion if copies are inserted properly,
195+
// in particular if the new promotion is strictly smaller in scope
196+
// and size than the existing ones (otherwise we would need to find
197+
// the all the existing ones and change their copy relations).
198+
std::cerr << "FIXME: not promoting because another promotion of tensor "
199+
<< promotedDecls_[prom.groupId].tensorId << " is active in "
200+
<< id << std::endl;
201+
return;
202+
}
203+
}
204+
}
205+
190206
auto groupId = nextGroupIdForTensor(tensorId);
191207
insertCopiesUnder(*this, tree, *gr, tensorId, groupId);
192208
auto sizes = gr->approximationSizes();

0 commit comments

Comments
 (0)