summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-12-31 03:56:09 +0100
committerClifford Wolf <clifford@clifford.at>2014-12-31 03:56:09 +0100
commit7d6a7fe2ce8936c7af09ba7661e1159bc403483d (patch)
tree5811ec9714baae6b68388ed557f1c264940ffd81 /kernel
parent60f16e17afc81d8bbae722c13ef173329129494a (diff)
IdString optimization
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtlil.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 739b701f..c40af88a 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);