1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-15 08:10:17 +02:00

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.
This commit is contained in:
Andy Wingo 2024-03-13 13:11:14 +01:00
parent e1690f3fd2
commit c758c99b5e
4 changed files with 131 additions and 3 deletions

View file

@ -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))