1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-12 06:41:13 +02:00

Speed up compute-label-and-var-ranges

* module/language/cps/dfg.scm (compute-label-and-var-ranges): Duplicate
  the cont-folder cases in the global/not-global cases.  Lets the
  optimizer DTRT.
This commit is contained in:
Andy Wingo 2014-04-01 18:20:02 +02:00
parent 0912202a51
commit 545274a035

View file

@ -881,6 +881,7 @@ BODY for each body continuation in the prompt."
(define (compute-label-and-var-ranges fun global?)
(define (min* a b)
(if b (min a b) a))
(define-syntax-rule (do-fold global?)
((make-cont-folder global?
min-label max-label label-count
min-var max-var var-count)
@ -922,6 +923,9 @@ BODY for each body continuation in the prompt."
min-var max-var var-count)))))
fun
#f -1 0 #f -1 0))
(if global?
(do-fold #t)
(do-fold #f)))
(define* (compute-dfg fun #:key (global? #t))
(call-with-values (lambda () (compute-label-and-var-ranges fun global?))