[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
- [Guile-commits] branch master updated (9d1235a -> d1c69b5), Andy Wingo, 2017/10/29
- [Guile-commits] 01/11: Minor optimization compiling 'and',
Andy Wingo <=
- [Guile-commits] 08/11: Add untag-fixnum instruction, Andy Wingo, 2017/10/29
- [Guile-commits] 10/11: Inline u64/scm comparisons, Andy Wingo, 2017/10/29
- [Guile-commits] 02/11: Rename "number" tag to "heap-number", Andy Wingo, 2017/10/29
- [Guile-commits] 03/11: Simplify lowering of branching primcalls to CPS, Andy Wingo, 2017/10/29
- [Guile-commits] 11/11: Remove compiler support for u64-scm comparisons, Andy Wingo, 2017/10/29
- [Guile-commits] 05/11: Lower eqv? and equal? to new instructions., Andy Wingo, 2017/10/29
- [Guile-commits] 04/11: Add missing compiler support for heap-object? primcall et al., Andy Wingo, 2017/10/29
- [Guile-commits] 07/11: Add compiler support for fixnum? primcall predicate, Andy Wingo, 2017/10/29
- [Guile-commits] 06/11: Add compiler support for s64 comparisons., Andy Wingo, 2017/10/29
- [Guile-commits] 09/11: Add hacks around lack of allocation sinking, Andy Wingo, 2017/10/29