summaryrefslogtreecommitdiff
path: root/module/language/tree-il/optimize.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2024-03-13 13:11:14 +0100
committerAndy Wingo <wingo@pobox.com>2024-03-13 13:11:14 +0100
commitc758c99b5e37408e48dc1b22c73d6ec35d9de866 (patch)
tree7d47a5663ecbb30195e23e8773cecfc4c7265e86 /module/language/tree-il/optimize.scm
parente1690f3fd251d69b3687ec12c6f4b41034047f0f (diff)
downloadguile-c758c99b5e37408e48dc1b22c73d6ec35d9de866.tar.gz
New optimization: demux-lambda
Can help reduce case-lambda* / lambda* at Tree-IL optimization-time. * module/language/tree-il/demux-lambda.scm: New file. * am/bootstrap.am (SOURCES): Add new file. * module/language/tree-il/optimize.scm (make-optimizer): * module/system/base/optimize.scm (available-optimizations): Enable demux-lambda at level 2.
Diffstat (limited to 'module/language/tree-il/optimize.scm')
-rw-r--r--module/language/tree-il/optimize.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/module/language/tree-il/optimize.scm b/module/language/tree-il/optimize.scm
index b1d8b8294..11e0470be 100644
--- a/module/language/tree-il/optimize.scm
+++ b/module/language/tree-il/optimize.scm
@@ -1,6 +1,6 @@
;;; Tree-il optimizer
-;; Copyright (C) 2009, 2010-2015, 2018-2021 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2010-2015, 2018-2021, 2024 Free Software Foundation, Inc.
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -45,6 +45,7 @@
(letrectify (lookup #:letrectify? letrectify))
(seal? (assq-ref opts #:seal-private-bindings?))
(xinline? (assq-ref opts #:cross-module-inlining?))
+ (demux (lookup #:demux-lambda? demux-lambda))
(peval (lookup #:partial-eval? peval))
(eta-expand (lookup #:eta-expand? eta-expand))
(inlinables (lookup #:inlinable-exports? inlinable-exports)))
@@ -56,6 +57,7 @@
(run-pass! (resolve exp env))
(run-pass! (expand exp))
(run-pass! (letrectify exp #:seal-private-bindings? seal?))
+ (run-pass! (demux exp))
(run-pass! (fix-letrec exp))
(run-pass! (peval exp env #:cross-module-inlining? xinline?))
(run-pass! (eta-expand exp))