summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2025-01-22 16:51:28 +0100
committerAndy Wingo <wingo@pobox.com>2025-01-22 16:51:28 +0100
commit4a6347c3718478e3a41647f4aad71e2df6c024de (patch)
tree9f658a2e764a8187f4ecde5cf02bdc674737e78f /module
parent47dce42edb3d158d6a71eb4da8421287b88c9ef1 (diff)
downloadguile-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.scm6
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