mirror of
https://github.com/verilator/verilator.git
synced 2026-10-02 16:13:34 +02:00
Optimize Dfg synthesis of simple continuous assignments (#8286)
This commit is contained in:
@@ -268,7 +268,7 @@ class AstToDfgConverter final : public VNVisitor {
|
||||
};
|
||||
|
||||
// Simplify the LHS, to get rid of things like SEL(CONCAT(_, _), _)
|
||||
lhsp = VN_AS(V3Const::constifyExpensiveEdit(lhsp), NodeExpr);
|
||||
if (!VN_IS(lhsp, VarRef)) lhsp = VN_AS(V3Const::constifyExpensiveEdit(lhsp), NodeExpr);
|
||||
|
||||
// Assigning compound expressions to a concatenated LHS requires a temporary
|
||||
// to avoid multiple use of the expression
|
||||
@@ -1593,11 +1593,6 @@ class AstToDfgSynthesize final {
|
||||
bool synthesizeAssignW(AstAssignW* nodep) {
|
||||
++m_ctx.m_synt.inputAssign;
|
||||
|
||||
// Construct an equivalent AstAssign
|
||||
AstNodeExpr* const lhsp = nodep->lhsp()->cloneTree(false);
|
||||
AstNodeExpr* const rhsp = nodep->rhsp()->cloneTree(false);
|
||||
AstAssign* const assignp = new AstAssign{nodep->fileline(), lhsp, rhsp};
|
||||
|
||||
// The input and output symbol tables
|
||||
SymTab iSymTab;
|
||||
SymTab oSymTab;
|
||||
@@ -1607,10 +1602,8 @@ class AstToDfgSynthesize final {
|
||||
|
||||
// Synthesize as if it was in a single CfgBlock CFG
|
||||
DfgVertex* condp = nullptr;
|
||||
const bool success = synthesizeBasicBlock(oSymTab, condp, {assignp}, iSymTab);
|
||||
const bool success = synthesizeBasicBlock(oSymTab, condp, {nodep}, iSymTab);
|
||||
UASSERT_OBJ(!condp, nodep, "Conditional AstAssignW ???");
|
||||
// Delete auxiliary AstAssign
|
||||
VL_DO_DANGLING(assignp->deleteTree(), assignp);
|
||||
if (!success) return false;
|
||||
|
||||
// Check exernal writes are observed correctly
|
||||
|
||||
Reference in New Issue
Block a user