From 8fd1c269ac7322f21408c1f99e7e4c275789c056 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 2 Aug 2014 15:12:16 +0200 Subject: [PATCH] Fixed a performance bug in opt_reduce --- passes/opt/opt_reduce.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/passes/opt/opt_reduce.cc b/passes/opt/opt_reduce.cc index f947e9724..5f3c4d29e 100644 --- a/passes/opt/opt_reduce.cc +++ b/passes/opt/opt_reduce.cc @@ -368,8 +368,12 @@ struct OptReducePass : public Pass { for (auto &mod_it : design->modules_) { if (!design->selected(mod_it.second)) continue; - OptReduceWorker worker(design, mod_it.second, do_fine); - total_count += worker.total_count; + do { + OptReduceWorker worker(design, mod_it.second, do_fine); + total_count += worker.total_count; + if (worker.total_count == 0) + break; + } while (1); } log("Performed a total of %d changes.\n", total_count); -- 2.30.2