Fix missed optimization in V3Delayed (#5089)

Checking the wrong node meant we never actually pushed constant
bit-select indices into the delayed update, as was the intention, but
always generated a temporary instead.
This commit is contained in:
Geza Lore 2024-05-01 16:22:56 +01:00 committed by GitHub
parent 4a41f69293
commit b5b937e2f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -277,7 +277,7 @@ class DelayedVisitor final : public VNVisitor {
AstNodeExpr* bitreadp = nullptr; // Code to read Vdlyvlsb
if (bitselp) {
AstNodeExpr* const lsbvaluep = bitselp->lsbp()->unlinkFrBack();
if (VN_IS(bitselp->fromp(), Const)) {
if (VN_IS(lsbvaluep, Const)) {
// vlsb = constant, can just push constant into where we use it
bitreadp = lsbvaluep;
} else {