summaryrefslogtreecommitdiff
path: root/module/language/tree-il/optimize.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2020-05-11 15:38:36 +0200
committerAndy Wingo <wingo@pobox.com>2020-05-11 15:42:20 +0200
commitb5108ccb2a1e02ba7182be81b746ad86d31cb419 (patch)
tree2eb502a801306bdbba2f8f3396ebf704d834bb9b /module/language/tree-il/optimize.scm
parenta68c80c747a2a8ec92fa84684ebd60b4ecb7ffa0 (diff)
downloadguile-b5108ccb2a1e02ba7182be81b746ad86d31cb419.tar.gz
Avoid having "guild compile" load optimizers
* module/language/cps/optimize.scm (cps-optimizations): * module/language/tree-il/optimize.scm (tree-il-optimizations): * module/system/base/optimize.scm (available-optimizations): Invert the dependency tree to hold the names and default optimization levels in a central place instead of in the optimizers. It moves definitions farther from uses, but it avoids us having to load the CPS optimizer if we don't need it, which improves bootstrap times.
Diffstat (limited to 'module/language/tree-il/optimize.scm')
-rw-r--r--module/language/tree-il/optimize.scm17
1 files changed, 2 insertions, 15 deletions
diff --git a/module/language/tree-il/optimize.scm b/module/language/tree-il/optimize.scm
index f4a5b4db1..6c64e17c1 100644
--- a/module/language/tree-il/optimize.scm
+++ b/module/language/tree-il/optimize.scm
@@ -27,6 +27,7 @@
#:use-module (language tree-il peval)
#:use-module (language tree-il primitives)
#:use-module (ice-9 match)
+ #:use-module (system base optimize)
#:export (optimize
make-lowerer
tree-il-optimizations))
@@ -62,21 +63,7 @@
x)
(define (tree-il-optimizations)
- ;; Avoid resolve-primitives until -O2, when CPS optimizations kick in.
- ;; Otherwise, inlining the primcalls during Tree-IL->CPS compilation
- ;; will result in a lot of code that will never get optimized nicely.
- ;; Similarly letrectification is great for generated code quality, but
- ;; as it gives the compiler more to work with, it increases compile
- ;; time enough that we reserve it for -O2. Also, this makes -O1 avoid
- ;; assumptions about top-level values, in the same way that avoiding
- ;; resolve-primitives does.
- '((#:cps? 1)
- (#:resolve-primitives? 2)
- (#:expand-primitives? 1)
- (#:letrectify? 2)
- (#:seal-private-bindings? 3)
- (#:partial-eval? 1)
- (#:eta-expand? 2)))
+ (available-optimizations 'tree-il))
(define (make-lowerer optimization-level opts)
(define (enabled-for-level? level) (<= level optimization-level))