From b976b8dac98972549ca33384c7a33cfbc6654efd Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 6 Jun 2021 22:09:30 -0400 Subject: [PATCH] Fix slowdown in elaboration (#2911). --- Changes | 1 + src/V3Width.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 0bc065689..ecf0750f9 100644 --- a/Changes +++ b/Changes @@ -25,6 +25,7 @@ Verilator 4.203 devel * Fix assertion failure in bitOpTree optimization (#2891) (#2899). [Raynard Qiao] * Fix DPI functions not seen as vpiModule (#2893). [Todd Strader] * Fix bounds check in VL_SEL_IWII (#2910). [Krzysztof Bieganski] +* Fix slowdown in elaboration (#2911). [Nathan Graybeal] * Fix initialization of assoc in assoc array (#2914). [myftptoyman] * Fix make support for gmake 3.x (#2920) (#2921). [Philipp Wagner] * Fix VPI memory access for packed arrays (#2922). [Todd Strader] diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 22e15d1c7..08204e1d0 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -492,7 +492,7 @@ private: // signed: Unsigned (11.8.1) // width: LHS + RHS AstNodeDType* vdtypep = m_vup->dtypeNullSkipRefp(); - userIterateAndNext(vdtypep, WidthVP(SELF, BOTH).p()); + userIterate(vdtypep, WidthVP(SELF, BOTH).p()); if (VN_IS(vdtypep, QueueDType)) { // Queue "element 0" is lhsp, so we need to swap arguments auto* newp = new AstConsQueue(nodep->fileline(), nodep->rhsp()->unlinkFrBack(), @@ -2457,7 +2457,7 @@ private: AstNodeDType* fromDtp = nodep->fromp()->dtypep()->skipRefToEnump(); AstBasicDType* basicp = fromDtp ? fromDtp->basicp() : nullptr; UINFO(9, " from dt " << fromDtp << endl); - userIterateAndNext(fromDtp, WidthVP(SELF, BOTH).p()); + userIterate(fromDtp, WidthVP(SELF, BOTH).p()); if (AstEnumDType* adtypep = VN_CAST(fromDtp, EnumDType)) { methodCallEnum(nodep, adtypep); } else if (AstAssocArrayDType* adtypep = VN_CAST(fromDtp, AssocArrayDType)) { @@ -3310,7 +3310,9 @@ private: while (const AstConstDType* vdtypep = VN_CAST(dtypep, ConstDType)) { dtypep = vdtypep->subDTypep()->skipRefp(); } - userIterateAndNext(dtypep, WidthVP(SELF, BOTH).p()); + + userIterate(dtypep, WidthVP(SELF, BOTH).p()); + if (auto* vdtypep = VN_CAST(dtypep, NodeUOrStructDType)) { VL_DO_DANGLING(patternUOrStruct(nodep, vdtypep, defaultp), nodep); } else if (auto* vdtypep = VN_CAST(dtypep, NodeArrayDType)) {