guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 05/25: Minor optimization in loop peeling


From: Andy Wingo
Subject: [Guile-commits] 05/25: Minor optimization in loop peeling
Date: Mon, 8 Jan 2018 09:25:02 -0500 (EST)

wingo pushed a commit to branch master
in repository guile.

commit 1bb44a1ad634c20046cd3de7fc41a1102be842a9
Author: Andy Wingo <address@hidden>
Date:   Sun Jan 7 13:00:31 2018 +0100

    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.
---
 module/language/cps/peel-loops.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/module/language/cps/peel-loops.scm 
b/module/language/cps/peel-loops.scm
index ec5cb5f..43e9869 100644
--- a/module/language/cps/peel-loops.scm
+++ b/module/language/cps/peel-loops.scm
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]