Skip to content

Commit

Permalink
fix auto separate bug (PaddlePaddle#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
Superjomn authored Mar 29, 2020
1 parent 13b63ea commit c062900
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cinn/optim/transform_polyfor_to_for.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ struct ForAutoSeparateMutator : ir::IRMutator<Expr*> {

Expr* PolyForAutoSeparateHelper(Expr* expr) {
ForAutoSeparateMutator mutator;
auto* res = mutator(expr);
if (res) return res;
return mutator(expr);
}

struct ForAutoSeparateMutatorMain : public ir::IRMutator<Expr*> {
Expand All @@ -214,7 +213,10 @@ struct ForAutoSeparateMutatorMain : public ir::IRMutator<Expr*> {
if (res) Visit(res);
}

void Visit(Expr* expr) { ir::IRMutator<>::Visit(expr, expr); }
void Visit(Expr* expr) {
CHECK(expr);
ir::IRMutator<>::Visit(expr, expr);
}
};

Expr PlusOneWithMinMax(Expr expr) {
Expand Down

0 comments on commit c062900

Please sign in to comment.