1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 20:30:28 +02:00

Minor optimization in loop peeling

* module/language/cps/peel-loops.scm (compute-out-vars): Fold over the
  body of the loop, not the body of the function.  A small
  optimization.
This commit is contained in:
Andy Wingo 2018-01-07 13:00:31 +01:00
parent ef23e512b5
commit 1bb44a1ad6

View file

@ -126,13 +126,13 @@
(let ((live (compute-live-variables cps entry body succs)))
(intset-fold-right
cons
(intmap-fold (lambda (label succs live-out)
(if (intset-ref succs exit)
(intset-fold (lambda (label live-out)
(if (intset-ref (intmap-ref succs label) exit)
(if live-out
(intset-intersect live-out (intmap-ref live label))
(intmap-ref live label))
live-out))
succs #f)
body #f)
'())))
(define (rename-cont cont fresh-labels fresh-vars)