Fixed a performance bug in opt_reduce
authorClifford Wolf <clifford@clifford.at>
Sat, 2 Aug 2014 13:12:16 +0000 (15:12 +0200)
committerClifford Wolf <clifford@clifford.at>
Sat, 2 Aug 2014 13:12:16 +0000 (15:12 +0200)
passes/opt/opt_reduce.cc

index f947e9724e19783ed23951a2fdd0c394df15b82d..5f3c4d29ea35c62d549f1a7c20dc2638f6e9e429 100644 (file)
@@ -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);