Commit graph

387 commits

Author SHA1 Message Date
Brendan Hansknecht
c277d9a6b9
add missing compiler rt function 2024-12-11 18:00:46 -08:00
Brendan Hansknecht
0a573ca557
Merge remote-tracking branch 'origin/main' into upgrade-llvm-zig 2024-12-11 16:38:34 -08:00
Brendan Hansknecht
37c6330c6f
cleanup when expects are run 2024-12-11 15:15:46 -08:00
Brendan Hansknecht
4cf5683ee8
Always generate dbg expressions 2024-12-11 14:55:32 -08:00
Luke Boswell
656a7bcd87
Merge remote-tracking branch 'remote/main' into upgrade-llvm-zig 2024-11-30 10:18:11 +11:00
Luke Boswell
b7c226212c
remove stray comment 2024-11-29 10:06:18 +11:00
Luke Boswell
2feb5d3c2e
Merge remote-tracking branch 'remote/main' into upgrade-llvm-zig 2024-11-29 08:58:47 +11:00
JRI98
75f13d3f2e
Remove unused RuntimeErrorFunction variant from roc_mono::ir::Expr 2024-11-28 20:11:56 +00:00
Joshua Warner
9ead801536
Remove expect-fx syntax and handling
This was never fully hooked up in platforms, and the plan is to replace the need for this with doing purity-inference on normal `expect` statements.

On the other hand, fuzzing is finding some bugs caused by having a hyphenated keyword, so this is a great time to go ahead and remove it!
2024-11-17 20:25:37 -08:00
Luke Boswell
dc3aa06d61
Merge remote-tracking branch 'remote/main' into upgrade-llvm-zig 2024-11-13 09:02:20 +11:00
Agus Zubiaga
e3c6b756d3
Make sure to drop suffix from symbols exposed to the host 2024-11-07 18:54:23 -03:00
Luke Boswell
915097d792
Merge remote-tracking branch 'remote/main' into upgrade-llvm-zig 2024-10-08 18:21:24 +11:00
Brendan Hansknecht
5b8b781bad
remove single entrypoint 2024-10-07 21:16:30 -07:00
Ayaz
cef2c8ae87
Update build.rs
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
2024-09-21 09:50:17 -04:00
Brendan Hansknecht
6b04318e27
handle float types 2024-08-09 19:27:47 -07:00
Brendan Hansknecht
462872551e
fix up list literal constant loading 2024-08-09 19:07:01 -07:00
Ayaz Hafiz
9abbcfaafc
Optimize literal list construction in LLVM backend
Currently, list literals are always heap-allocated and their elements
are stored by emitting a GEP and store for each item in the literal.
This produces huge quantities of IR, causing compile times for e.g.
programs with large literals or ingested files to blow up.

Instead, if a list literal consists entirely of literal values, create a
global section for the literal and return a pointer to it.
2024-08-09 18:51:17 -07:00
Luke Boswell
1519e5f833
fix warnings from deprecated llvm ptr type 2024-08-04 12:52:44 +10:00
Luke Boswell
8090e99e75
cleanup llvm module optimisation passes 2024-08-04 12:13:01 +10:00
Luke Boswell
2ba17a71a4
WIP fix LLVM compiling 2024-07-28 15:55:37 +10:00
Brendan Hansknecht
bccab34833
correct comment 2024-07-20 21:30:25 -07:00
Brendan Hansknecht
e804501a92
clippy 2024-07-20 21:21:43 -07:00
Brendan Hansknecht
703224b275
fix alloca args overwriting eachother 2024-07-20 21:14:31 -07:00
Brendan Hansknecht
c5a74bdc12
for referenced values, use allocas instead of phi nodes 2024-07-20 19:52:11 -07:00
Brendan Hansknecht
ee7f1e39c7
move all allocas to the entry block 2024-07-20 19:17:11 -07:00
Brendan Hansknecht
3c842196fa
Update LLVM to properly increment and decrement lists 2024-07-13 10:39:51 -07:00
Brendan Hansknecht
dc539f759d
Improve OptSize implementation in Roc
1. Use the llvm `Oz` pipeline.
2. Avoid adding extra optimization passes.

This shrunk rocci-bird by ~16%.
2024-05-01 08:25:34 -07:00
Brendan Hansknecht
6dc5bfb1b7
Use roc_target over target_lexicon
Tailors a target class for our needs.
Replaces tons of uses across the entire compiler.
This is a base for later adding new targets like thumb.
2024-03-31 10:50:26 -07:00
Anton-4
76c47c5d6f
stylistic improvements 2024-03-09 20:47:19 +01:00
Jonathan Schear
504e00d44d
Group toplevel expects by module, run them separately 2024-03-08 14:56:32 -05:00
Brendan Hansknecht
738a3b5282
update some compiler-rt dce protection 2024-02-08 11:52:25 -08:00
Brendan Hansknecht
47ba132905
Correct windows return by pointer calculation
I always thought this was wrong. Saw it again today and decided to look it up.
Windows will return by pointer for anything over 64bits on an x86_64 machine.

Note: this is wrong for windows aarch64, but I will correct that in a PR where I clean up targets.
https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170#return-values
https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#return-values
2024-01-30 21:37:51 -08:00
Brendan Hansknecht
d76394ac31
Fix the nonnull attribute
The current version will fail if run through the `opt` tool.
nonnull should have no data attached.
2024-01-27 08:36:06 -08:00
Luke Boswell
6bdcc4743a
Merge pull request #6363 from roc-lang/windows-llvm-setjmp-longjmp
fix for bugged setjmp/longjmp on windows/llvm
2024-01-09 22:00:15 +11:00
Brendan Hansknecht
3559326996
Set debug info version
We just missed setting it. Set it as specified in the docs: https://thedan64.github.io/inkwell/inkwell/debug_info/index.html#setting-up-the-module-for-holding-debug-info
Not sure why it is 3, but that is the value in the llvm tutorial as well: https://llvm.org/docs/SourceLevelDebugging.html

Fixes #6367
2024-01-08 20:28:42 -08:00
Folkert
b9b19d6054
fix for bugged setjmp/longjmp on windows/llvm 2024-01-07 23:04:11 +01:00
Anton-4
cd632fe549
Merge branch 'main' of github.com:roc-lang/roc into clippy-1.74 2023-12-25 17:05:37 +01:00
Anton-4
384cf2decf
add __udivti3 to must_keep
Fixes Undefined Symbol in relocation...
2023-12-13 12:09:15 +01:00
Brendan Hansknecht
ec6d8142e7
Re-enable early DCE with fix for M1 mac
I won't claim to know why `__muloti4` is special, but none of the other compiler-rt functions are,
but seems to work and stop tests from hanging.

It also enables early DCE again which saves a tiny bit of compile time.
2023-12-12 10:43:14 -08:00
Richard Feldman
95a4bb988c
Merge pull request #6255 from roc-lang/glue-panic-handler
make glue use a setjmp/longjmp panic handler
2023-12-11 16:33:26 -05:00
Richard Feldman
67d7385b9a
Clean up some obsolete asserts 2023-12-11 15:15:59 -05:00
Folkert
d2d87949c8
remove random write to pointer 2023-12-11 21:07:15 +01:00
Folkert
590282b14f
make glue use a setjmp/longjmp panic handler 2023-12-11 20:33:21 +01:00
Brendan Hansknecht
fb049b661a
Remove early DCE of builtins
Early DCE was sometimes cleaning up functions that we actaully still needed.
At some point we can come back to it and try to properly protect all special functions.
Until then, this still enables DCE, but it runs later with the full generated Roc module.
2023-12-11 10:44:57 -08:00
Brendan Hansknecht
b39d604745
Dict follow up and addition of releaseExcessCapacity 2023-12-10 00:06:58 -08:00
Brendan Hansknecht
1ad9933b38
add some missed symbols that roc needs 2023-12-09 18:33:23 -08:00
Brendan Hansknecht
e621de328d
fix dce of compiler-rt 2023-12-09 18:11:23 -08:00
Brendan Hansknecht
05c1b6c583
more debug info corrections 2023-12-04 14:27:02 -08:00
Brendan Hansknecht
496cd6710a
fix debug info and add it all to the llvm backend 2023-12-04 12:55:33 -08:00
Brendan Hansknecht
787d7f85ac
switch dbg arg ordering to make it backwards compatible 2023-12-02 21:18:32 -08:00