more aggressive type propagation for local functions' parameter types
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
The following example
(defun foo (x fn)
(declare (optimize speed))
(declare (function fn))
(labels ((recurse (x fn)
(if (atom x)
(recurse x fn)))
will generate the following note
; note: unable to
; optimize
; because:
; optimize away possible call to FDEFINITION at runtime
PKhuong said on #lisp that is due to SBCL's conversatism regaring type
propagation: It assumes the top type and tries to refine that to more exact
type:
<pkhuong> tcr: our propagation pass is conservative (primal, we keep
work, we'd need to use another paradigm, with a dual
dead variable analysis (primal induction), versus the
right way (assume everything is dead and find
status confirmed
tag optimization
importance wishlist
done