diff options
Diffstat (limited to 'passes/pmgen/peepopt.cc')
-rw-r--r-- | passes/pmgen/peepopt.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/passes/pmgen/peepopt.cc b/passes/pmgen/peepopt.cc index e9aa8e37a..0584878c3 100644 --- a/passes/pmgen/peepopt.cc +++ b/passes/pmgen/peepopt.cc @@ -19,11 +19,14 @@ #include "kernel/yosys.h" #include "kernel/sigtools.h" -#include "passes/pmgen/peepopt_pm.h" USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN +bool did_something; + +#include "passes/pmgen/peepopt_pm.h" + struct PeepoptPass : public Pass { PeepoptPass() : Pass("peepopt", "collection of peephole optimizers") { } void help() YS_OVERRIDE @@ -51,8 +54,12 @@ struct PeepoptPass : public Pass { extra_args(args, argidx, design); for (auto module : design->selected_modules()) { - peepopt_pm pm(module, module->selected_cells()); - pm.run_shiftmul(); + did_something = true; + while (did_something) { + did_something = false; + peepopt_pm pm(module, module->selected_cells()); + pm.run_shiftmul(); + } } } } PeepoptPass; |