guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 01/11: Minor optimization compiling 'and'


From: Andy Wingo
Subject: [Guile-commits] 01/11: Minor optimization compiling 'and'
Date: Sun, 29 Oct 2017 16:05:00 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit 3ae245bc989b0d418c49e47a6ab8c41b5a669513
Author: Andy Wingo <address@hidden>
Date:   Sun Oct 29 11:07:31 2017 +0100

    Minor optimization compiling 'and'
    
    * module/language/tree-il/compile-cps.scm (convert): Fold test of
      constants directly to their branches without reifying booleans, to
      simplify "and" chains early.
---
 module/language/tree-il/compile-cps.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/module/language/tree-il/compile-cps.scm 
b/module/language/tree-il/compile-cps.scm
index cc5f9c5..1f72582 100644
--- a/module/language/tree-il/compile-cps.scm
+++ b/module/language/tree-il/compile-cps.scm
@@ -817,6 +817,9 @@
             (letk kt* ($kargs () () ,t))
             (letk kf* ($kargs () () ,f))
             ($ (convert-test test kt* kf*))))
+         (($ <const> src c)
+          (with-cps cps
+            (build-term ($continue (if c kt kf) src ($values ())))))
          (_ (convert-arg cps test
               (lambda (cps test)
                 (with-cps cps



reply via email to

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