initialize more registers in setundef -init

This commit is contained in:
Jakob Wenzel 2019-05-09 12:37:31 +02:00
parent caad497839
commit f06cb75b93
1 changed files with 20 additions and 13 deletions

View File

@ -404,22 +404,29 @@ struct SetundefPass : public Pass {
initwires.insert(wire); initwires.insert(wire);
} }
for (int wire_types = 0; wire_types < 2; wire_types++) for (int wire_types = 0; wire_types < 2; wire_types++) {
for (auto wire : module->wires()) pool<SigBit> ffbitsToErase;
{ for (auto wire : module->wires()) {
if (wire->name[0] == (wire_types ? '\\' : '$')) if (wire->name[0] == (wire_types ? '\\' : '$')) {
next_wire: next_wire:
continue; continue;
}
for (auto bit : sigmap(wire)) for (auto bit : sigmap(wire))
if (!ffbits.count(bit)) if (!ffbits.count(bit)) {
goto next_wire; goto next_wire;
}
for (auto bit : sigmap(wire)) for (auto bit : sigmap(wire)) {
ffbits.erase(bit); ffbitsToErase.insert(bit);
}
initwires.insert(wire); initwires.insert(wire);
} }
for (const auto &bit : ffbitsToErase) {
ffbits.erase(bit);
}
}
for (auto wire : initwires) for (auto wire : initwires)
{ {