If param is referenced in a loop (but defined outside) do not inline function into the loop

This commit is contained in:
Justin Ethier 2018-05-24 16:37:04 -04:00
parent a2aa321356
commit be25f055f0

View file

@ -864,6 +864,10 @@
(with-var param (lambda (var)
;(trace:error `(DEBUG ,param ,(adbv:ref-by var)))
(and
;; If param is referenced in a loop (but defined outside)
;; do not inline function into the loop
(or (not (adbv:ref-in-loop? var))
(adbv:def-in-loop? var))
;; If param is never referenced, then prim is being
;; called for side effects, possibly on a global
(not (null? (adbv:ref-by var)))