This PR ports the expand reset/reuse pass from IR to LCNF. In addition it prevents exponential code generation unlike the old one. This results in a ~15% decrease in binary size and slight speedups across the board. The change also removes the "is this reset actually used" syntactic approximation as the previous passes guarantee (at the moment) that all uses are in the continuation and will thus be caught by this.
7 lines
157 B
Text
7 lines
157 B
Text
|
|
set_option trace.Compiler.saveMono true
|
|
|
|
def g (ys : List Nat) : IO Nat := do
|
|
let x := 0
|
|
let (_, x) ← StateT.run (ys.forM fun y => IO.println y) x
|
|
pure x
|