1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

Optimize ordering edges in fix-letrec

* module/language/tree-il/fix-letrec.scm (compute-sccs): Instead of
depending on all previous complex bindings, we can just depend on the
most recent one.  Decreases the graph size.
This commit is contained in:
Andy Wingo 2025-01-22 16:51:28 +01:00
parent 47dce42edb
commit 4a6347c371

View file

@ -221,8 +221,10 @@ code to sort letrec* bindings by identifier value."
;; Rely on identifier ordering.
(intset-fold (lambda (id out prev)
(values
(intmap-add out id (intset-intersect complex prev))
(intset-add prev id)))
(intmap-add out id prev)
(if (intset-ref complex id)
(intset id)
prev)))
node-ids empty-intmap empty-intset)
empty-intmap))
(define sccs