lean4-htt/tests/elab/spec_issue.lean
Henrik Böving d88ac25bd1
feat: non exponential codegen for reset-reuse (#12665)
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.
2026-02-26 09:35:45 +00:00

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