Commit graph

78 commits

Author SHA1 Message Date
Leonardo de Moura
51a9208ea9 chore(library/compiler): remove environment extension: llnf_code
We don't need it anymore. It was used by the old IR compiler
2019-05-27 21:28:22 -07:00
Leonardo de Moura
bf3575a316 feat(library/init/lean/compiler/ir): improve expandresetreuse 2019-05-23 17:23:50 -07:00
Leonardo de Moura
f9f4e6c14b feat(library/init/lean/compiler/ir): add expandresetreuse 2019-05-23 08:58:16 -07:00
Leonardo de Moura
6bed0ca5b5 chore(library/compiler): style 2019-05-22 18:46:37 -07:00
Leonardo de Moura
83692eef6d feat(library/init/lean/compiler/ir): explicit RC 2019-05-19 16:46:51 -07:00
Leonardo de Moura
300c251b49 feat(library/init/lean/compiler/ir): add explicitBoxing to new IR compiler stack 2019-05-19 08:10:45 -07:00
Leonardo de Moura
ca818e6850 feat(library/init/lean/compiler/ir): add borrow inference 2019-05-18 10:48:26 -07:00
Leonardo de Moura
c9bcd4990c feat(library/compiler): register extern constants into the new IR 2019-05-17 17:12:51 -07:00
Leonardo de Moura
9a3a01fa6e feat(library/compiler/compiler): invoke new IR compiler implemented in Lean 2019-05-16 16:08:52 -07:00
Leonardo de Moura
9d7191feca chore(library/compiler): remove support for fully boxed 2019-05-16 15:48:33 -07:00
Leonardo de Moura
ac69f802e1 feat(library/compiler): interface with new IR compiler entry point 2019-05-16 15:41:47 -07:00
Leonardo de Moura
9d9f546ad8 refactor(util/sexpr): move options and option_declarations to util 2019-05-16 14:37:24 -07:00
Leonardo de Moura
fd487d8db7 chore(*): remove old VM 2019-05-08 15:15:44 -07:00
Leonardo de Moura
9b50e9d003 feat(library/compiler/find_jp): locate (and preserve) join points created by user 2019-05-02 17:20:19 -07:00
Leonardo de Moura
f222dc7cca feat(library/compiler): destructive updates for {x with ...} expressions 2019-04-22 13:35:11 -07:00
Leonardo de Moura
c4dc338d7d feat(library/compiler): add eager_lambda_lifting skeleton
The current commit only detects lambda expressions that should be
lifted eagerly.

@kha I added a comment describing why this optimization is useful.
Right now, we are not writing code that benefits from this optimization,
but it seems very useful for implementing combinators that return
a tuple containing functions. I think this is a useful idiom, for
example, the combinator may have two parts: one that is the actual
action, and another that collects "static properties".
Last summer, if I remember correctly, you considered building this
kind of combinator for the new Lean parser, but gave up because we
did not have compiler support for it. In your case, the "static
property" would be the set of tokens. It could also contain the left
most token for initializing the Pratt parser table, etc.
This commit is the first step to make this kind of code efficient.
It will also improve the experiment at `tests/playground/parser/`
2019-04-17 14:18:47 -07:00
Leonardo de Moura
d662f312df fix(library/compiler/util): loose bvars 2019-04-17 07:57:30 -07:00
Leonardo de Moura
8612c1ecae chore(library/compiler/util): add debugging helper function 2019-04-16 17:12:09 -07:00
Leonardo de Moura
c54589007e feat(library/compiler): extract closed terms after caching stage2 decls 2019-04-06 07:19:19 -07:00
Leonardo de Moura
7b835f3d02 feat(library/compiler/csimp): keep simplifying if cse and elim_dead_let reduced expression
Both `cse` and `elim_dead_let` may create new simplification opportunities for `csimp`.
2019-04-05 15:39:43 -07:00
Leonardo de Moura
6ab935ebf6 feat(library/compiler/csimp): merge equal casesOn branches 2019-04-02 11:06:07 -07:00
Sebastian Ullrich
20451918a6 fix(library/constants): more Io -> IO 2019-03-21 15:11:05 -07:00
Leonardo de Moura
aa56578a29 fix(library/compiler/compiler): assertion violations 2019-03-19 11:25:55 -07:00
Leonardo de Moura
1935986f3c fix(library/compiler/compiler): we must compile (non external) opaque constants 2019-03-16 18:41:58 -07:00
Leonardo de Moura
b1c187f717 feat(library/compiler): allow io unit as main function result type
When `io unit` is used, we use `return 0` for `result.ok`, and `return
1` for `result.except`.
2019-03-16 16:05:45 -07:00
Leonardo de Moura
0888dee25e chore(*): meta ==> unsafe 2019-03-15 15:04:40 -07:00
Leonardo de Moura
67f4698593 feat(library/compiler): do not generate code for decls that have irrelevant types
We were generating hundreds of definitions that just return
`lean::box(0)`.
2019-03-07 12:48:16 -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
b32ba9cb9d feat(library/compiler/compiler): add compiler trace option ll_infer_type 2019-03-06 14:53:27 -08:00
Leonardo de Moura
19e111c2ff feat(library/compiler): allow main function to also have type io uint32 2019-02-13 16:29:10 -08:00
Leonardo de Moura
c27167f445 fix(library/compiler/ll_infer_type): use extern_attribute 2019-02-11 15:35:03 -08:00
Leonardo de Moura
8acb2d4ed8 chore(library/compiler): minor modifications before builtin ==> extern refactor 2019-02-11 13:29:39 -08:00
Leonardo de Moura
bf15ee48fd refactor(library/compiler): export_name ==> export_attribute 2019-02-09 17:59:46 -08:00
Leonardo de Moura
9aed74a5e0 refactor(library/compiler): move extension for storing LLNF code 2019-02-09 17:59:46 -08:00
Leonardo de Moura
4339afc802 chore(library/compiler): [extname] ==> [export] 2019-02-08 10:25:21 -08:00
Max Wagner
e663f75fb2 chore(library/compiler): move builtins into the environment 2019-02-08 09:56:03 -08:00
Leonardo de Moura
14dd0d4907 feat(library/compiler): treat a function named main as the main function 2019-02-06 17:20:23 -08:00
Leonardo de Moura
a8e2e535a2 feat(library/compiler): preserve the arity of entry points 2019-02-06 12:58:18 -08:00
Leonardo de Moura
0e8067e191 fix(library/compiler/compiler): ensure_arity bug 2019-01-28 15:42:23 -08:00
Leonardo de Moura
371baf2002 fix(library/compiler/compiler): typo 2019-01-28 15:34:58 -08:00
Leonardo de Moura
1f3201dca1 feat(library/compiler): add emit_fn_fn skeleton 2019-01-28 15:04:56 -08:00
Leonardo de Moura
274aeed30f fix(library/compiler/compiler): make sure that the type of functions that return closures match their arity
Before this commit, we could have a LLNF function `f` of arity 0 and
type `_obj -> _obj`. Now, this kind of function has type `_obj`.
2019-01-25 15:40:25 -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
afd30d73c1 chore(library/compiler/compiler): generate Lean IR with explicit boxing and RC instructions
This is just for testing. These two steps are not used by `emit_bytecode`,
but they will be used to generate C++ code.
We can now compile the whole corelib in debug mode with these two extra
transformation without any assertion violation.
2019-01-18 16:01:47 -08:00
Leonardo de Moura
a001806996 feat(library/compiler/compiler): generate boxed version of builtin constants 2019-01-18 15:43:06 -08:00
Sebastian Ullrich
6d0b3afa7e fix(library/compiler/compiler): do not silently abort on user-given sorrys 2018-11-17 18:00:55 +01:00
Leonardo de Moura
3d24c6466b feat(library/compiler/llnf): generate _boxed version eagerly 2018-11-15 18:10:20 -08:00
Leonardo de Moura
e5666b3464 feat(library/compiler): remove another reference to vm.h 2018-11-15 16:38:01 -08:00
Sebastian Ullrich
2f8e6cc975 chore(frontends/lean/elaborator,library/compiler/compiler): avoid error recovery errors 2018-11-14 09:52:22 +01:00
Leonardo de Moura
7365b9ed30 feat(library/compiler/lambda_lifting): cache names for lifted lambdas
We were creating hundreds of different names for simple lambdas. Example:
```
λ a, @coroutine.done a
```
2018-11-13 15:13:55 -08:00