1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-29 22:40:34 +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. ;; Rely on identifier ordering.
(intset-fold (lambda (id out prev) (intset-fold (lambda (id out prev)
(values (values
(intmap-add out id (intset-intersect complex prev)) (intmap-add out id prev)
(intset-add prev id))) (if (intset-ref complex id)
(intset id)
prev)))
node-ids empty-intmap empty-intset) node-ids empty-intmap empty-intset)
empty-intmap)) empty-intmap))
(define sccs (define sccs