forked from github/verilator
Fix huge case statement performance. Closes #1644.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
This commit is contained in:
parent
49db4d2b66
commit
c1fb938a61
2
Changes
2
Changes
@ -28,6 +28,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
|
||||
|
||||
**** Fix disable iff in assertions. Closes #1404. [Peter Monsson]
|
||||
|
||||
**** Fix huge case statement performance. Closes #1644. [Julien Margetts]
|
||||
|
||||
|
||||
* Verilator 4.024 2019-12-08
|
||||
|
||||
|
@ -210,7 +210,12 @@ private:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (m_caseItems <= 3) return false; // Not worth simplifying
|
||||
if (m_caseItems <= 3
|
||||
// Avoid e.g. priority expanders from going crazy in expansion
|
||||
|| (m_caseWidth >= 8 && (m_caseItems <= (m_caseWidth + 1)))) {
|
||||
return false; // Not worth simplifying
|
||||
}
|
||||
|
||||
// Convert valueItem from AstCaseItem* to the expression
|
||||
// Not done earlier, as we may now have a NULL because it's just a ";" NOP branch
|
||||
for (uint32_t i=0; i<(1UL<<m_caseWidth); ++i) {
|
||||
|
Loading…
Reference in New Issue
Block a user