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

Commit 5f65bbf

Browse files
author
Sven Verdoolaege
committed
AstPrinter::emitStmt: check presence of iterator map for all statements
It is not clear why the check was only being performed for some statement types. Perhaps it is not needed for some statement types, but it is, for example, needed for copy statements and there was no check for those. Since an iterator map should have been store for every statement, simply check it for every statement, even if it is not strictly needed.
1 parent e17e36e commit 5f65bbf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/core/polyhedral/cuda/codegen.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,8 @@ void AstPrinter::emitStmt(isl::ast_node_user node) {
401401
auto stmtId = usrExp.get_op_arg(0).get_id();
402402
auto nodeId = node.get_annotation();
403403
auto statementContext = CodegenStatementContext(context_, nodeId);
404+
CHECK_EQ(context_.iteratorMaps.count(nodeId), 1)
405+
<< "no iterator remapping for op " << nodeId;
404406

405407
WS ws;
406408
context_.ss << ws.tab();
@@ -414,8 +416,6 @@ void AstPrinter::emitStmt(isl::ast_node_user node) {
414416
emitReductionInit(stmtId, updateId, context_);
415417
inReduction_ = true;
416418
} else if (inReduction_ && context_.scop().isReductionUpdate(stmtId)) {
417-
CHECK_EQ(context_.iteratorMaps.count(nodeId), 1)
418-
<< "no iterator remapping for op " << nodeId;
419419
emitReductionUpdate(stmtId, statementContext);
420420
reductionUpdateNodeId_ = nodeId;
421421
} else if (context_.scop().isSyncId(stmtId)) {
@@ -424,8 +424,6 @@ void AstPrinter::emitStmt(isl::ast_node_user node) {
424424
stmtId.get_name() == kReadIdName || stmtId.get_name() == kWriteIdName) {
425425
emitCopyStmt(statementContext);
426426
} else { // regular statement
427-
CHECK_EQ(context_.iteratorMaps.count(nodeId), 1)
428-
<< "no iterator remapping for op " << nodeId;
429427
auto mappedStmtId =
430428
context_.iteratorMaps.at(nodeId).get_tuple_id(isl::dim_type::out);
431429
CHECK_EQ(stmtId, mappedStmtId)

0 commit comments

Comments
 (0)