Commit Graph

4539 Commits

Author SHA1 Message Date
bjorn3
632ccacd81 Sync from rust 6b6a867ae9 2024-11-28 17:36:44 +00:00
Matthias Krüger
e73d32190b Rollup merge of #131664 - taiki-e:s390x-asm-vreg-inout, r=Amanieu
Support input/output in vector registers of s390x inline assembly (under asm_experimental_reg feature)

This extends currently clobber-only vector registers (`vreg`) support to allow passing `#[repr(simd)]` types, floats (f32/f64/f128), and integers (i32/i64/i128) as input/output.

This is unstable and gated under new `#![feature(asm_experimental_reg)]` (tracking issue: https://github.com/rust-lang/rust/issues/133416). If the feature is not enabled, only clober is supported as before.

| Architecture | Register class | Target feature | Allowed types |
| ------------ | -------------- | -------------- | -------------- |
| s390x | `vreg` | `vector` | `i32`, `f32`, `i64`, `f64`, `i128`, `f128`, `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2` |

This matches the list of types that are supported by the vector registers in LLVM:
https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td#L301-L313

In addition to `core::simd` types and floats listed above, custom `#[repr(simd)]` types of the same size and type are also allowed. All allowed types other than i32/f32/i64/f64/i128, and relevant target features are currently unstable.

Currently there is no SIMD type for s390x in `core::arch`, but this is tracked in https://github.com/rust-lang/rust/issues/130869.

cc https://github.com/rust-lang/rust/issues/130869 about vector facility support in s390x
cc https://github.com/rust-lang/rust/issues/125398 & https://github.com/rust-lang/rust/issues/116909 about f128 support in asm

`@rustbot` label +O-SystemZ +A-inline-assembly
2024-11-25 07:01:37 +01:00
Taiki Endo
1876e520e8 Make s390x non-clobber-only vector register support unstable 2024-11-24 21:42:22 +09:00
lcnr
510943ab55 remove remaining references to Reveal 2024-11-23 13:52:56 +01:00
bjorn3
fdca75c263 Refactor and reduce usage of RelPath 2024-11-21 17:51:18 +00:00
bjorn3
5763c09be1 Remove RelPath::DOWNLOAD 2024-11-21 17:51:14 +00:00
bjorn3
4f213adf09 Inline all RelPath::ensure_fresh 2024-11-21 17:44:01 +00:00
bjorn3
1c372caa33 Make the cold_path intrinsic mark the current block as cold 2024-11-21 14:40:20 +00:00
bjorn3
cb51cfe3d0 Simplify config.rs 2024-11-21 13:06:30 +00:00
bjorn3
5644a0879c Stop passing BackendConfig to run_jit 2024-11-21 13:00:00 +00:00
bjorn3
56a64baa03 Avoid Cell in CodegenCx 2024-11-21 12:49:45 +00:00
bjorn3
5d5cd2a22b Avoid RefCell in CodegenBackend 2024-11-21 12:48:12 +00:00
bjorn3
bd209edb7d Remove disable_incr_cache from BackendConfig 2024-11-21 12:44:54 +00:00
bjorn3
1cc10793f3 Remove enable_verifier from BackendConfig 2024-11-21 12:38:14 +00:00
bjorn3
ebacaee16b Update to Cranelift 0.114 2024-11-21 12:04:27 +00:00
bjorn3
9d1de630fc Fix rustc test suite 2024-11-21 11:42:39 +00:00
bjorn3
a960aac0ba Rustup to rustc 1.84.0-nightly (3fee0f12e 2024-11-20) 2024-11-21 10:31:35 +00:00
bjorn3
d09f798235 Sync from rust 3fee0f12e4 2024-11-21 10:04:31 +00:00
Ding Xiang Fei
329cd79cb4 reduce false positives of tail-expr-drop-order from consumed values
take 2

open up coroutines

tweak the wordings

the lint works up until 2021

We were missing one case, for ADTs, which was
causing `Result` to yield incorrect results.

only include field spans with significant types

deduplicate and eliminate field spans

switch to emit spans to impl Drops

Co-authored-by: Niko Matsakis <nikomat@amazon.com>

collect drops instead of taking liveness diff

apply some suggestions and add explantory notes

small fix on the cache

let the query recurse through coroutine

new suggestion format with extracted variable name

fine-tune the drop span and messages

bugfix on runtime borrows

tweak message wording

filter out ecosystem types earlier

apply suggestions

clippy

check lint level at session level

further restrict applicability of the lint

translate bid into nop for stable mir

detect cycle in type structure
2024-11-20 20:53:11 +08:00
bors
67c8877102 Auto merge of #133212 - lcnr:questionable-uwu, r=compiler-errors
continue `ParamEnv` to `TypingEnv` transition

cc #132279

r? `@compiler-errors`
2024-11-20 06:22:01 +00:00
lcnr
bf45e9f7f3 InterpCx store TypingEnv instead of a ParamEnv 2024-11-19 21:36:23 +01:00
lcnr
a4acd22dbb move fn is_item_raw to TypingEnv 2024-11-19 18:06:20 +01:00
Jieyou Xu
c5c3709d80 Explicitly disable llvm tools for cranelift 2024-11-19 20:29:54 +08:00
bors
43181b4d75 Auto merge of #132460 - lcnr:questionable-uwu, r=compiler-errors
Use `TypingMode` throughout the compiler instead of `ParamEnv`

Hopefully the biggest single PR as part of https://github.com/rust-lang/types-team/issues/128.

## `infcx.typing_env` while defining opaque types

I don't know how'll be able to correctly handle opaque types when using something taking a `TypingEnv` while defining opaque types. To correctly handle the opaques we need to be able to pass in the current `opaque_type_storage` and return constraints, i.e. we need to use a proper canonical query. We should migrate all the queries used during HIR typeck and borrowck where this matters to proper canonical queries. This is

## `layout_of` and `Reveal::All`

We convert the `ParamEnv` to `Reveal::All` right at the start of the `layout_of` query, so I've changed callers of `layout_of` to already use a post analysis `TypingEnv` when encountering it.

ca87b535a0/compiler/rustc_ty_utils/src/layout.rs (L51)

## `Ty::is_[unpin|sized|whatever]`

I haven't migrated `fn is_item_raw` to use `TypingEnv`, will do so in a followup PR, this should significantly reduce the amount of `typing_env.param_env`. At some point there will probably be zero such uses as using the type system while ignoring the `typing_mode` is incorrect.

## `MirPhase` and phase-transitions

When inside of a MIR-body, we can mostly use its `MirPhase` to figure out the right `typing_mode`. This does not work during phase transitions, most notably when transitioning from `Analysis` to `Runtime`:

dae7ac133b/compiler/rustc_mir_transform/src/lib.rs (L606-L625)

All these passes still run with `MirPhase::Analysis`, but we should only use `Reveal::All` once we're run the `RevealAll` pass. This required me to manually construct the right `TypingEnv` in all these passes. Given that it feels somewhat easy to accidentally miss this going forward, I would maybe like to change `Body::phase` to an `Option` and replace it at the start of phase transitions. This then makes it clear that the MIR is currently in a weird state.

r? `@ghost`
2024-11-18 21:07:05 +00:00
lcnr
19a8eb2a7f use TypingEnv when no infcx is available
the behavior of the type system not only depends on the current
assumptions, but also the currentnphase of the compiler. This is
mostly necessary as we need to decide whether and how to reveal
opaque types. We track this via the `TypingMode`.
2024-11-18 10:38:56 +01:00
Ralf Jung
22b0e3c0d4 remove pointless cold_path impl in interpreter 2024-11-18 08:41:28 +01:00
Jiri Bobek
1a27566d20 Likely unlikely fix 2024-11-17 21:49:10 +01:00
bjorn3
0b8e94eb69
Merge pull request #1542 from rust-lang/disable_verifier
Disable clif ir verifier by default
2024-11-12 20:51:13 +01:00
bjorn3
b98b620500 Disable clif ir verifier by default
It's been a while since it last found something outside of development,
yet it is rather expensive. It is still enabled when debug assertions
are enabled for cg_clif or when -Z verify-llvm-ir=yes is passed.
2024-11-12 19:20:26 +00:00
bjorn3
89c5aa9e85 Fix rustc test suite 2024-11-12 19:11:47 +00:00
bjorn3
35e138e7de Rustup to rustc 1.84.0-nightly (81eef2d36 2024-11-11) 2024-11-12 18:43:40 +00:00
bjorn3
995ccb684b Add a default implementation for CodegenBackend::link
As a side effect this should add raw-dylib support to cg_gcc as the
default ArchiveBuilderBuilder that is used implements
create_dll_import_lib. I haven't tested if the raw-dylib support
actually works however.
2024-11-09 20:42:56 +00:00
bjorn3
ee20de5a6b Merge branch 'sync_from_rust' 2024-11-09 13:51:15 +00:00
bjorn3
df983ce470 Merge commit '1fa693ca4462fc1f790693464cf765ad693616af' into sync_cg_clif-2024-11-09 2024-11-09 13:48:06 +00:00
bjorn3
1fa693ca44 Rustup to rustc 1.84.0-nightly (59cec72a5 2024-11-08) 2024-11-09 13:28:28 +00:00
bjorn3
cc7d30ab57 Sync from rust 59cec72a57 2024-11-09 11:18:02 +00:00
bjorn3
e9ac680447
Merge pull request #1541 from rust-lang/perf_opts
Use a BufWriter in emit_module to reduce syscall overhead
2024-11-09 12:14:06 +01:00
bjorn3
8a0053e9e1 Use a BufWriter in emit_module to reduce syscall overhead
For the coercions rustc-perf benchmark without this commit reduces the
total amount of time it takes to emit the object file from 270ms to
27ms.
2024-11-08 16:43:25 +01:00
bjorn3
c637a84ad4 Add finish_ongoing_codegen timer in join_codegen to match cg_llvm 2024-11-08 16:14:09 +01:00
Ralf Jung
00354ddaa6 remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead 2024-11-08 09:16:00 +01:00
Ralf Jung
ba6a38495f remove 'platform-intrinsic' ABI leftovers 2024-11-07 17:42:49 +01:00
bjorn3
b5966e4e88 Fix bootstrap test 2024-11-07 11:34:46 +00:00
bjorn3
b71483b2a1 Rustup to rustc 1.84.0-nightly (854980293 2024-11-06) 2024-11-07 10:40:15 +00:00
bjorn3
e7279c86be Sync from rust 8549802939 2024-11-07 09:45:59 +00:00
bjorn3
aedbae6ccc
Merge pull request #1540 from workingjubilee/directly-use-rustc-abi
cg_clif: Directly use rustc_abi
2024-11-03 15:38:12 +01:00
bjorn3
5e1298ccdb Revert "Skip testing extended_sysroot tests with cg_llvm on CI"
This reverts commit 521288ef0f.

I got what it tests backwards. It tests against a sysroot compiled with
LLVM. Not with the LLVM backend. The latter is done by the test_llvm CI
job.
2024-11-03 14:37:10 +00:00
Jubilee Young
42f71282a7 cg_clif: Directly use rustc_abi 2024-11-03 14:30:03 +00:00
bjorn3
521288ef0f Skip testing extended_sysroot tests with cg_llvm on CI 2024-11-03 13:47:58 +00:00
bjorn3
29d225d665 Manual rustup to rustc 1.84.0-nightly (b3f75cc87 2024-11-02) 2024-11-03 13:24:53 +00:00
bors
12677fd3d0 Auto merge of #132526 - bjorn3:sync_cg_clif-2024-11-02, r=bjorn3
Subtree sync for rustc_codegen_cranelift

The highlight this time is an update to Cranelift 0.113,

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2024-11-03 05:03:52 +00:00