Commit graph

996 commits

Author SHA1 Message Date
Ayaz Hafiz
13d1232f7d
Erased functions do not take a func spec 2023-07-12 14:44:17 -05:00
Ayaz Hafiz
cd64134b0a
Allow direct packing, unpacking of erased types 2023-07-12 14:43:25 -05:00
Ayaz Hafiz
1d1db83cc7
Add needed file 2023-07-12 14:43:24 -05:00
Ayaz Hafiz
dc56a0ffef
First pass update erasure IR 2023-07-12 14:43:24 -05:00
Ayaz Hafiz
7ea85e44d2
Add Layout::Erased 2023-07-12 14:43:24 -05:00
Ayaz Hafiz
283b9d53d6
Add Expr::ErasedLoad 2023-07-12 14:42:46 -05:00
Ayaz Hafiz
2c838aa5c2
Add mono Expr::ErasedMake 2023-07-12 14:40:16 -05:00
Ayaz Hafiz
3e3d3cc7f3
Type fixes 2023-07-12 14:21:28 -05:00
Ayaz Hafiz
b2d3b52bd5
First compile of erased lambdas 2023-07-12 14:21:28 -05:00
Ayaz Hafiz
cf74f849e1
Unpack erased captures 2023-07-12 14:21:28 -05:00
Ayaz Hafiz
fbad6bcb90
First pass at specialized erased 2023-07-12 14:21:28 -05:00
Ayaz Hafiz
2cb2e37fd7
Specialize erased 2023-07-12 14:21:28 -05:00
Ayaz Hafiz
d17d8c72ad
Exercise building erased function 2023-07-12 14:21:28 -05:00
Ayaz Hafiz
a1eb641bb6
how to build an erased fn 2023-07-12 14:21:27 -05:00
Ayaz Hafiz
cf30f02e01
Expr::FunctionPointer 2023-07-12 14:21:27 -05:00
Ayaz Hafiz
55fa8098d3
add a todo impl 2023-07-12 14:17:58 -05:00
Ayaz Hafiz
63db2c0eea
Add erased layout 2023-07-12 14:17:57 -05:00
Ayaz Hafiz
510a421748
Call erased functions 2023-07-12 14:14:25 -05:00
Ayaz Hafiz
a6bb3ab03c
Get started on calling erased functions 2023-07-12 14:14:25 -05:00
Ayaz Hafiz
6312d75ee0
Add FunctionPointer layout 2023-07-12 13:59:50 -05:00
Ayaz Hafiz
a9e3f967a8
First pass at erased function layouts 2023-07-12 13:57:19 -05:00
Ayaz Hafiz
6e5a308557
Content variant ErasedLambda 2023-07-12 13:57:17 -05:00
Ayaz Hafiz
c459757062
Thread simple model of "ErasedLambdas" through proc layouts
But none of these paths are yet exercised.
2023-07-12 13:53:52 -05:00
Folkert
a50f013fce
cleanup after review 2023-07-12 17:55:21 +02:00
Folkert
da9482b7fa
inline pattern match 2023-07-10 21:17:58 +02:00
Folkert
8c666edbec
use explicit stack to prevent stack overflow in drop specialization 2023-07-10 21:14:30 +02:00
Folkert
2d616d1fe9
manual clippy fixes 2023-07-10 18:27:10 +02:00
Folkert
ef39bad7c6
auto clippy fixes 2023-07-10 18:27:08 +02:00
Anton-4
72c85efc83
switch to rust 1.67 2023-07-10 18:25:52 +02:00
Folkert
bb97c384bb
preserve semantics in the glue generation 2023-07-09 15:47:28 +02:00
Folkert
6d2d65bb1e
remove Boxed layout 2023-07-09 15:47:28 +02:00
Folkert
d64930c17f
remove box and unbox expressions 2023-07-09 15:47:28 +02:00
Folkert
a9813aeae7
use a NonNullableUnwrapped union for Box 2023-07-09 15:47:27 +02:00
Ayaz
f2e013a4e0
Merge pull request #5628 from roc-lang/i5617
Do not drop uninhabited captures from lambda sets
2023-07-01 13:15:14 -05:00
Folkert
3b18494ddd use Ptr instead of Boxed in the code-gen-help 2023-06-30 15:57:33 +02:00
Ayaz Hafiz
a5e1558a6e
Do not drop uninhabited captures from lambda sets
Previously, we would drop uninhabited captures from lambda sets' runtime
representations, which meant sets like

```
[L1 {a: Str}, L2 {a: []}]
```

had runtime representation

```
{Str}
```

rather than

```
Union({Str}, {[]})
```

if we drop unreachable lambdas from the representation, then the
reachable lambdas are somewhat more efficient to compile (as there are
less material tag options), but the compiler complexity increases
because we must represent voided capture sets in the lambda set.

Even if a lambda has voided captures, we must specialize it, because
failing to do so opens us up to losing relevant specializations needed
later on. See 2f7020aa31 for a
previous occurence of that.

As such, simply keep voided layouts in place during lambda set
compilation. The optimizer should elide them anyway.
2023-06-29 17:32:50 -05:00
Folkert
0308e02ba9
update some logic and comments 2023-06-29 18:40:27 +02:00
Folkert
b29e612a4d
refactor 2023-06-29 18:40:26 +02:00
Folkert
f27cb83a02
remove Reuse 2023-06-29 18:40:26 +02:00
Folkert
1daf975391
use Tag instead of Reuse constructor 2023-06-29 18:40:26 +02:00
Folkert
463f739c06
add reuse info to normal Tag ir constructor 2023-06-29 18:40:26 +02:00
Folkert
48e6ef79a4
we no longer care where a tag layout stores the tag id 2023-06-27 20:55:28 +02:00
Folkert
e95d093461
in dev/wasm backends, always clear tag id bits from a reset pointer 2023-06-27 20:50:43 +02:00
Folkert
fc3004da58
free or reuse unconditionally when value is unique 2023-06-27 17:37:45 +02:00
Folkert
ae47cc5171
in TRMC, still apply normal TCE 2023-06-24 19:45:44 +02:00
Folkert
9d10389c2b
make trmc candidate set cheaper to clone 2023-06-24 14:49:58 +02:00
Folkert
654cf7b861
changes after review 2023-06-24 14:49:57 +02:00
Folkert
e19f0ae6d6
don't capture from outside join point for the dev backend 2023-06-24 14:49:55 +02:00
Folkert
c87519c209
search for multiple TRMC opportunities 2023-06-24 14:49:55 +02:00
Folkert
bc64e4b92b
fix layout check issue 2023-06-24 14:49:53 +02:00