Commit graph

222 commits

Author SHA1 Message Date
Ayaz Hafiz
63db2c0eea
Add erased layout 2023-07-12 14:17:57 -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
ef39bad7c6
auto clippy fixes 2023-07-10 18:27:08 +02:00
Folkert
6d2d65bb1e
remove Boxed layout 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 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
654cf7b861
changes after review 2023-06-24 14:49:57 +02:00
Folkert
7637506037
skip is_null check if possible 2023-06-24 14:49:49 +02:00
Folkert
9c85fb90d3
fix bugs 2023-06-24 14:49:47 +02:00
Folkert
4a9514d2c4
rough implementation 2023-06-24 14:49:46 +02:00
Folkert
17512873e8
add LayoutRepr::Ptr 2023-06-24 14:49:45 +02:00
Ayaz Hafiz
ee25735731
LayoutIds use LayoutRepr 2023-06-17 18:13:02 -05:00
Ayaz Hafiz
bc41db2a34
Get rid of passing target_info a bunch 2023-06-17 18:13:00 -05:00
Ayaz Hafiz
314cc7855a
Revert "Check if benchmarks are weird"
This reverts commit 24e7a56f4b.
2023-06-16 15:26:02 -05:00
Ayaz Hafiz
24e7a56f4b
Check if benchmarks are weird 2023-06-16 14:49:01 -05:00
Ayaz Hafiz
5b0d47c9eb
Drop Layout::alignment_bytes_for_llvm 2023-06-16 10:30:44 -05:00
Ayaz Hafiz
2294f6994f
TERRIBLE HACK to support x86 compilation 2023-06-16 10:30:44 -05:00
Ayaz Hafiz
47fb9fe6f2
Implement struct-by-reference for structs over 4 machine words 2023-06-16 10:30:40 -05:00
Folkert
59da1ea891
consistently name function symbols
previously the dev backend did not take into account lambda name information to generate function names. This could cause the same function name to be defined twice
2023-06-11 13:39:43 +02:00
Ayaz Hafiz
80a98668d5
Fix type errors 2023-06-06 16:07:51 -05:00
Ayaz Hafiz
a6b3656471
Begin generating newtype wrappers for struct layouts 2023-06-06 16:04:41 -05:00
Ayaz Hafiz
5274dbcd00
Add a Newtype variant to LayoutWrapper 2023-06-06 16:03:52 -05:00
Ayaz Hafiz
457cdabc5c
Make repr private and accessible only via the interner 2023-06-06 16:01:27 -05:00
Ayaz Hafiz
a67c148be7
Convert LayoutRepr::Struct into a tuple variant 2023-05-16 11:58:16 -05:00
Ayaz Hafiz
1b84cbafe3
Only compare reprs in gen_dev 2023-05-11 12:48:38 -05:00
Ayaz Hafiz
8ca71c7eda
Get started with semantic layouts for tag unions 2023-05-10 18:47:10 -05:00
Ayaz Hafiz
49b8886b82
Hide semantic repr in layout 2023-05-10 17:24:45 -05:00
Ayaz Hafiz
31c9cc8227
Hide away SemanticRepr definition 2023-05-10 17:10:58 -05:00
Ayaz Hafiz
4296d5a349
Drop Layout::struct_no_name_order 2023-05-10 15:58:51 -05:00
Ayaz Hafiz
1170b542b6
Remove field_order_hash from struct layouts 2023-05-10 15:49:30 -05:00
Ayaz Hafiz
43d4135dc8
Semantic layouts for tuples 2023-05-10 15:40:44 -05:00
Ayaz Hafiz
c06ffc434b
Begin generating semantic reprs for records 2023-05-10 15:38:25 -05:00
Ayaz Hafiz
7b2d149deb
Move repr-specific functions to LayoutRepr and impl deref 2023-05-10 15:26:31 -05:00
Ayaz Hafiz
f100e8753c
Introduce the concept of SemanticRepr 2023-05-10 13:51:04 -05:00
Ayaz Hafiz
c3eeb5e2cc
Wrap layouts in a LayoutRepr constructor
Part 1 of support semantic layout representations.
2023-05-10 13:22:10 -05:00
Folkert
f9f4d5eb49
infra for exposed_generic in the dev backend 2023-05-01 18:39:10 +02:00
Folkert
2e6c632fb4
make only used fields pub(crate) 2023-04-28 22:08:55 +02:00
Folkert
b5bd0f4fb0
find extern names using the variables (not layouts) 2023-04-21 18:21:01 +02:00
Folkert
4cd8f0a056 clippy --fix fixes 2023-04-21 12:05:51 +02:00
Folkert
c848a85eb4
fix index bug in recursive decrements 2023-04-17 14:22:27 +02:00
Folkert
e0b5a76a04
correct alignment calculation in RC code 2023-04-17 13:53:54 +02:00
Folkert
92c2931678
make all glue tests run! 2023-04-05 23:19:17 +02:00
Ayaz Hafiz
8ca7f91fcd
Clippy 2023-03-30 18:25:31 -05:00
Ayaz Hafiz
247913dc20
Record all nested recursive structures an entry in the layout cache contains
If an entry in the layout cache contains recursive structures, the entry
is not reusable if the recursive structure is currently in the "seen"
set. The example elucidated in the source code is as follows:

Suppose we are constructing the layout of

```
[A, B (List r)] as r
```

and we have already constructed and cached the layout of `List r`, which would
be

```
List (Recursive [Unit, List RecursivePointer])
```

If we use the cached entry of `List r`, we would end up with the layout

```
Recursive [Unit, (List (Recursive [Unit, List RecursivePointer]))]
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cached layout for `List r`
```

but this is not correct; the canonical layout of `[A, B (List r)] as r` is

```
Recursive [Unit, (List RecursivePointer)]
```

However, the current implementation only preserves this behavior for
structures that contain one recursive structure under them. In practice,
there can be structures that contain multiple recursive structures under
them, and we must be sure to record all those structures in the
layout-cache.
2023-03-30 18:15:35 -05:00
Ayaz Hafiz
92657b6f4c
Don't intern recursive unions with pointer-fixing if they've been resolved 2023-03-28 14:49:39 -05:00
Ayaz Hafiz
3f532df981
Generate code for recursive nullable wrapped lambda sets 2023-03-27 10:11:49 -05:00