Skip to content

Commit f0010d5

Browse files
committed
Liveness: Only perform topological sort on nodes reachable from root
1 parent 74314fc commit f0010d5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

libyul/backends/evm/SSACFGTopologicalSort.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ ForwardSSACFGTopologicalSort::ForwardSSACFGTopologicalSort(SSACFG const& _cfg):
2828
yulAssert(m_cfg.entry.value == 0);
2929
m_preOrder.reserve(m_cfg.numBlocks());
3030
m_postOrder.reserve(m_cfg.numBlocks());
31-
for (size_t id = 0; id < m_cfg.numBlocks(); ++id)
32-
{
33-
if (!m_explored[id])
34-
dfs(id);
35-
}
31+
dfs(0);
3632

3733
for (auto const& [v1, v2]: m_potentialBackEdges)
3834
if (ancestor(v2, v1))

0 commit comments

Comments
 (0)