diff options
author | Andy Wingo <wingo@pobox.com> | 2025-01-22 16:51:28 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2025-01-22 16:51:28 +0100 |
commit | 4a6347c3718478e3a41647f4aad71e2df6c024de (patch) | |
tree | 9f658a2e764a8187f4ecde5cf02bdc674737e78f /module | |
parent | 47dce42edb3d158d6a71eb4da8421287b88c9ef1 (diff) | |
download | guile-4a6347c3718478e3a41647f4aad71e2df6c024de.tar.gz |
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.
Diffstat (limited to 'module')
-rw-r--r-- | module/language/tree-il/fix-letrec.scm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/module/language/tree-il/fix-letrec.scm b/module/language/tree-il/fix-letrec.scm index f7811f95e..38c1c0282 100644 --- a/module/language/tree-il/fix-letrec.scm +++ b/module/language/tree-il/fix-letrec.scm @@ -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 |