guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] branch master updated: Change -O1 compiler to use baseli


From: Andy Wingo
Subject: [Guile-commits] branch master updated: Change -O1 compiler to use baseline and also resolve primitives
Date: Mon, 01 Jun 2020 15:17:05 -0400

This is an automated email from the git hooks/post-receive script.

wingo pushed a commit to branch master
in repository guile.

The following commit(s) were added to refs/heads/master by this push:
     new e2066d2  Change -O1 compiler to use baseline and also resolve 
primitives
e2066d2 is described below

commit e2066d2e639ecc81078e83fcd7acd8b75faf27a3
Author: Andy Wingo <wingo@pobox.com>
AuthorDate: Mon Jun 1 21:15:39 2020 +0200

    Change -O1 compiler to use baseline and also resolve primitives
    
    * bootstrap/Makefile.am (GUILE_OPTIMIZATIONS): Change to just -O1.
    * module/language/tree-il/spec.scm (choose-compiler): Use CPS for -O2
      and higher.
    * module/system/base/optimize.scm (available-optimizations): CPS for -O2
      and higher, but -Oresolve-primitives now at -O1 also.
---
 bootstrap/Makefile.am            |  7 +------
 module/language/tree-il/spec.scm |  2 +-
 module/system/base/optimize.scm  | 12 ++----------
 3 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/bootstrap/Makefile.am b/bootstrap/Makefile.am
index 6010f84..a4634c4 100644
--- a/bootstrap/Makefile.am
+++ b/bootstrap/Makefile.am
@@ -22,12 +22,7 @@
 
 
 GUILE_WARNINGS = -W0
-# Loading eval.go happens before boot and therefore before modules are
-# resolved.  For some reason if compiled without resolve-primitives,
-# attempts to resolve primitives at boot fail; weird.  Should fix this
-# but in the meantime we turn on primitive resolution (which normally
-# only happens at -O2).
-GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ono-cps
+GUILE_OPTIMIZATIONS = -O1
 
 include $(top_srcdir)/am/bootstrap.am
 
diff --git a/module/language/tree-il/spec.scm b/module/language/tree-il/spec.scm
index 511a2e2..05decf1 100644
--- a/module/language/tree-il/spec.scm
+++ b/module/language/tree-il/spec.scm
@@ -42,7 +42,7 @@
     (module-ref (resolve-interface `(language tree-il ,compiler)) compiler))
   (if (match (memq #:cps? opts)
         ((_ cps? . _) cps?)
-        (#f (<= 1 optimization-level)))
+        (#f (<= 2 optimization-level)))
       (cons 'cps (load-compiler 'compile-cps))
       (cons 'bytecode (load-compiler 'compile-bytecode))))
 
diff --git a/module/system/base/optimize.scm b/module/system/base/optimize.scm
index 3b056a5..6a88d7e 100644
--- a/module/system/base/optimize.scm
+++ b/module/system/base/optimize.scm
@@ -27,16 +27,8 @@
 (define* (available-optimizations #:optional lang-name)
   (match lang-name
     ('tree-il
-     ;; 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)
+     '((#:cps? 2)
+       (#:resolve-primitives? 1)
        (#:expand-primitives? 1)
        (#:letrectify? 2)
        (#:seal-private-bindings? 3)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]