File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -169,16 +169,17 @@ def lambdaLifting : Pass where
169169 decls.foldlM (init := #[]) fun decls decl => return decls ++ (← decl.lambdaLifting false (suffix := `_lam))
170170
171171/--
172- During eager lambda lifting, we lift
173- - All local function declarations from instances (motivation: make sure it is cheap to inline them later)
174- - Local function declarations that take local instances as parameters (motivation: ensure they are specialized)
172+ During eager lambda lifting, we inspect declarations that are not inlineable or instances (doing it
173+ everywhere can accidentally introduce mutual recursion which the compiler cannot handle well at the
174+ moment). We then lift local function declarations that take local instances as parameters from
175+ their body to ensure they are specialized.
175176-/
176177def eagerLambdaLifting : Pass where
177178 phase := .base
178179 name := `eagerLambdaLifting
179180 run := fun decls => do
180181 decls.foldlM (init := #[]) fun decls decl => do
181- if decl.inlineAttr || (← Meta.isInstance decl.name) then
182+ if decl.inlineable || (← Meta.isInstance decl.name) then
182183 return decls.push decl
183184 else
184185 return decls ++ (← decl.lambdaLifting (liftInstParamOnly := true ) (suffix := `_elam))
You can’t perform that action at this time.
0 commit comments