Leonardo de Moura
680ee21161
feat(library/init/lean/compiler/ir): add unreachbranches.lean
...
New optimization pass for eliminating unreachable branches that occur
very often when using `ExceptT` and `EState`.
The current commit implements an abstract interpreter for computing
an approximation of the kinds of values returned by a function.
TODO:
- Implement `FnBody.jmp`.
- Implement `interpDecl`
- Remove unreachable branches in `FnBody.case`
2019-10-02 19:57:43 -07:00
Sebastian Ullrich
9015fc1e34
chore(library/compiler/ir_interpreter): add step-level trace
2019-09-12 18:26:15 +02:00
Leonardo de Moura
ca54240843
fix(library/init/lean/compiler/ir): the xType field at FnBody.case must be set by explicitBoxing
2019-09-12 08:47:58 -07:00
Leonardo de Moura
a16d3f09cf
feat(library/init/lean/compiler/ir): store scrutinee type at FnBody.case
2019-09-12 08:07:47 -07:00
Leonardo de Moura
7dfec3c724
feat(library/init/lean/compiler/ir): add persistent field to inc/dec
...
If `persistent == true`, then object is known to be persistent at
compilation time. `emitc` omits `inc/dec` operations to
persistent objects. The interpreter does not to avoid memory leaks.
2019-09-09 07:42:06 -07:00
Leonardo de Moura
ec0e74f5f8
chore(library/init/lean): export as C functions
2019-08-16 20:52:10 -07:00
Leonardo de Moura
d00019f57e
chore(library/init): fix whitspaces before =>
2019-08-09 09:13:49 -07:00
Sebastian Ullrich
3ed67138d5
chore(*): update equation syntax in files and old parser
...
for f in ../../**/*.lean; do echo $f; ./patch.lean.out $f > tmp && cat tmp > $f; done
2019-08-09 11:11:34 +02:00
Leonardo de Moura
a02443d23d
chore(frontends/lean): fun x, e ==> fun x => e
2019-07-02 13:22:11 -07:00
Leonardo de Moura
ab487ea4ac
feat(frontends/lean): allow ; instead of in in let-decls
2019-06-27 17:12:03 -07:00
Leonardo de Moura
7ef495a526
fix(library/init/lean/compiler/ir): use setTag at expandresetreuse
...
This commit also adds the instruction `setTag`, and removes `release`.
2019-05-23 17:41:14 -07:00
Leonardo de Moura
8ba7dd4cff
feat(library/init/lean/compiler/ir): add del instruction for releasing memory
2019-05-23 08:01:15 -07:00
Leonardo de Moura
c6433460fb
chore(library/init/lean/compiler/ir/format): naming consistency
2019-05-22 18:46:50 -07:00
Leonardo de Moura
fe0141918a
fix(library/init/lean/compiler/ir) bug at addDecAfterFullApp
2019-05-22 16:30:42 -07:00
Leonardo de Moura
f3e13c18f8
fix(library/init/lean/compiler/ir): reset
2019-05-21 10:28:50 -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
ca818e6850
feat(library/init/lean/compiler/ir): add borrow inference
2019-05-18 10:48:26 -07:00
Leonardo de Moura
999ba7670d
feat(library/init/lean/compiler/ir): add ExternEntry to Decl.extern constructor
2019-05-17 16:27:58 -07:00
Leonardo de Moura
2363fdf544
refactor(library/init/lean/compiler/ir): remove redundant field from FnBody.jdecl
...
The result type of a join point is always equal to the function return
type. Moreover, the extra bookkeeping introduces extra work, and doesn't
really help.
2019-05-07 12:26:11 -07:00
Leonardo de Moura
7a5e64e52e
chore(library/init/lean/compiler): move IR related files to subdirectory
2019-05-05 07:55:36 -07:00