From f06cb75b930d6ef5d8f4f12825ce0ef8f296ce17 Mon Sep 17 00:00:00 2001 From: Jakob Wenzel Date: Thu, 9 May 2019 12:37:31 +0200 Subject: [PATCH] initialize more registers in setundef -init --- passes/cmds/setundef.cc | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/passes/cmds/setundef.cc b/passes/cmds/setundef.cc index f6949c820..5b43d528c 100644 --- a/passes/cmds/setundef.cc +++ b/passes/cmds/setundef.cc @@ -404,22 +404,29 @@ struct SetundefPass : public Pass { initwires.insert(wire); } - for (int wire_types = 0; wire_types < 2; wire_types++) - for (auto wire : module->wires()) - { - if (wire->name[0] == (wire_types ? '\\' : '$')) - next_wire: - continue; - - for (auto bit : sigmap(wire)) - if (!ffbits.count(bit)) - goto next_wire; - - for (auto bit : sigmap(wire)) - ffbits.erase(bit); - - initwires.insert(wire); - } + for (int wire_types = 0; wire_types < 2; wire_types++) { + pool ffbitsToErase; + for (auto wire : module->wires()) { + if (wire->name[0] == (wire_types ? '\\' : '$')) { + next_wire: + continue; + } + + for (auto bit : sigmap(wire)) + if (!ffbits.count(bit)) { + goto next_wire; + } + + for (auto bit : sigmap(wire)) { + ffbitsToErase.insert(bit); + } + + initwires.insert(wire); + } + for (const auto &bit : ffbitsToErase) { + ffbits.erase(bit); + } + } for (auto wire : initwires) { -- 2.30.2