1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 21:10:27 +02:00

DCE eliminates effect-free branches to the same continuation

* module/language/cps/dce.scm (compute-live-code): Eliminate some
  branches.
This commit is contained in:
Andy Wingo 2017-11-21 21:46:08 +01:00
parent b2dc53a3e2
commit a3173d1758

View file

@ -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