-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CINN][Backend Pass Update No.7] Update merge_block_utils #70406
[CINN][Backend Pass Update No.7] Update merge_block_utils #70406
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
struct ForInfoAnalyzer { | ||
public: | ||
void operator()(ir::Expr* expr) { ir::IRMutator<>::Visit(expr, expr); } | ||
void operator()(const For& for_stmt) { Visit(for_stmt); } | ||
|
||
ForTreeNode BuildTreeNode(const ir::For* node) { | ||
ForTreeNode BuildTreeNode(const For& node) { | ||
ForTreeNode tree_node = {node, std::vector<ForTreeNode>()}; | ||
for (const auto for_node : for_to_children_[node]) { | ||
tree_node.children.push_back(BuildTreeNode(for_node)); | ||
for (const For& stmt : for_to_children_[node]) { | ||
tree_node.children.push_back(BuildTreeNode(stmt)); | ||
} | ||
return tree_node; | ||
} |
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.
可以尝试使用一下Paddle/paddle/cinn/ir/stmt_visitors.h的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.
这里暂时不用考虑if内的for,可以不修改,后续 @Dmovic 再扩展
PR Category
CINN
PR Types
Improvements
Description
改造了merge_block_utils