guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 15/30: DCE eliminates effect-free branches to the same c


From: Andy Wingo
Subject: [Guile-commits] 15/30: DCE eliminates effect-free branches to the same continuation
Date: Fri, 24 Nov 2017 09:24:21 -0500 (EST)

wingo pushed a commit to branch master
in repository guile.

commit a3173d17581efda4db96b19ade771f63096a84db
Author: Andy Wingo <address@hidden>
Date:   Tue Nov 21 21:46:08 2017 +0100

    DCE eliminates effect-free branches to the same continuation
    
    * module/language/cps/dce.scm (compute-live-code): Eliminate some
      branches.
---
 module/language/cps/dce.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/module/language/cps/dce.scm b/module/language/cps/dce.scm
index efead75..cbd12c1 100644
--- a/module/language/cps/dce.scm
+++ b/module/language/cps/dce.scm
@@ -173,8 +173,11 @@ sites."
           (or
            ;; No defs; perhaps continuation is $ktail.
            (not defs)
-           ;; We don't remove branches.
-           (match exp (($ $branch) #t) (_ #f))
+           ;; We don't remove branches, unless both branches go to the
+           ;; same place.
+           (match exp
+             (($ $branch kt) (not (eqv? k kt)))
+             (_ #f))
            ;; Do we have a live def?
            (any-var-live? defs live-vars)
            ;; Does this expression cause all effects?  If so, it's



reply via email to

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