mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-03 05:20:16 +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
|
(or
|
||||||
;; No defs; perhaps continuation is $ktail.
|
;; No defs; perhaps continuation is $ktail.
|
||||||
(not defs)
|
(not defs)
|
||||||
;; We don't remove branches.
|
;; We don't remove branches, unless both branches go to the
|
||||||
(match exp (($ $branch) #t) (_ #f))
|
;; same place.
|
||||||
|
(match exp
|
||||||
|
(($ $branch kt) (not (eqv? k kt)))
|
||||||
|
(_ #f))
|
||||||
;; Do we have a live def?
|
;; Do we have a live def?
|
||||||
(any-var-live? defs live-vars)
|
(any-var-live? defs live-vars)
|
||||||
;; Does this expression cause all effects? If so, it's
|
;; Does this expression cause all effects? If so, it's
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue