-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[CINN][Backend Pass Update No.9] Update RemoveScheduleBlock pass #70334
[CINN][Backend Pass Update No.9] Update RemoveScheduleBlock pass #70334
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
把注释迁移过来吧😂 |
void VisitExpr(ir::Expr* expr) { | ||
if (expr->is_var()) { | ||
if (expr->as_var()->name == var_->name && (do_replace_ || visit_all_)) { | ||
Expr copied = ir::ir_utils::IRCopy(expr_); | ||
*expr = copied; | ||
} | ||
return; | ||
} | ||
for (auto field : (*expr)->expr_fields()) { | ||
VisitExpr(field); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expr也不用特殊实现了,直接调用默认visit函数就行
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认Visit是指 IRMutator::Visit
嘛,不是说升级以后的Visit会被删除嘛?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expr也不用特殊实现了,直接调用默认visit函数就行
BTW,为啥原来的Mutator的Visit方法都要传两个参数进去,不太理解
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认Visit是指
IRMutator::Visit
嘛,不是说升级以后的Visit会被删除嘛?
升级之后,属于Stmt的visit函数会被删除,但是Expr还是必须按照这种方式访问,我们后续会把IRMutator的visit限定在Expr。原来的Visit方法传两个参数是为了区分const访问和非const访问,但是这种实现方式确实设计得有点奇怪。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK,已经改过了,麻烦您再看一下
PR Category
CINN
PR Types
Improvements
Description
改造了 RemoveScheduleBlock pass