lean4-htt/src/library/compiler
Leonardo de Moura d98a1d1da3 feat(library/compiler/llnf): refine reset operation placement
This is not a perfect solution yet. I have identified two problems:
1) The heuristic used at `mark_to_reset_fields` is too weak.
   Suppose we have
   ```
      let ...
          _x := prod.mk field_1 0
      in some _x
   ```
   The current implementation will mark `field_1` to be reset since it
   occurs in a non tail call `prod.mk field_1 0`. However, we can
   assume `prod.mk field_1 0` is part of the return value.

2) The current semantics of the reset instruction may produce
   unnecessary memory allocation. Consider the following example
   ```
   let _x_1 := x.1,
       _x_2 := x.2,
       _x_3 := _reset.2 x
   in @bool.cases_on y
      (_cnstr.0.0)
      (let _x_4 := f _x_2,
       in _updt.2 _x_3 _x_4)
   ```
   The memory cell `_x_3` is only used in the second branch of
   the `bool.cases_on`. So, if `y` is `ff`, and `x` is a shared
   object, we will allocate memory at `_reset.2 x` for nothing.
2018-10-30 17:34:36 -07:00
..
CMakeLists.txt feat(library/compiler): replace simp_inductive with llnf 2018-10-29 13:07:46 -07:00
compiler.cpp feat(library/compiler): replace simp_inductive with llnf 2018-10-29 13:07:46 -07:00
compiler.h feat(library/compiler): new compiler entry point (skeleton) 2018-10-05 17:30:27 -07:00
cse.cpp fix(library/compiler): join point arity confusion 2018-10-20 18:18:41 -07:00
cse.h feat(library/compiler): new compiler entry point (skeleton) 2018-10-05 17:30:27 -07:00
csimp.cpp feat(library/compiler/csimp): nat.succ x ==> x + 1 2018-10-29 13:53:59 -07:00
csimp.h feat(library/compiler/csimp): float all cases 2018-10-25 15:41:11 -07:00
elim_dead_let.cpp feat(library/compiler): add cse to new compiler stack 2018-09-14 17:48:18 -07:00
elim_dead_let.h feat(library/compiler): new dead let removal 2018-09-14 08:41:55 -07:00
emit_bytecode.cpp feat(library/compiler/llnf): add reset.idx obj primitive 2018-10-30 13:48:09 -07:00
emit_bytecode.h feat(library/compiler/compiler): switch to new compiler frontend 2018-10-08 17:38:17 -07:00
erase_irrelevant.cpp feat(library/compiler/llnf): collect constructor info 2018-10-27 16:58:51 -07:00
erase_irrelevant.h feat(library/compiler): new compiler entry point (skeleton) 2018-10-05 17:30:27 -07:00
extract_closed.cpp fix(library/compiler/extract_closed): do not extract is_enf_unreachable 2018-10-29 14:41:12 -07:00
extract_closed.h feat(library/compiler): add extract_closed skeleton 2018-10-19 16:14:59 -07:00
init_module.cpp feat(library/compiler): replace simp_inductive with llnf 2018-10-29 13:07:46 -07:00
init_module.h
lambda_lifting.cpp feat(library/compiler): simplify again after lambda lifting 2018-10-19 15:17:07 -07:00
lambda_lifting.h feat(library/compiler/lambda_lifting): new lambda lifting 2018-10-08 15:04:59 -07:00
lcnf.cpp fix(library/compiler/lcnf): avoid unnecessary let-decl 2018-10-10 17:33:57 -07:00
lcnf.h feat(library/compiler): new compiler entry point (skeleton) 2018-10-05 17:30:27 -07:00
llnf.cpp feat(library/compiler/llnf): refine reset operation placement 2018-10-30 17:34:36 -07:00
llnf.h feat(library/compiler/llnf): add reset.idx obj primitive 2018-10-30 13:48:09 -07:00
procedure.h chore(library/compiler): simplify procedure class 2018-10-05 17:30:27 -07:00
specialize.cpp fix(library/compiler/specialize): assertion violation lean_assert(!has_fvar(code)); 2018-10-25 13:23:43 -07:00
specialize.h feat(library/compiler/specialize): code specialization 2018-10-16 15:50:42 -07:00
util.cpp feat(library/compiler/csimp): nat.succ x ==> x + 1 2018-10-29 13:53:59 -07:00
util.h feat(library/compiler/util): add is_runtime_builtin_cnstr 2018-10-27 17:09:12 -07:00