mirror of
https://github.com/verilator/verilator.git
synced 2026-09-04 16:40:12 +02:00
Optimize generated function inlining (#7811)
Previously V3InlineCFuncs inlined call sites but never deleted the now dead callees. Also missed a lot of opportunities due to evaluation order. Rewrite using a graph based algorithm, using only a single traversal of the netlist. This is clearer, more accurate, and faster at compile time. Also add a clean -fno-inline-cfuncs disable. Setting the limits to 0 still disables inlining, except of empty functions, which can be inlined with 0 limits (they are no ops). It will also prune unused functions without -fno-inline-cfuncs. Pass now also respects `--output-split`
This commit is contained in:
@@ -1497,6 +1497,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc,
|
||||
m_fIcoChangeDetect.setTrueOrFalse(flag);
|
||||
});
|
||||
DECL_OPTION("-finline", FOnOff, &m_fInline);
|
||||
DECL_OPTION("-finline-cfuncs", FOnOff, &m_fInlineCFuncs);
|
||||
DECL_OPTION("-finline-funcs", FOnOff, &m_fInlineFuncs);
|
||||
DECL_OPTION("-finline-funcs-eager", FOnOff, &m_fInlineFuncsEager);
|
||||
DECL_OPTION("-flife", FOnOff, &m_fLife);
|
||||
@@ -2371,6 +2372,7 @@ void V3Options::optimize(int level) {
|
||||
m_fExpand = flag;
|
||||
m_fGate = flag;
|
||||
m_fInline = flag;
|
||||
m_fInlineCFuncs = flag;
|
||||
m_fLife = flag;
|
||||
m_fLifePost = flag;
|
||||
m_fLocalize = flag;
|
||||
|
||||
Reference in New Issue
Block a user