From b5b937e2f28ee2d5e7f055f880c5524375cb5b67 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Wed, 1 May 2024 16:22:56 +0100 Subject: [PATCH] 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. --- src/V3Delayed.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/V3Delayed.cpp b/src/V3Delayed.cpp index cb31f131e..ce198f953 100644 --- a/src/V3Delayed.cpp +++ b/src/V3Delayed.cpp @@ -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 {