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

Commit aad84fc

Browse files
author
Sven Verdoolaege
committed
emitHalideExpr: inline single call to toString(isl::pw_aff)
Since 04fa3ed (emitHalideExpr: use isl AST expression generator to print expression, Fri Mar 23 20:39:39 2018 +0100), the body only consists of two lines (modulo comments) and inlining the call will make it easier to inspect the intermediate isl::ast_expr object.
1 parent d758224 commit aad84fc

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

include/tc/core/polyhedral/cuda/codegen.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ struct CodegenStatementContext;
3131

3232
namespace detail {
3333

34-
std::string toString(isl::pw_aff subscript);
35-
3634
isl::pw_aff makeAffFromMappedExpr(
3735
const Halide::Expr& expr,
3836
const CodegenStatementContext& context);

src/core/polyhedral/cuda/codegen.cc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -452,14 +452,6 @@ void AstPrinter::emitAst(isl::ast_node node) {
452452

453453
namespace detail {
454454

455-
std::string toString(isl::pw_aff subscript) {
456-
// Use a temporary isl::ast_build to print the expression.
457-
// Ideally, this should use the build at the point
458-
// where the user statement was created.
459-
auto astBuild = isl::ast_build::from_context(subscript.domain());
460-
return astBuild.expr_from(subscript).to_C_str();
461-
}
462-
463455
isl::pw_aff makeAffFromMappedExpr(
464456
const Halide::Expr& expr,
465457
const CodegenStatementContext& context) {
@@ -514,7 +506,12 @@ void emitHalideExpr(
514506
// a name to look up somewhere.
515507
auto pwAff = tc::polyhedral::detail::makeAffFromMappedExpr(
516508
Halide::Expr(op), context);
517-
context.ss << tc::polyhedral::detail::toString(pwAff);
509+
// Use a temporary isl::ast_build to print the expression.
510+
// Ideally, this should use the build at the point
511+
// where the user statement was created.
512+
auto astBuild = isl::ast_build::from_context(pwAff.domain());
513+
auto s = astBuild.expr_from(pwAff).to_C_str();
514+
context.ss << s;
518515
}
519516
void visit(const Halide::Internal::Call* op) {
520517
if (substitutions.count(op->name)) {

0 commit comments

Comments
 (0)