Commit graph

130 commits

Author SHA1 Message Date
bjorn3
a465d6a860 Move codegen_and_compile_fn to driver/jit.rs 2023-02-03 16:48:35 +00:00
bjorn3
ab0e2aaed2 Revert "Don't PrintOnPanic on fatal errors"
This reverts commit b5ac64b4cf.

It entirely breaks PrintOnPanic as ICE seems to be considered a fatal error too.
2022-12-16 13:00:36 +00:00
bjorn3
91655428f9 Ensure Cranelift errors are reported deterministically
This may also have been the root cause of #1310.
2022-12-16 10:04:49 +00:00
bjorn3
b5ac64b4cf Don't PrintOnPanic on fatal errors 2022-12-16 09:44:28 +00:00
bjorn3
d841f93855 Add .comment section with producer name
Fixes #1211
2022-12-15 13:57:13 +00:00
bjorn3
08ba5d4e80 Remove a couple of module.isa() calls 2022-12-14 12:25:53 +00:00
bjorn3
155f569794 Update cranelift to the upcoming release-3.0.0 branch 2022-12-01 17:45:59 +00:00
bjorn3
9054e66703 Fix panic in ConcurrencyLimiter when unwinding
Fixes #1275
2022-09-02 09:34:41 +00:00
bjorn3
eef75dde3b Update libloading to 0.7.3
This was previously done in bfcf97bd83, but got
reverted due to a bug. The bug seems to be fixed now.

Fixes #1137
2022-09-01 15:52:48 +00:00
bjorn3
a7de42f61b Use pull instead of push based model for getting dylib symbols in the jit
This avoids having to parse the dylibs to get all symbols and matches
the way the dynamic linker resolves symbols. Furthermore it fixes the
jit on Windows.
2022-08-28 10:43:19 +02:00
bjorn3
f71c545746 Make sure to count reused cgus towards the count of jobs done 2022-08-23 16:51:06 +00:00
bjorn3
5b4195669e Add some self profiler calls 2022-08-23 16:32:38 +00:00
bjorn3
d081c20273 Compile functions from clif ir to object code in parallel 2022-08-23 16:32:38 +00:00
bjorn3
1a6323313b Use correct CguReuse variant 2022-08-23 16:32:20 +00:00
bjorn3
f9d60cf551 Do asm compilation and object file emission in parallel 2022-08-23 16:05:29 +00:00
bjorn3
535c6ddc8b Small cleanup 2022-08-18 19:03:28 +00:00
bjorn3
259b21fd46 Remove TyCtxt from DebugContext
And explicitly thread it through everwhere it is needed.
2022-08-18 15:25:52 +00:00
bjorn3
5fc1366dfa Register debuginfo for lazy jit shim 2022-08-18 12:55:44 +00:00
bjorn3
c820b7cd60 Remove TyCtxt field from CodegenCx 2022-08-17 13:43:32 +00:00
bjorn3
9461fd2cb0 Remove TyCtxt parameter from emit_cgu
TyCtxt isn't available on background threads.
2022-08-13 12:18:41 +00:00
bjorn3
4c0766ce6c Move error reporting out of emit_cgu
Error reporting requires a Session, which isn't available on background
threads.
2022-08-13 09:03:28 +00:00
bjorn3
c2f0b3a1bf Move copy to incr comp cache to codegen join phase
The copy depends on Session, which is only available on the main thread.
As such the copy can't be done on future codegen threads.
2022-08-12 19:10:16 +00:00
bjorn3
6206c4e927 Stream object file to disk
This reduces memory usage and may improve performance slightly.
2022-08-12 18:57:01 +00:00
bjorn3
ab7c706306 Move build_isa call into make_module 2022-08-12 18:40:48 +00:00
bjorn3
d3512b1d8e Don't attempt to do incr comp for the allocator shim
The allocator shim doesn't get reused and the allocator shim is just
under 2kb, so reusing it is likely more expensive than regenerating it.
2022-08-12 18:29:46 +00:00
bjorn3
db7d8a811d Give fields of ModuleCodegenResult names 2022-08-12 18:29:43 +00:00
bjorn3
e45f6000a0 Remove the partial linking hack for global asm support 2022-08-12 12:27:47 +00:00
bjorn3
48b312f04a Don't take TyCtxt as argument for compile_global_asm
This allows it to be executed on a background thread.
2022-08-12 11:44:52 +00:00
bjorn3
066f844fff Move some sess.fatal calls out of compile_global_asm 2022-08-12 09:28:41 +00:00
bjorn3
7cc97ebcbb Extract global_asm module 2022-08-12 09:11:47 +00:00
bjorn3
c5adc96532 Introduce OngoingCodegen type 2022-08-11 13:49:08 +00:00
bjorn3
07bcd111f8 Return ModuleCodegenResult from reuse_workproduct_for_cgu 2022-08-11 13:38:07 +00:00
bjorn3
8a336a2ae1 Move cached_context out of CodegenCx 2022-08-10 18:47:05 +00:00
bjorn3
a10da0f768 Split non-compile parts of codegen_fn out into a separate function
The new codegen_and_compile_fn function only calls codegen_fn and then
compile_fn. This makes it possible for both parts to be called
separately by the driver.
2022-08-10 18:29:46 +00:00
Joshua Nelson
b2ae24e6a1 Rename debugging_opts to unstable_opts
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`).
Rename it to be more clear.
2022-07-13 17:47:06 -05:00
David Wood
69d0c1e9ac incr: cache dwarf objects in work products
Cache DWARF objects alongside object files in work products when those
exist so that DWARF object files are available for thorin in packed mode
in incremental scenarios.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-06 11:15:13 +01:00
Maybe Waffle
6d8c45064b Move/rename lazy::Sync{OnceCell,Lazy} to sync::{Once,Lazy}Lock 2022-06-16 19:54:42 +04:00
bjorn3
3d8e854604 Make saved_file field of WorkProduct non-optional
A WorkProduct without a saved file is useless
2022-06-06 12:39:32 +00:00
bjorn3
bbb850931f Factor Option out of copy_cgu_workproduct_to_incr_comp_cache_dir call
This improves clarity of the code a bit
2022-06-06 12:38:38 +00:00
bjorn3
5a1a111b52 Avoid an unnecessary clone for copy_cgu_workproduct_to_incr_comp_cache_dir calls 2022-06-06 12:32:08 +00:00
bjorn3
d5cb2bee82 Rename CodegenUnit::work_product to previous_work_product
It returns the previous work product or panics if there is none. This rename
makes the purpose of this method clearer.
2022-06-06 12:30:10 +00:00
bjorn3
d9025cebac Merge commit '63734fcdd7' into sync_cg_clif-2022-05-15 2022-05-15 12:32:19 +02:00
klensy
f2d2ec3e93 check_doc_keyword: don't alloc string for emptiness check
check_doc_alias_value: get argument as Symbol to prevent needless string convertions

check_doc_attrs: don't alloc vec, iterate over slice. Vec introduced in #83149, but no perf run posted on merge

replace as_str() check with symbol check

get_single_str_from_tts: don't prealloc string

trivial string to str replace

LifetimeScopeForPath::NonElided use Vec<Symbol> instead of Vec<String>

AssertModuleSource use BTreeSet<Symbol> instead of BTreeSet<String>

CrateInfo.crate_name replace FxHashMap<CrateNum, String> with FxHashMap<CrateNum, Symbol>
2022-04-08 11:45:57 +03:00
Loïc BRANSTETT
69046fa8fd Cleanup after some refactoring in rustc_target 2022-04-03 21:29:57 +02:00
bjorn3
d1904e5855 Merge commit '370c397ec9' into sync_cg_clif-2022-03-20 2022-03-20 16:55:21 +01:00
bjorn3
b5cbb87e62 Merge commit '35d9c6bf25' into sync_cg_clif-2022-02-23 2022-02-23 11:49:34 +01:00
bjorn3
a5a14258e5 Merge commit '40b00f4200' into sync_cg_clif-2021-12-30 2021-12-30 14:53:41 +01:00
bjorn3
799e067912 Merge commit '97e5045493' into sync_cg_clif-2021-12-20 2021-12-20 18:56:35 +01:00
Nicholas Nethercote
93511d926f Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
Camille GILLOT
7879119e6a Make hash_result an Option. 2021-10-20 18:29:18 +02:00