]> git.lizzy.rs Git - rust.git/log
rust.git
22 months agoMerge pull request #1273 from bjorn3/jit_pull_symbols
bjorn3 [Sun, 28 Aug 2022 09:30:00 +0000 (11:30 +0200)]
Merge pull request #1273 from bjorn3/jit_pull_symbols

Use pull instead of push based model for getting dylib symbols in the jit

22 months agoUse pull instead of push based model for getting dylib symbols in the jit
bjorn3 [Sun, 28 Aug 2022 08:43:19 +0000 (10:43 +0200)]
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.

22 months agoSync from rust 4d45b0745ab227feb9000bc15713ade4b99241ea
bjorn3 [Thu, 25 Aug 2022 14:34:28 +0000 (16:34 +0200)]
Sync from rust 4d45b0745ab227feb9000bc15713ade4b99241ea

22 months agoRustfmt
bjorn3 [Wed, 24 Aug 2022 17:06:47 +0000 (17:06 +0000)]
Rustfmt

22 months agoMerge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24
bjorn3 [Wed, 24 Aug 2022 16:40:58 +0000 (18:40 +0200)]
Merge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24

22 months agoRustup to rustc 1.65.0-nightly (060e47f74 2022-08-23)
bjorn3 [Wed, 24 Aug 2022 16:37:37 +0000 (18:37 +0200)]
Rustup to rustc 1.65.0-nightly (060e47f74 2022-08-23)

22 months agoSync from rust 4a24f08ba43166cfee86d868b3fe8612aec6faca
bjorn3 [Wed, 24 Aug 2022 16:29:45 +0000 (18:29 +0200)]
Sync from rust 4a24f08ba43166cfee86d868b3fe8612aec6faca

22 months agoMerge pull request #1271 from bjorn3/parallel_comp_support
bjorn3 [Wed, 24 Aug 2022 15:22:30 +0000 (17:22 +0200)]
Merge pull request #1271 from bjorn3/parallel_comp_support

Support compiling codegen units in parallel

22 months agoAdd fixme
bjorn3 [Wed, 24 Aug 2022 14:28:40 +0000 (14:28 +0000)]
Add fixme

22 months agoTune drop_excess_capacity
bjorn3 [Wed, 24 Aug 2022 10:22:01 +0000 (12:22 +0200)]
Tune drop_excess_capacity

22 months agoMake sure to count reused cgus towards the count of jobs done
bjorn3 [Tue, 23 Aug 2022 16:51:06 +0000 (16:51 +0000)]
Make sure to count reused cgus towards the count of jobs done

22 months agoAdd some self profiler calls
bjorn3 [Tue, 23 Aug 2022 16:11:12 +0000 (16:11 +0000)]
Add some self profiler calls

22 months agoCompile functions from clif ir to object code in parallel
bjorn3 [Tue, 23 Aug 2022 16:09:08 +0000 (16:09 +0000)]
Compile functions from clif ir to object code in parallel

22 months agoUse correct CguReuse variant
bjorn3 [Tue, 23 Aug 2022 16:06:01 +0000 (16:06 +0000)]
Use correct CguReuse variant

22 months agoDo asm compilation and object file emission in parallel
bjorn3 [Tue, 23 Aug 2022 16:05:29 +0000 (16:05 +0000)]
Do asm compilation and object file emission in parallel

22 months agoAdd a jobserver based concurrency limiter
bjorn3 [Tue, 23 Aug 2022 15:44:39 +0000 (15:44 +0000)]
Add a jobserver based concurrency limiter

22 months agoStore symbol name as owned string
bjorn3 [Fri, 19 Aug 2022 10:27:00 +0000 (10:27 +0000)]
Store symbol name as owned string

22 months agoRevert "Avoid masking shift amounts (#1268)"
bjorn3 [Tue, 23 Aug 2022 11:10:44 +0000 (11:10 +0000)]
Revert "Avoid masking shift amounts (#1268)"

This reverts commit 156bda8bc708cca60e9de18743d833c8d97dd7ff.

This breaks the mir_overflow_off rustc test:
https://github.com/bjorn3/rustc_codegen_cranelift/runs/7971362755?check_suite_focus=true#step:7:2904

22 months agoUse native scalar `fma` instruction (#1267)
Afonso Bordado [Tue, 23 Aug 2022 10:42:35 +0000 (11:42 +0100)]
Use native scalar `fma` instruction (#1267)

Cranelift 0.87 now supports lowering `fma` as a libcall on x86 [0].
With 0.88 enabling the native x86 instruction under the `has_fma` flag.

aarch64 and s390x already support this as a native instruction, so it's
nice that we emit it for those.

We can't lower the SIMD version using the `fma` instruction since the
lowering can fail if the x86 `has_fma` flag is not enabled. Cranelift
doesn't yet know how to fallback for these cases

[0]: https://github.com/bytecodealliance/wasmtime/commit/709716bb8e6adaf7e65f3497168af23ce0cf09ef

22 months agoAvoid masking shift amounts (#1268)
Afonso Bordado [Tue, 23 Aug 2022 10:42:24 +0000 (11:42 +0100)]
Avoid masking shift amounts (#1268)

Cranelift 0.87 now follows its own documentation regarding
shift amounts, and implicitly masks them if the arch requires it. [0]

[0]: https://github.com/bytecodealliance/wasmtime/commit/05089321740a07757dff0a285176b2651a49aae2

22 months agoUpdate to Cranelift 0.87.0
bjorn3 [Mon, 22 Aug 2022 18:53:10 +0000 (18:53 +0000)]
Update to Cranelift 0.87.0

22 months agoRollup merge of #100822 - WaffleLapkin:no_offset_question_mark, r=scottmcm
Matthias Krüger [Sun, 21 Aug 2022 14:54:07 +0000 (16:54 +0200)]
Rollup merge of #100822 - WaffleLapkin:no_offset_question_mark, r=scottmcm

Replace most uses of `pointer::offset` with `add` and `sub`

As PR title says, it replaces `pointer::offset` in compiler and standard library with `pointer::add` and `pointer::sub`. This generally makes code cleaner, easier to grasp and removes (or, well, hides) integer casts.

This is generally trivially correct, `.offset(-constant)` is just `.sub(constant)`, `.offset(usized as isize)` is just `.add(usized)`, etc. However in some cases we need to be careful with signs of things.

r? ````@scottmcm````

_split off from #100746_

22 months agoReplace most uses of `pointer::offset` with `add` and `sub`
Maybe Waffle [Fri, 19 Aug 2022 09:33:06 +0000 (13:33 +0400)]
Replace most uses of `pointer::offset` with `add` and `sub`

22 months agoMerge pull request #1266 from bjorn3/parallel_comp_refactor2
bjorn3 [Fri, 19 Aug 2022 10:03:43 +0000 (12:03 +0200)]
Merge pull request #1266 from bjorn3/parallel_comp_refactor2

Refactorings for enabling parallel compilation (part 2)

22 months agoRollup merge of #100208 - RalfJung:dyn-upcast-nop, r=petrochenkov
Dylan DPC [Fri, 19 Aug 2022 06:56:41 +0000 (12:26 +0530)]
Rollup merge of #100208 - RalfJung:dyn-upcast-nop, r=petrochenkov

make NOP dyn casts not require anything about the vtable

As suggested [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/144729-t-types/topic/dyn-upcasting.20stabilization/near/292151439). This matches what the codegen backends already do, and what Miri did do until https://github.com/rust-lang/rust/pull/99420 when I made it super extra paranoid.

22 months agoSmall cleanup
bjorn3 [Thu, 18 Aug 2022 18:59:14 +0000 (18:59 +0000)]
Small cleanup

22 months agoMove Span lowering from debuginfo finalization to codegen
bjorn3 [Thu, 18 Aug 2022 18:19:40 +0000 (18:19 +0000)]
Move Span lowering from debuginfo finalization to codegen

This removes the dependency on TyCtxt from the debuginfo finalization
code.

22 months agoMake line_program_add_file a DebugContext method
bjorn3 [Thu, 18 Aug 2022 17:48:22 +0000 (17:48 +0000)]
Make line_program_add_file a DebugContext method

22 months agoMove set_function_span earlier
bjorn3 [Thu, 18 Aug 2022 17:23:36 +0000 (17:23 +0000)]
Move set_function_span earlier

22 months agoMove FunctionDebugContext creation to codegen_fn
bjorn3 [Thu, 18 Aug 2022 17:17:33 +0000 (17:17 +0000)]
Move FunctionDebugContext creation to codegen_fn

22 months agoIntroduce FunctionDebugContext
bjorn3 [Thu, 18 Aug 2022 17:11:41 +0000 (17:11 +0000)]
Introduce FunctionDebugContext

This will make it easier to move TyCtxt requiring operations before clif
ir compilation.

22 months agoUse walk_chain for function span too
bjorn3 [Thu, 18 Aug 2022 15:57:21 +0000 (15:57 +0000)]
Use walk_chain for function span too

This is a correctness fix

22 months agoRemove TyCtxt from DebugContext
bjorn3 [Thu, 18 Aug 2022 15:25:26 +0000 (15:25 +0000)]
Remove TyCtxt from DebugContext

And explicitly thread it through everwhere it is needed.

22 months agoRemove Instance param of DebugContext::define_function
bjorn3 [Thu, 18 Aug 2022 15:19:29 +0000 (15:19 +0000)]
Remove Instance param of DebugContext::define_function

22 months agoRemove stub local debuginfo implementation
bjorn3 [Thu, 18 Aug 2022 15:14:04 +0000 (15:14 +0000)]
Remove stub local debuginfo implementation

It isn't actually wired up and temporarily removing it will make changes
to the debuginfo generation code much simpler.

22 months agoRegister debuginfo for lazy jit shim
bjorn3 [Thu, 18 Aug 2022 12:55:44 +0000 (12:55 +0000)]
Register debuginfo for lazy jit shim

22 months agoMerge pull request #1265 from afonso360/stack_store
bjorn3 [Wed, 17 Aug 2022 14:51:02 +0000 (16:51 +0200)]
Merge pull request #1265 from afonso360/stack_store

Use `stack_store` instead of `stack_addr`+`store` when building structs

22 months agoRemove TyCtxt parameter from compile_fn
bjorn3 [Wed, 17 Aug 2022 13:47:52 +0000 (13:47 +0000)]
Remove TyCtxt parameter from compile_fn

22 months agoUse `stack_store` instead of `stack_addr`+`store` when building structs
Afonso Bordado [Wed, 17 Aug 2022 13:46:05 +0000 (14:46 +0100)]
Use `stack_store` instead of `stack_addr`+`store` when building structs

22 months agoRemove TyCtxt field from CodegenCx
bjorn3 [Wed, 17 Aug 2022 13:43:32 +0000 (13:43 +0000)]
Remove TyCtxt field from CodegenCx

22 months agoReplace instance param of write_clif_file with symbol_name
bjorn3 [Wed, 17 Aug 2022 13:07:18 +0000 (13:07 +0000)]
Replace instance param of write_clif_file with symbol_name

22 months agoRemove optimize_function
bjorn3 [Wed, 17 Aug 2022 13:03:32 +0000 (13:03 +0000)]
Remove optimize_function

It currently doesn't have any optimizations at all.

22 months agoRustup to rustc 1.65.0-nightly (801821d15 2022-08-14)
bjorn3 [Mon, 15 Aug 2022 14:21:41 +0000 (16:21 +0200)]
Rustup to rustc 1.65.0-nightly (801821d15 2022-08-14)

22 months agoSync from rust 6ce76091c7cef21692a15dce1f0a4c415d245be4
bjorn3 [Mon, 15 Aug 2022 14:17:32 +0000 (16:17 +0200)]
Sync from rust 6ce76091c7cef21692a15dce1f0a4c415d245be4

22 months agoWork around new asm! usage in measureme
bjorn3 [Sun, 14 Aug 2022 16:37:30 +0000 (16:37 +0000)]
Work around new asm! usage in measureme

This is necessary to fix rustc bootstraps

22 months agoMerge pull request #1264 from bjorn3/parallel_comp_refactor
bjorn3 [Sat, 13 Aug 2022 14:53:28 +0000 (16:53 +0200)]
Merge pull request #1264 from bjorn3/parallel_comp_refactor

Refactorings for enabling parallel compilation (part 1)

22 months agoRemove TyCtxt parameter from emit_cgu
bjorn3 [Sat, 13 Aug 2022 12:18:41 +0000 (12:18 +0000)]
Remove TyCtxt parameter from emit_cgu

TyCtxt isn't available on background threads.

22 months agoMove error reporting out of emit_cgu
bjorn3 [Sat, 13 Aug 2022 09:03:28 +0000 (09:03 +0000)]
Move error reporting out of emit_cgu

Error reporting requires a Session, which isn't available on background
threads.

22 months agoRename abi-checker patch (#1262)
Afonso Bordado [Sat, 13 Aug 2022 09:02:16 +0000 (10:02 +0100)]
Rename abi-checker patch (#1262)

22 months agoMerge pull request #1255 from afonso360/abi-checker
bjorn3 [Sat, 13 Aug 2022 06:34:55 +0000 (08:34 +0200)]
Merge pull request #1255 from afonso360/abi-checker

Add abi-checker to y.rs and run it on CI

22 months agoDisable some abi-checker tests
Afonso Bordado [Fri, 12 Aug 2022 22:47:12 +0000 (23:47 +0100)]
Disable some abi-checker tests

22 months agoUpdate abi-checker version
Afonso Bordado [Fri, 12 Aug 2022 20:47:36 +0000 (21:47 +0100)]
Update abi-checker version

22 months agoMove copy to incr comp cache to codegen join phase
bjorn3 [Fri, 12 Aug 2022 19:10:16 +0000 (19:10 +0000)]
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.

22 months agoStream object file to disk
bjorn3 [Fri, 12 Aug 2022 18:55:39 +0000 (18:55 +0000)]
Stream object file to disk

This reduces memory usage and may improve performance slightly.

22 months agoMove build_isa call into make_module
bjorn3 [Fri, 12 Aug 2022 18:40:48 +0000 (18:40 +0000)]
Move build_isa call into make_module

22 months agoDon't attempt to do incr comp for the allocator shim
bjorn3 [Fri, 12 Aug 2022 13:15:51 +0000 (13:15 +0000)]
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.

22 months agoGive fields of ModuleCodegenResult names
bjorn3 [Fri, 12 Aug 2022 13:03:18 +0000 (13:03 +0000)]
Give fields of ModuleCodegenResult names

22 months agoMerge pull request #1260 from uweigand/s390x-ignore-aligntest
bjorn3 [Fri, 12 Aug 2022 12:40:21 +0000 (14:40 +0200)]
Merge pull request #1260 from uweigand/s390x-ignore-aligntest

Ignore ptr_bitops_tagging test on s390x

22 months agoEnable inline asm on macOS
bjorn3 [Fri, 12 Aug 2022 12:30:24 +0000 (12:30 +0000)]
Enable inline asm on macOS

22 months agoRemove the partial linking hack for global asm support
bjorn3 [Fri, 12 Aug 2022 12:27:47 +0000 (12:27 +0000)]
Remove the partial linking hack for global asm support

22 months agoIgnore ptr_bitops_tagging test on s390x
Ulrich Weigand [Fri, 12 Aug 2022 11:46:31 +0000 (13:46 +0200)]
Ignore ptr_bitops_tagging test on s390x

This test requires dynamic stack re-alignment on s390x, which is
currently unsupported (see issue #1258).

22 months agoDon't take TyCtxt as argument for compile_global_asm
bjorn3 [Fri, 12 Aug 2022 09:55:59 +0000 (09:55 +0000)]
Don't take TyCtxt as argument for compile_global_asm

This allows it to be executed on a background thread.

22 months agoMerge pull request #1257 from uweigand/memcpy-align
bjorn3 [Fri, 12 Aug 2022 11:14:14 +0000 (13:14 +0200)]
Merge pull request #1257 from uweigand/memcpy-align

Fix alignment flag for emit_small_memory_copy

22 months agoFix alignment flag for emit_small_memory_copy
Ulrich Weigand [Fri, 12 Aug 2022 10:48:40 +0000 (12:48 +0200)]
Fix alignment flag for emit_small_memory_copy

Do not unconditionally pass the "aligned" MemFlag when calling
emit_small_memory_copy.  Instead, allow the back end to rely on
the alignment info passed separately to this routine.

22 months agoMove some sess.fatal calls out of compile_global_asm
bjorn3 [Fri, 12 Aug 2022 09:28:41 +0000 (09:28 +0000)]
Move some sess.fatal calls out of compile_global_asm

22 months agoExtract global_asm module
bjorn3 [Fri, 12 Aug 2022 09:11:47 +0000 (09:11 +0000)]
Extract global_asm module

22 months agoIntroduce OngoingCodegen type
bjorn3 [Thu, 11 Aug 2022 13:49:08 +0000 (13:49 +0000)]
Introduce OngoingCodegen type

22 months agoReturn ModuleCodegenResult from reuse_workproduct_for_cgu
bjorn3 [Thu, 11 Aug 2022 13:38:07 +0000 (13:38 +0000)]
Return ModuleCodegenResult from reuse_workproduct_for_cgu

22 months agoMove cached_context out of CodegenCx
bjorn3 [Wed, 10 Aug 2022 18:47:05 +0000 (18:47 +0000)]
Move cached_context out of CodegenCx

22 months agoSplit non-compile parts of codegen_fn out into a separate function
bjorn3 [Wed, 10 Aug 2022 18:29:46 +0000 (18:29 +0000)]
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.

22 months agoMove some code into codegen_fn_content
bjorn3 [Wed, 10 Aug 2022 15:06:17 +0000 (15:06 +0000)]
Move some code into codegen_fn_content

22 months agoRemove most trap functions and remove all trapnz usages
bjorn3 [Tue, 9 Aug 2022 12:27:34 +0000 (12:27 +0000)]
Remove most trap functions and remove all trapnz usages

22 months agoRustup to rustc 1.65.0-nightly (d394408fb 2022-08-07)
bjorn3 [Mon, 8 Aug 2022 16:30:01 +0000 (18:30 +0200)]
Rustup to rustc 1.65.0-nightly (d394408fb 2022-08-07)

22 months agoSync from rust f03ce30962cf1b2a5158667eabae8bf6e8d1cb03
bjorn3 [Mon, 8 Aug 2022 15:01:38 +0000 (17:01 +0200)]
Sync from rust f03ce30962cf1b2a5158667eabae8bf6e8d1cb03

22 months agoalso update anyhow in codegen_cranelift
Ralf Jung [Mon, 8 Aug 2022 13:04:26 +0000 (09:04 -0400)]
also update anyhow in codegen_cranelift

22 months agomake NOP dyn casts not require anything about the vtable
Ralf Jung [Sat, 6 Aug 2022 21:18:59 +0000 (17:18 -0400)]
make NOP dyn casts not require anything about the vtable

22 months agoMove abi-checker to y.rs test
Afonso Bordado [Sat, 6 Aug 2022 20:24:38 +0000 (21:24 +0100)]
Move abi-checker to y.rs test

22 months agoPass all pairs to abi-checker
Afonso Bordado [Sat, 6 Aug 2022 19:51:47 +0000 (20:51 +0100)]
Pass all pairs to abi-checker

22 months agoAdd abi-checker to clean_all.sh
Afonso Bordado [Sat, 6 Aug 2022 19:51:20 +0000 (20:51 +0100)]
Add abi-checker to clean_all.sh

22 months agoTest adding abi-checker to CI
Afonso Bordado [Sat, 6 Aug 2022 14:59:45 +0000 (15:59 +0100)]
Test adding abi-checker to CI

22 months agoInitial ABI Checker support
Afonso Bordado [Sat, 6 Aug 2022 12:34:55 +0000 (13:34 +0100)]
Initial ABI Checker support

22 months agoFix previous commit
bjorn3 [Fri, 5 Aug 2022 13:17:13 +0000 (13:17 +0000)]
Fix previous commit

22 months agoDisable incr comp globally on CI
bjorn3 [Fri, 5 Aug 2022 12:57:19 +0000 (12:57 +0000)]
Disable incr comp globally on CI

22 months agoRe-introduce test.sh as convenience wrapper around ./y.rs test
bjorn3 [Fri, 5 Aug 2022 12:13:57 +0000 (12:13 +0000)]
Re-introduce test.sh as convenience wrapper around ./y.rs test

22 months agoUpdate dependencies
bjorn3 [Fri, 5 Aug 2022 12:13:36 +0000 (12:13 +0000)]
Update dependencies

22 months agoMerge pull request #1254 from afonso360/float-intrinsics-fix
bjorn3 [Thu, 4 Aug 2022 16:48:09 +0000 (18:48 +0200)]
Merge pull request #1254 from afonso360/float-intrinsics-fix

Use native cranelift instructions when lowering float intrinsics

22 months agoUse native cranelift instructions when lowering float intrinsics
Afonso Bordado [Tue, 2 Aug 2022 07:08:45 +0000 (08:08 +0100)]
Use native cranelift instructions when lowering float intrinsics

22 months agoMerge pull request #1253 from afonso360/msvc-nosysroot
bjorn3 [Mon, 1 Aug 2022 20:15:02 +0000 (22:15 +0200)]
Merge pull request #1253 from afonso360/msvc-nosysroot

Fix `no_sysroot` testsuite for MSVC environments

22 months agoMisc Cleanups
Afonso Bordado [Mon, 1 Aug 2022 18:41:08 +0000 (19:41 +0100)]
Misc Cleanups

22 months agoAdd windows support to mini_core tests
Afonso Bordado [Mon, 1 Aug 2022 10:38:56 +0000 (11:38 +0100)]
Add windows support to mini_core tests

22 months agoFix mini_core printf linking on windows
Afonso Bordado [Mon, 1 Aug 2022 08:57:43 +0000 (09:57 +0100)]
Fix mini_core printf linking on windows

Link against legacy_stdio_definitions on windows which provides printf as a linkable symbol.

22 months agoDisable JIT on windows
Afonso Bordado [Mon, 1 Aug 2022 08:49:54 +0000 (09:49 +0100)]
Disable JIT on windows

23 months agoMerge pull request #1252 from afonso360/tests-rs
bjorn3 [Sun, 31 Jul 2022 10:22:22 +0000 (12:22 +0200)]
Merge pull request #1252 from afonso360/tests-rs

Move test script to y.rs

23 months agoRustfmt
bjorn3 [Sun, 31 Jul 2022 10:15:56 +0000 (10:15 +0000)]
Rustfmt

23 months agoDon't pass RUSTFLAGS to rustc in tests
Afonso Bordado [Sat, 30 Jul 2022 22:07:03 +0000 (23:07 +0100)]
Don't pass RUSTFLAGS to rustc in tests

23 months agoAssume host target in get_file_name
Afonso Bordado [Sat, 30 Jul 2022 22:04:59 +0000 (23:04 +0100)]
Assume host target in get_file_name

23 months agoDon't run tests on Windows CI
Afonso Bordado [Sat, 30 Jul 2022 21:58:34 +0000 (22:58 +0100)]
Don't run tests on Windows CI

23 months agoCleanup meaningless changes
Afonso Bordado [Sat, 30 Jul 2022 21:32:06 +0000 (22:32 +0100)]
Cleanup meaningless changes

23 months agoCompare lines iterator instead of full output
Afonso Bordado [Sat, 30 Jul 2022 21:05:39 +0000 (22:05 +0100)]
Compare lines iterator instead of full output

This avoids differences in line endings.

23 months agoLog cloned regex output
Afonso Bordado [Sat, 30 Jul 2022 20:08:59 +0000 (21:08 +0100)]
Log cloned regex output