mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Avoid duplicated scans of CFuncs.
Trace into non-entry-point functions (most of them) at their call sites. We'll trace into entry-point functions (like eval) from their parent scope. We must trace eval_ to reach the tree of calls beneath it. Signed-off-by: Wilson Snyder <[email protected]>
This commit is contained in:
committed by
Wilson Snyder
parent
791d02a753
commit
631bda395d
+6
-1
@@ -288,6 +288,7 @@ private:
|
||||
LifeState* m_statep; // Current state
|
||||
bool m_sideEffect; // Side effects discovered in assign RHS
|
||||
bool m_noopt; // Disable optimization of variables in this block
|
||||
bool m_tracingCall; // Iterating into a CCall to a CFunc
|
||||
|
||||
// LIFE MAP
|
||||
// For each basic block, we'll make a new map of what variables that if/else is changing
|
||||
@@ -423,11 +424,14 @@ private:
|
||||
nodep->iterateChildren(*this);
|
||||
// Enter the function and trace it
|
||||
if (!nodep->funcp()->entryPoint()) { // else is non-inline or public function we optimize separately
|
||||
nodep->funcp()->accept(*this);
|
||||
m_tracingCall = true;
|
||||
nodep->funcp()->accept(*this);
|
||||
}
|
||||
}
|
||||
virtual void visit(AstCFunc* nodep) {
|
||||
//UINFO(4," CCALL "<<nodep<<endl);
|
||||
if (!m_tracingCall && !nodep->entryPoint()) return;
|
||||
m_tracingCall = false;
|
||||
if (nodep->dpiImport() && !nodep->pure()) {
|
||||
m_sideEffect = true; // If appears on assign RHS, don't ever delete the assignment
|
||||
}
|
||||
@@ -454,6 +458,7 @@ public:
|
||||
m_statep = statep;
|
||||
m_sideEffect = false;
|
||||
m_noopt = false;
|
||||
m_tracingCall = false;
|
||||
{
|
||||
m_lifep = new LifeBlock (NULL, m_statep);
|
||||
nodep->accept(*this);
|
||||
|
||||
Reference in New Issue
Block a user