fix: erase code of an erased type in LCNF simp (#8712)
This PR optimizes let decls of an erased type to an erased value. Specialization can create local functions that produce a Prop, and there's no point in keeping them around.
This commit is contained in:
parent
c53ab2835c
commit
0b2884bfa3
1 changed files with 3 additions and 0 deletions
|
|
@ -224,6 +224,9 @@ partial def simp (code : Code) : SimpM Code := withIncRecDepth do
|
|||
let mut decl ← normLetDecl baseDecl
|
||||
if baseDecl != decl then
|
||||
markSimplified
|
||||
if decl.type.isErased && decl.value != .erased then
|
||||
markSimplified
|
||||
decl ← decl.updateValue .erased
|
||||
if let some value ← simpValue? decl.value then
|
||||
markSimplified
|
||||
decl ← decl.updateValue value
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue