perf: fast path for SCC decomposition (#12009)

This commit is contained in:
Henrik Böving 2026-01-14 21:05:02 +01:00 committed by GitHub
parent dc70d0cc43
commit 2f7f63243f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,6 +36,8 @@ where
end SplitScc
public def splitScc (scc : Array Decl) : CompilerM (Array (Array Decl)) := do
if scc.size == 1 then
return #[scc]
let declMap := Std.HashMap.ofArray <| scc.map fun decl => (decl.name, decl)
let callers := Std.HashMap.ofArray <| ← scc.mapM fun decl => do
let calls ← SplitScc.findSccCalls declMap decl