From: Clifford Wolf Date: Wed, 31 Dec 2014 02:56:09 +0000 (+0100) Subject: IdString optimization X-Git-Tag: yosys-0.5~166 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7d6a7fe2ce8936c7af09ba7661e1159bc403483d;p=yosys.git IdString optimization --- diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 739b701f8..c40af88aa 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -121,6 +121,12 @@ namespace RTLIL global_id_index_[global_id_storage_.at(idx)] = idx; global_refcount_storage_.at(idx)++; + // Avoid Create->Delete->Create pattern + static IdString last_created_id; + put_reference(last_created_id.index_); + last_created_id.index_ = idx; + get_reference(last_created_id.index_); + if (yosys_xtrace) { log("#X# New IdString '%s' with index %d.\n", p, idx); log_backtrace("-X- ", yosys_xtrace-1);