Commit graph

15828 commits

Author SHA1 Message Date
Sebastian Ullrich
473e998ef6 chore(boot): update 2019-03-07 11:29:19 +01:00
Sebastian Ullrich
6f83faaee0 perf(library/init/lean/parser/command): index command parsers by first token 2019-03-07 11:28:42 +01:00
Leonardo de Moura
ae95a3b6ef chore(boot): update 2019-03-06 17:27:40 -08:00
Leonardo de Moura
8e9b0d2799 fix(library/compiler): inferred types for stage2 declarations 2019-03-06 17:24:43 -08:00
Leonardo de Moura
89f692f548 chore(boot): update 2019-03-06 17:06:54 -08:00
Leonardo de Moura
35459664ad fix(library/compiler/emit_cpp): handle new unreachable terminal 2019-03-06 17:03:56 -08:00
Leonardo de Moura
515556a718 feat(library/init/lean/compiler/ir): add new terminal: unreachable 2019-03-06 17:00:50 -08:00
Leonardo de Moura
3e0c90d17d fix(frontends/lean/vm_elaborator): incorrect arity 2019-03-06 16:52:03 -08:00
Leonardo de Moura
110c727237 feat(library/compiler/llfn): rename to_llnf_fn => to_lambda_pure_fn, and make sure it produce valid terminal expressions
A terminal must be a variable, jump or cases.
This commit also makes sure `explicit_boxing_fn` preserve valid terminals.
2019-03-06 16:42:51 -08:00
Leonardo de Moura
b32ba9cb9d feat(library/compiler/compiler): add compiler trace option ll_infer_type 2019-03-06 14:53:27 -08:00
Leonardo de Moura
d0c1c40cc1 feat(library/init/lean/compiler/ir): started alpha equivalence
I will continue this module later, after I fix a bug in the compiler
exposed by these new functions.
2019-03-06 12:32:30 -08:00
Leonardo de Moura
50476328ff feat(library/init/lean/name): add name_map 2019-03-06 12:32:08 -08:00
Leonardo de Moura
801f55faf0 chore(boot): update 2019-03-06 11:07:02 -08:00
Leonardo de Moura
6d7411cc07 perf(library/init/data/option/basic): missing [inline] 2019-03-06 10:58:12 -08:00
Sebastian Ullrich
1ad5450853 perf(library/init/control/coroutine): mark as [inline_as_reduce] 2019-03-06 17:30:20 +01:00
Sebastian Ullrich
c17cabf58b chore(boot): update 2019-03-06 16:28:55 +01:00
Sebastian Ullrich
ed4a0d904d feat(library/init/lean/elaborator): make meta, remove max_commands 2019-03-06 16:26:21 +01:00
Leonardo de Moura
5f46ca210d chore(boot): update 2019-03-06 07:09:57 -08:00
Leonardo de Moura
5e39a711fc chore(init/lean/ir): remove old IR 2019-03-06 07:04:47 -08:00
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
53cbbd89b1 chore(util): remove dead code 2019-03-06 06:56:16 -08:00
Leonardo de Moura
818f2f2d4a chore(kernel): remove old #include 2019-03-06 06:56:16 -08:00
Leonardo de Moura
af039f420a chore(util): remove dead code 2019-03-06 06:56:16 -08:00
Sebastian Ullrich
00d9a1e76e chore(boot): update 2019-03-06 13:59:34 +01:00
Sebastian Ullrich
cfce916438 perf(library/init/lean/parser/module): make sure commands_aux is tail-recursive 2019-03-06 13:58:26 +01:00
Sebastian Ullrich
85bc52b9f2 feat(library/init/lean/frontend): profile frontend 2019-03-06 11:08:38 +01:00
Sebastian Ullrich
f2a161e5a9 feat(library/init/lean/util): Lean API for profiler 2019-03-06 10:37:38 +01:00
Leonardo de Moura
333ba43266 feat(runtime): statistics
We can enabled runtime statistics by using cmake option `-D RUNTIME_STATS`.

cc @kha
2019-03-05 16:01:06 -08:00
Sebastian Ullrich
3b06c52d4f test(tests/playground/Makefile): re-add original ocamlopt parameters
This reverts commit 8e212ef9d9.
2019-03-05 15:44:42 +01:00
Sebastian Ullrich
069c07fa39 test(tests/playground/Makefile): update 2019-03-05 15:44:39 +01:00
Sebastian Ullrich
90a058a655 test(tests/playground/Makefile): bench fallback, all Lean tests 2019-03-05 15:44:03 +01:00
Sebastian Ullrich
467799c6c3 test(tests/playground/run.sh): fix 2019-03-05 15:37:11 +01:00
Leonardo de Moura
ed4cd39d59 feat(library/init/lean/compiler/ir): new IR for Lean
It is currently implemented in C++. The plan is to move the procedures
for inserting inc/dec, reset/reuse, and inferring borrow inferences to
Lean. Another goal is to make sure new IR optimizations can be
implemented in Lean, and to avoid backend optimizations that would
have to be duplicated in each backend (e.g., `emit_proj_inc_reset_seq`
at `emit_cpp.cpp`).

cc @kha
2019-03-04 16:46:10 -08:00
Leonardo de Moura
e5950cf710 test(tests/playground/gen): simple lean file generator
@kha
I am using this little program to generate big lean files to test the
new front end. For the output produced for `gen 5000`, the new frontend
is almost 10x slower than the old one.
I used `valgrind --tool=callgrind` to collect profiling data.
The number of closures is too big. For example, `free_closure_obj` was
invoked 38.5 million times. The total number of deallocated objects is around
49.5 million.
2019-03-04 16:19:50 -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
3f50df70bc perf(library/init/lean/name): use hash code to speedup name.quick_lt
We use the same trick in the C++ version of this function.

I measured the impact using `lean --new-frontend core.lean` and checking
the number of instructions executed reported by Valgrind.
Before:  4,891,642,264
After:   4,847,313,330
2019-03-04 12:48:06 -08:00
Leonardo de Moura
7051099997 fix(runtime/object): performance bug
The "quick" filter `&s1 != &s2` was incorrect.
It was actually always false, since it just comparing the stack address
of `s1` and `s2`.
I incorporated the quick filter into `string_eq`.

I measured the impact using `lean --new-frontend core.lean` and checking
the number of instructions executed reported by Valgrind.
Before: 5,210,225,530
After:  4,891,642,264

@kha
2019-03-04 12:23:12 -08:00
Leonardo de Moura
9cc41c4f3d chore(frontends/lean/inductive_cmds): disable broken check
@kha I have disabled this check. It was implemented 2 years ago by
Daniel, and I don't want to fix it. It seems you have already fixed a
bug there. AFAICT, this check is just for improving error messages.
I believe we may not even need it since the kernel now supports nested
inductive types. AFAIR, Daniel implemented this check here because the
inductive compiler was introducing a lot of auxiliary declarations
that were making the kernel error messages unreadable.
2019-03-04 11:05:21 -08:00
Sebastian Ullrich
5e7970dca3 test(tests/playground/deriv): Haskell version 2019-02-28 14:57:57 +01:00
Leonardo de Moura
b25c0db35d tests(tests/playground/deriv): deriv in OCaml 2019-02-27 11:15:52 -08:00
Leonardo de Moura
f4302a5f48 test(tests/playground): new versions of unionfind1
@kha I'm just trying to understand the performance numbers.
2019-02-26 16:47:53 -08:00
Leonardo de Moura
2a0f5186e8 fix(runtime/object): bug at array_push
Small object allocator was masking this bug.
2019-02-26 14:19:37 -08:00
Leonardo de Moura
d128af10f9 test(tests/playground): add union find examples
@kha I tried to make the examples self contained.

- unionfind1.lean uses the modified StateT and ExceptT
- unionfind2.lean uses the standard StateT and ExceptT
2019-02-26 13:44:16 -08:00
Sebastian Ullrich
f366af76ac test(tests/playground/rbmap): consistent naming 2019-02-26 20:27:23 +01:00
Sebastian Ullrich
850001b996 test(tests/playground): rbmap.hs, Makefile 2019-02-26 20:26:55 +01:00
Sebastian Ullrich
c4bc783ef4 test(tests/playground/run.sh): split out compile.sh 2019-02-26 20:25:30 +01:00
Leonardo de Moura
6f73f19d19 chore(tests/playground/rbmap_standalone): make sure lean version mirrors the OCaml one 2019-02-26 10:37:12 -08:00
Leonardo de Moura
b883388d66 chore(tests/playground/rbmap_standalone): add missing [specialize] and remove alias 2019-02-26 10:06:18 -08:00
Leonardo de Moura
397be6d1c0 test(tests/playground/rbmap_standalone): add standalone rbmap benchmark 2019-02-26 09:56:59 -08:00
Leonardo de Moura
5635057549 feat(runtime/object): improve m_queue 2019-02-26 09:15:00 -08:00