mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Internals: Do not optimize variables with RW refs in Dfg
This commit is contained in:
@@ -145,6 +145,7 @@ class AstToDfgConverter final : public VNVisitor {
|
||||
// Returns {nullptr, 0}, if the given LValue expression is not supported.
|
||||
std::pair<DfgVertexSplice*, uint32_t> convertLValue(AstNodeExpr* nodep) {
|
||||
if (const AstVarRef* const vrefp = VN_CAST(nodep, VarRef)) {
|
||||
UASSERT_OBJ(vrefp->access().isWriteOnly(), vrefp, "Non-WriteOnly reference");
|
||||
if (!isSupported(vrefp)) {
|
||||
++m_ctx.m_conv.nonRepLValue;
|
||||
return {nullptr, 0};
|
||||
@@ -366,7 +367,8 @@ class AstToDfgConverter final : public VNVisitor {
|
||||
UASSERT_OBJ(!nodep->user2p(), nodep, "Already has Dfg vertex");
|
||||
if (unhandled(nodep)) return;
|
||||
// This visit method is only called on RValues, where only read refs are supported
|
||||
if (!nodep->access().isReadOnly() || !isSupported(nodep)) {
|
||||
UASSERT_OBJ(nodep->access().isReadOnly(), nodep, "Non-ReadOnly reference");
|
||||
if (!isSupported(nodep)) {
|
||||
m_foundUnhandled = true;
|
||||
++m_ctx.m_conv.nonRepVarRef;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user