perf: during specialization, don't abstract all local fun decls under binders (#9596)

The `isUnderBinder` check is intended to avoid inlining repeated
computations into specializations, but this doesn’t apply to local
function decls whose bodies are already delayed.
This commit is contained in:
Cameron Zwarich 2025-07-28 10:36:43 -07:00 committed by GitHub
parent 0fe7cc8794
commit 475bd65c90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -136,7 +136,7 @@ mutual
if ctx.inScope fvarId then
/- We only collect the variables in the scope of the function application being specialized. -/
if let some funDecl ← findFunDecl? fvarId then
if ctx.isUnderBinder || ctx.abstract funDecl.fvarId then
if ctx.abstract funDecl.fvarId then
modify fun s => { s with params := s.params.push <| { funDecl with borrow := false } }
else
collectFunDecl funDecl