DFG: run removeVars after CSE

This enables removing some more redundant variables.
This commit is contained in:
Geza Lore 2022-10-06 09:31:53 +01:00
parent a83043d735
commit 5b742571d3

View File

@ -188,8 +188,8 @@ void V3DfgPasses::optimize(DfgGraph& dfg, V3DfgOptimizationContext& ctx) {
if (v3Global.opt.fDfgPeephole()) {
apply(4, "peephole ", [&]() { peephole(dfg, ctx.m_peepholeContext); });
// Without peephole no variables will be redundant, and we just did CSE, so skip these
apply(4, "removeVars ", [&]() { removeVars(dfg, ctx.m_removeVarsContext); });
apply(4, "cse ", [&]() { cse(dfg, ctx.m_cseContext1); });
apply(4, "removeVars ", [&]() { removeVars(dfg, ctx.m_removeVarsContext); });
}
apply(3, "optimized ", [&]() { removeUnused(dfg); });
if (dumpDfg() >= 8) dfg.dumpDotAllVarConesPrefixed(ctx.prefix() + "optimized");