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:
parent
b2dc53a3e2
commit
a3173d1758
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue