Commit Graph

1666 Commits

Author SHA1 Message Date
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 ec92c3e5dc Fix ICE on incompatible declarations of entry symbol
Fixes #1313
2022-12-16 09:57:07 +00:00
bjorn3 b5ac64b4cf Don't PrintOnPanic on fatal errors 2022-12-16 09:44:28 +00:00
bjorn3 9ca82a9a3d Fix ICE on unsized locals
Fixes #1312
2022-12-16 09:41:36 +00:00
bjorn3 d841f93855 Add .comment section with producer name
Fixes #1211
2022-12-15 13:57:13 +00:00
bjorn3 06be70e3d6 Implement simd_gather and simd_scatter (#1309)
These are the last remaining platform intrinsics necessary for portable-simd.
2022-12-15 13:09:37 +01:00
bjorn3 f626185a5b Update portable-simd to 582239ac3b 2022-12-15 11:09:45 +00:00
bjorn3 08ba5d4e80 Remove a couple of module.isa() calls 2022-12-14 12:25:53 +00:00
bjorn3 e3d70e266b Sync from rust ed620cf969 2022-12-13 18:18:47 +01:00
Michael Goulet f7c76ad662 bug! with a better error message for failing Instance::resolve 2022-12-11 19:48:24 +00:00
bjorn3 21f43556ac Fix for "Support Option and similar enums as type of static variable with linkage attribute"
cc rust-lang/rust#104799
2022-12-11 10:56:54 +00:00
bjorn3 8f9a048138 Sync from rust b3ddfeb5a8 2022-12-11 11:05:00 +01:00
Jakob Degen 34336b8d94 Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
bjorn3 b8a3c2dd30 Sync from rust fd02567705 2022-12-04 10:26:24 +01:00
bors f1dc349c4b Auto merge of #97485 - bjorn3:new_archive_writer, r=wesleywiser
Rewrite LLVM's archive writer in Rust

This allows it to be used by other codegen backends.

Fixes https://github.com/bjorn3/rustc_codegen_cranelift/issues/1155
2022-12-03 15:07:39 +00:00
bjorn3 04eaaa043d Fix crash with TAIT in the call codegen code
The new logic is closer to what cg_llvm does.

Fixes #1240
2022-12-02 12:44:14 +00:00
bjorn3 155f569794 Update cranelift to the upcoming release-3.0.0 branch 2022-12-01 17:45:59 +00:00
bjorn3 3df425e11e bswap.i128 is now supported 2022-12-01 17:45:59 +00:00
bjorn3 83dc7d1a12 Fix for removal of raw_bitcast 2022-12-01 17:45:59 +00:00
bjorn3 ae98a2f570 Simplify some code based on newly implemented instructions 2022-12-01 17:45:59 +00:00
bjorn3 777106a581 Fix warning 2022-12-01 17:45:59 +00:00
bjorn3 16a2641444 Remove all usages of iconst.i128
Support was removed from Cranelift
2022-12-01 17:45:59 +00:00
bjorn3 6768d0dd72 Booleans have been removed from Cranelift 2022-12-01 17:45:59 +00:00
bjorn3 052d5ccf5d Implement __isb for AArch64
This is necessary for the mutex implementation of libstd when there is
contention. Seems like I hadn't hit this before by sheer luck.
2022-11-28 13:03:47 +00:00
bjorn3 f851dfacfe Rustfmt 2022-11-27 18:34:07 +00:00
bjorn3 75838d9e8b Implement more llvm simd intrinsics for AArch64 2022-11-27 18:32:29 +00:00
bjorn3 1367983198 Begin implementing llvm simd intrinsics for aarch64 2022-11-27 18:09:57 +00:00
bjorn3 ef6400d6be Split x86 specific intrinsics into intrinsics/llvm_x86.rs 2022-11-27 17:17:47 +00:00
Maybe Waffle a085a2ad2d Prefer doc comments over //-comments in compiler 2022-11-27 11:19:04 +00:00
bjorn3 5399526aee Rewrite LLVM's archive writer in Rust
This allows it to be used by other codegen backends
2022-11-26 19:35:32 +00:00
Guillaume Gomez 69a7692c91 Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errors
Use the power of adding helper function to simplify code w/ `Mutability`

r? `@compiler-errors`
2022-11-26 17:47:23 +01:00
bors 982798faa7 Auto merge of #104507 - WaffleLapkin:asderefsyou, r=wesleywiser
Use `as_deref` in compiler (but only where it makes sense)

This simplifies some code :3

(there are some changes that are not exacly `as_deref`, but more like "clever `Option`/`Result` method use")
2022-11-24 00:17:35 +00:00
Maybe Waffle bcee07e78d Add Mutability::{is_mut,is_not} 2022-11-23 20:26:31 +00:00
bjorn3 d23eb65ea0 Sync from rust 66ccf36f16 2022-11-22 19:21:05 +01:00
bjorn3 a449d0d143 Rustfmt 2022-11-21 17:00:28 +00:00
bjorn3 cf923724cc Fix discriminant handling 2022-11-21 16:29:09 +00:00
Matthias Krüger d3817e2339 Rollup merge of #104605 - RalfJung:clf_consts, r=bjorn3
deduplicate constant evaluation in cranelift backend

The cranelift backend had two matches on `ConstantKind`, which can be avoided, and used this `eval_for_mir` that nothing else uses... this makes things more consistent with the (better-tested) LLVM backend.

I noticed this because cranelift was the only user of `eval_for_mir`. However `try_eval_for_mir` still has one other user in `eval`... the odd thing is that the interpreter has its own `eval_mir_constant` which seems to duplicate the same functionality and does not use `try_eval_for_mir`. No idea what is happening here.

r? ``@bjorn3``
Cc ``@lcnr``
2022-11-21 14:11:12 +01:00
bjorn3 d6b54a5433 Sync from rust 5e6de2369c 2022-11-19 15:23:58 +01:00
Ralf Jung a3c89a7ade deduplicate constant evaluation in cranelift backend
also sync LLVM and cranelift structure a bit
2022-11-19 14:08:12 +01:00
Dylan DPC 5fd3e4dabb Rollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3
Improve generating Custom entry function

This commit is aimed at making compiler-generated entry functions (Basically just C `main` right now) more generic so other targets can do similar things for custom entry. This was initially implemented as part of https://github.com/rust-lang/rust/pull/100316.

Currently, this moves the entry function name and Call convention to the target spec.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-19 11:54:43 +05:30
Ayush Singh 6ee9712cd4 Use custom entry name in cranelift
This is a continuation of 9f0a8620bd for
cranelift.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-17 15:28:47 +05:30
Maybe Waffle 268219da02 Use as_deref in compiler (but only where it makes sense) 2022-11-16 21:58:58 +00:00
Ralf Jung 2d0c41a9a3 cleanup and dedupe CTFE and Miri error reporting 2022-11-16 10:13:29 +01:00
bors 03e3cc5b77 Auto merge of #104054 - RalfJung:byte-provenance, r=oli-obk
interpret: support for per-byte provenance

Also factors the provenance map into its own module.

The third commit does the same for the init mask. I can move it in a separate PR if you prefer.

Fixes https://github.com/rust-lang/miri/issues/2181

r? `@oli-obk`
2022-11-15 17:37:15 +00:00
Ralf Jung f5caaea98a add is_sized method on Abi and Layout, and use it 2022-11-13 12:23:53 +01:00
Joshua Nelson ade426fa83 Fix rustdoc --version when used with download-rustc
Previously, rustdoc would unconditionally report the version that *rustc* was compiled with.
That showed things like `nightly-2022-10-30`, which wasn't right, since this was a `dev` build compiled from source.

Fix it by changing `rustc_driver::version` to a macro expanded at invocation time.
2022-11-09 02:54:51 -06:00
Ralf Jung b5523e3e7a fix cranelift and gcc 2022-11-06 14:17:10 +01:00
bjorn3 7941cba900 Remove some commented out code 2022-11-03 13:48:16 +00:00
bjorn3 736fac8ab9 Sync from rust 432b1a4277 2022-11-03 12:09:35 +01:00