Skip to content

Commit 1074311

Browse files
Courtesy-Xspull[bot]
authored andcommitted
fix simplifyBlockMutator backtrace logic (#56338)
1 parent aee4ab6 commit 1074311

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

paddle/cinn/optim/ir_simplify.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,9 @@ struct SimplifyBlocksMutator : public ir::IRMutator<> {
299299
*expr = node->stmts[0];
300300
Visit(expr, expr);
301301
} else {
302+
for (auto& s : node->stmts) {
303+
Visit(&s, &s);
304+
}
302305
std::vector<Expr> stmts;
303306
for (auto& s : node->stmts) {
304307
if (s.As<ir::Block>()) {
@@ -308,7 +311,6 @@ struct SimplifyBlocksMutator : public ir::IRMutator<> {
308311
stmts.push_back(inner_stmt);
309312
}
310313
} else {
311-
IRMutator<>::Visit(&s, &s);
312314
stmts.push_back(s);
313315
}
314316
}

0 commit comments

Comments
 (0)