1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 15:40:19 +02:00

Add primitive alias analysis to CSE

* module/language/cps/effects-analysis.scm (compute-known-allocations):
(compute-clobber-map): Add "conts" parameter, and use it to compute
primcalls that access known allocations.  A write to a known allocation
only clobbers a read to a known allocation if they are the same.
* module/language/cps/cse.scm (eliminate-common-subexpressions-in-fun):
Pass conts also to compute-clobber-map.
This commit is contained in:
Andy Wingo 2021-10-03 21:39:46 +02:00
parent 71e201d5c4
commit e60469c8b6
2 changed files with 72 additions and 5 deletions

View file

@ -735,7 +735,7 @@ for a label, it isn't known to be constant at that label."
;; post-order, so the intmap-fold will visit definitions before
;; uses.
(let* ((effects (synthesize-definition-effects (compute-effects conts)))
(clobbers (compute-clobber-map effects))
(clobbers (compute-clobber-map conts effects))
(succs (compute-successors conts kfun))
(preds (invert-graph succs))
(avail (compute-available-expressions succs kfun clobbers))