1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-09 23:40:29 +02:00

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.
This commit is contained in:
Andy Wingo 2017-10-29 11:07:31 +01:00
parent 9d1235af96
commit 3ae245bc98

View file

@ -817,6 +817,9 @@
(letk kt* ($kargs () () ,t)) (letk kt* ($kargs () () ,t))
(letk kf* ($kargs () () ,f)) (letk kf* ($kargs () () ,f))
($ (convert-test test kt* kf*)))) ($ (convert-test test kt* kf*))))
(($ <const> src c)
(with-cps cps
(build-term ($continue (if c kt kf) src ($values ())))))
(_ (convert-arg cps test (_ (convert-arg cps test
(lambda (cps test) (lambda (cps test)
(with-cps cps (with-cps cps