未验证 提交 100ac296 编写于 作者: 傅剑寒 提交者: GitHub

fix simplifyBlockMutator backtrace logic (#56338)

上级 1af1178a
...@@ -299,6 +299,9 @@ struct SimplifyBlocksMutator : public ir::IRMutator<> { ...@@ -299,6 +299,9 @@ struct SimplifyBlocksMutator : public ir::IRMutator<> {
*expr = node->stmts[0]; *expr = node->stmts[0];
Visit(expr, expr); Visit(expr, expr);
} else { } else {
for (auto& s : node->stmts) {
Visit(&s, &s);
}
std::vector<Expr> stmts; std::vector<Expr> stmts;
for (auto& s : node->stmts) { for (auto& s : node->stmts) {
if (s.As<ir::Block>()) { if (s.As<ir::Block>()) {
...@@ -308,7 +311,6 @@ struct SimplifyBlocksMutator : public ir::IRMutator<> { ...@@ -308,7 +311,6 @@ struct SimplifyBlocksMutator : public ir::IRMutator<> {
stmts.push_back(inner_stmt); stmts.push_back(inner_stmt);
} }
} else { } else {
IRMutator<>::Visit(&s, &s);
stmts.push_back(s); stmts.push_back(s);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册