mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-13 15:10:34 +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:
parent
0912202a51
commit
545274a035
1 changed files with 45 additions and 41 deletions
|
@ -881,6 +881,7 @@ BODY for each body continuation in the prompt."
|
||||||
(define (compute-label-and-var-ranges fun global?)
|
(define (compute-label-and-var-ranges fun global?)
|
||||||
(define (min* a b)
|
(define (min* a b)
|
||||||
(if b (min a b) a))
|
(if b (min a b) a))
|
||||||
|
(define-syntax-rule (do-fold global?)
|
||||||
((make-cont-folder global?
|
((make-cont-folder global?
|
||||||
min-label max-label label-count
|
min-label max-label label-count
|
||||||
min-var max-var var-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)))))
|
min-var max-var var-count)))))
|
||||||
fun
|
fun
|
||||||
#f -1 0 #f -1 0))
|
#f -1 0 #f -1 0))
|
||||||
|
(if global?
|
||||||
|
(do-fold #t)
|
||||||
|
(do-fold #f)))
|
||||||
|
|
||||||
(define* (compute-dfg fun #:key (global? #t))
|
(define* (compute-dfg fun #:key (global? #t))
|
||||||
(call-with-values (lambda () (compute-label-and-var-ranges fun global?))
|
(call-with-values (lambda () (compute-label-and-var-ranges fun global?))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue