1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 09:10:22 +02:00

Add new pass to optimize branch chains to table dispatch

* module/language/cps/switch.scm: New pass.

* module/Makefile.am (SOURCES):
* am/bootstrap.am (SOURCES): Add switch.scm.

* module/system/base/optimize.scm (available-optimizations):
* module/language/cps/optimize.scm (optimize-first-order-cps): Run
  switch optimization at level 2.

* libguile/hash.c (JENKINS_LOOKUP3_HASHWORD2): Add note regarding
  cross-compilation.

* module/language/cps/graphs.scm (intmap-select): New definition.
* module/language/cps/utils.scm (compute-singly-referenced-labels): Move
  here, from various places.  Doesn't take a body intset argument.

* module/language/cps/contification.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/simplify.scm: Use compute-singly-referenced-labels
  from utils.

* module/language/cps/effects-analysis.scm (annotation->memory-kind*):
  (annotation->memory-kind): Add symbol annotation cases.
This commit is contained in:
Andy Wingo 2020-08-11 23:09:51 +02:00
parent cd5ab6377b
commit 03998db647
13 changed files with 488 additions and 98 deletions

View file

@ -34,6 +34,7 @@
intmap-keys
invert-bijection invert-partition
intset->intmap
intmap-select
worklist-fold
fixpoint
@ -99,6 +100,12 @@ disjoint, an error will be signalled."
(intmap-add! preds label (f label)))
set empty-intmap)))
(define (intmap-select map set)
(persistent-intmap
(intset-fold (lambda (label out)
(intmap-add! out label (intmap-ref map label)))
set empty-intmap)))
(define worklist-fold
(case-lambda
((f in out)