Commit graph

100 commits

Author SHA1 Message Date
Leonardo de Moura
6defbf82bd feat(library/init/lean/compiler/ir): add meta data, fix names and declarations
cc @kha
2019-03-06 06:56:16 -08:00
Leonardo de Moura
e067d82ab3 fix(library/compiler/llnf): nasty bug at explicit_rc_fn
@kha I found this nasty bug today after I tried a small modification
at lean.parser.token. It is crazy that it didn't manifest itself before.
2019-03-04 15:39:21 -08:00
Leonardo de Moura
f556423ae2 chore(library/compiler/llnf): add TODO 2019-02-25 17:43:21 -08:00
Leonardo de Moura
2ff3899d62 fix(library/compiler/llnf): missing case at push_proj_fn
We were not pushing projections over scalar projections.
2019-02-24 15:39:53 -08:00
Leonardo de Moura
d23216e3ee fix(library/compiler/llnf): bug at explicit_rc_fn 2019-02-22 16:01:52 -08:00
Leonardo de Moura
b1b75c7c2e feat(library/compiler): borrow inference procedure 2019-02-22 15:23:42 -08:00
Leonardo de Moura
ba43d355b7 feat(library/compiler): add borrowed annotation inference skeleton 2019-02-22 11:14:38 -08:00
Leonardo de Moura
01922794c5 fix(library/compiler/llnf): mk_boxed_version must take care of borrowed arguments and result 2019-02-22 10:18:17 -08:00
Leonardo de Moura
ac9e37ed86 feat(library/compiler/llnf): we postpone the simplification of 1-reachable and all-eq cases_on expressions
Reason: the `cases_on`-expressions are used to guide
`insert_reset_reuse_fn`. The new `simp_cases` simplifier applies the
1-reachable and all-eq cases_on expression simplifications after
`insert_reset_reuse_fn` is executed.
2019-02-20 17:00:50 -08:00
Leonardo de Moura
35adf5f540 feat(library/compiler/llnf): avoid unfruitful reuse instruction replacements 2019-02-20 16:34:46 -08:00
Leonardo de Moura
54a89dabb7 feat(library/compiler/llnf): new reset/reuse insertion procedure 2019-02-20 16:12:58 -08:00
Leonardo de Moura
937b947938 feat(library/compiler/llnf): decorate _cnstr instruction with inductive type name 2019-02-20 14:45:35 -08:00
Leonardo de Moura
b8cee758a5 feat(library/compiler/llnf): add push_proj_fn 2019-02-20 13:20:27 -08:00
Leonardo de Moura
2f218f7ec0 refactor(library/compiler/llnf): remove reset/reuse insertion from to_llnf_fn
`to_llnf_fn` now produces an IR similar to the \lambda_pure in our paper.
2019-02-20 11:16:29 -08:00
Leonardo de Moura
75ad042c66 feat(library/compiler/llnf): improve reuse/reset insertion
It is now closer to the procedure at reuse.txt
2019-02-19 22:14:29 -08:00
Leonardo de Moura
00aa78fffc feat(library/compiler/llnf): given y := _unbox.n x, mark x as an unboxed scalar if n < sizeof(void*) 2019-02-18 20:52:02 -08:00
Leonardo de Moura
feea8ecccd feat(library/compiler/llnf): avoid inc/dec operations on persistent objects
inc/dec operations are noop's for persistent objects.
2019-02-18 20:22:18 -08:00
Leonardo de Moura
243d7c08e3 feat(library/compiler/llnf): avoid inc and dec operations on (boxed) small nat literals 2019-02-17 07:31:14 -08:00
Leonardo de Moura
3c60af74ae feat(library/compiler/llnf): avoid inc and dec instructions on neutral elements 2019-02-17 07:17:54 -08:00
Leonardo de Moura
78440919e8 feat(library/compiler/llnf): avoid unnecessary inc x and dec x instructions
Example:
```
x = lean::box(0);
...
lean::inc(x);
...
lean::inc(x);
...
lean::dec(x);
...
```
In the example above, the `inc` and `dec` operations are unnecessary
since `x` is known to be a (boxed) scalar value. This commit fixes this.
2019-02-17 06:50:25 -08:00
Leonardo de Moura
221704900a feat(library/compiler/llnf): avoid inc x and dec x instructions in branches where x is known to be a scalar value 2019-02-17 06:25:00 -08:00
Leonardo de Moura
38c7ec133d fix(library/compiler/llnf): missing case 2019-02-15 17:51:08 -08:00
Leonardo de Moura
d4dce78b0e chore(library/compiler): delete compiler/builtin module
It has been replaced with `compiler/extern_attribute`
2019-02-12 18:23:09 -08:00
Leonardo de Moura
57411ed039 refactor(library/compiler/extern_attribute): new interface 2019-02-11 12:48:37 -08:00
Max Wagner
e663f75fb2 chore(library/compiler): move builtins into the environment 2019-02-08 09:56:03 -08:00
Leonardo de Moura
ba449aa9f4 chore(library/compiler/llnf): fix compilation warning 2019-02-07 15:02:26 -08:00
Leonardo de Moura
d103ff70fe feat(library/compiler): avoid cnstr_set_scalar when possible 2019-02-06 10:49:58 -08:00
Sebastian Ullrich
34110945f2 refactor(library/compiler/llnf): replace is_runtime_builtin_cnstr with just is_builtin_constant 2019-02-06 09:35:16 -08:00
Leonardo de Moura
3444a295e7 feat(library/compiler,runtime): builtin support for lean.name 2019-02-05 12:57:46 -08:00
Leonardo de Moura
4d66836255 fix(library/compiler/llnf): bug at process_cases
We should not decrement the RC of borrowed variables.
2019-02-04 12:51:51 -08:00
Leonardo de Moura
65e7e785ff fix(library/compiler/llnf): include closures at is_unboxed 2019-02-03 10:04:21 -08:00
Leonardo de Moura
90499abd94 fix(library/compiler/llnf): inc is only needed if variable has type _obj 2019-02-01 17:53:58 -08:00
Leonardo de Moura
d461833fcd fix(library/compiler/llnf): _sset and _uset were taking invalid LLNF arguments 2019-02-01 14:31:08 -08:00
Leonardo de Moura
3af0d91bbb fix(library/compiler/llnf): missing cases at explicit_boxing_fn 2019-01-31 18:16:36 -08:00
Leonardo de Moura
ddc5cf05c4 fix(library/compiler/llnf): user numeric literals to store enum type values in LLNF 2019-01-31 17:58:03 -08:00
Leonardo de Moura
7a322340cb fix(library/compiler/llnf): in LLNF, the _box.n argument must be a variable 2019-01-31 17:54:06 -08:00
Leonardo de Moura
39f45beec0 chore(library/compiler/llnf): fix typo 2019-01-31 17:52:59 -08:00
Leonardo de Moura
0f47787a06 fix(library/compiler/llnf): remove bad optimization
It may destroy boxed value information. Moreover, we want
terminals to be jmp, variable or cases.
2019-01-31 17:52:28 -08:00
Leonardo de Moura
4166851574 feat(library/compiler/emit_cpp): emit_box and emit_unbox 2019-01-31 16:16:30 -08:00
Leonardo de Moura
80754e84c5 feat(library/compiler/emit_cpp): emit_closure 2019-01-31 15:06:04 -08:00
Leonardo de Moura
909a8d7c6d fix(library/compiler/llnf): bug at to_llnf when boxing is enabled 2019-01-30 16:48:04 -08:00
Leonardo de Moura
9f8760d936 fix(library/compiler/llnf): LLNF terminal is variable, jmp, or cases 2019-01-29 14:59:12 -08:00
Leonardo de Moura
61e51ba402 fix(library/compiler/llnf): adjust code, now type must match arity
We recently modified the type of closures in LLNF.
This commit fixes a mismatch.
2019-01-28 15:55:01 -08:00
Leonardo de Moura
d3756fd915 feat(library/compiler): add _void type for LLNF format 2019-01-28 13:06:25 -08:00
Leonardo de Moura
2016e1bce5 feat(library/compiler/llnf): unique names for lambda arguments 2019-01-25 14:26:32 -08:00
Leonardo de Moura
8bcc965dc0 feat(library/compiler): make sure we emit bytecode and C++ 2019-01-23 14:13:04 -08:00
Leonardo de Moura
fe68547086 fix(library/compiler/llnf): missing instruction _uproj at explicit_rc_fn 2019-01-18 16:00:08 -08:00
Leonardo de Moura
aaf1966a87 fix(library/compiler/llnf): explicit boxing should treat variables with function type (e.g., _obj -> _obj) as _obj 2019-01-18 15:07:01 -08:00
Leonardo de Moura
9ea7b77fe0 fix(library/compiler/llnf): typo 2019-01-17 17:10:52 -08:00
Leonardo de Moura
1d0d17d4ae fix(library/compiler/llnf): bug at explicit boxing transformation 2019-01-17 16:58:22 -08:00