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

Commit 96ebfa3

Browse files
author
Sven Verdoolaege
committed
AstPrinter::emitStmt: reuse generic statementContext for regular statement
This removes some minor code duplication.
1 parent 5f65bbf commit 96ebfa3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/core/polyhedral/cuda/codegen.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,11 @@ 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-
auto mappedStmtId =
428-
context_.iteratorMaps.at(nodeId).get_tuple_id(isl::dim_type::out);
427+
auto mappedStmtId = statementContext.statementId();
429428
CHECK_EQ(stmtId, mappedStmtId)
430429
<< "statement ids in expr (" << stmtId << ") and in iteratorMaps ("
431430
<< mappedStmtId << ") do not match";
432-
emitUserStmt(stmtId, CodegenStatementContext(context_, nodeId));
431+
emitUserStmt(stmtId, statementContext);
433432
}
434433
}
435434

0 commit comments

Comments
 (0)