Commit Graph

4015 Commits

Author SHA1 Message Date
Amanieu d'Antras
be4d3fb261 Update ahash dependency to 0.8.7 2024-01-30 03:34:28 +00:00
bjorn3
82d08913d8 Rustup to rustc 1.77.0-nightly (e7bbe8ce9 2024-01-26) 2024-01-27 10:53:32 +00:00
bjorn3
c71356c462 Sync from rust e7bbe8ce93 2024-01-27 10:39:20 +00:00
bjorn3
0061bb7faf Merge commit '3e50cf65025f96854d6597e80449b0d64ad89589' into sync_cg_clif-2024-01-26 2024-01-26 18:33:45 +00:00
bjorn3
3e50cf6502 Rustup to rustc 1.77.0-nightly (5bd5d214e 2024-01-25) 2024-01-26 18:24:04 +00:00
bjorn3
dff600d1d3 Sync from rust 5bd5d214ef 2024-01-26 18:11:31 +00:00
bjorn3
f78617994a Update rand test
This contains a fix for a recently introduced warning.
2024-01-26 18:08:00 +00:00
bjorn3
604c8a7cf8 Accept [u8; N] bitmasks in simd_select_bitmask
Fixes rust-lang/rustc_codegen_cranelift#1446
2024-01-26 14:19:11 +00:00
bjorn3
dc7ed1680c Update to Cranelift 0.104 2024-01-26 11:18:14 +00:00
bjorn3
1fba58ed94 Update actions/checkout and actions/cache 2024-01-26 11:06:55 +00:00
David Tolnay
b192f911d5 Rebase slice_group_by stabilization PR 2024-01-25 22:20:59 -08:00
bors
e8d600fd23 Auto merge of #116167 - RalfJung:structural-eq, r=lcnr
remove StructuralEq trait

The documentation given for the trait is outdated: *all* function pointers implement `PartialEq` and `Eq` these days. So the `StructuralEq` trait doesn't really seem to have any reason to exist any more.

One side-effect of this PR is that we allow matching on some consts that do not implement `Eq`. However, we already allowed matching on floats and consts containing floats, so this is not new, it is just allowed in more cases now. IMO it makes no sense at all to allow float matching but also sometimes require an `Eq` instance. If we want to require `Eq` we should adjust https://github.com/rust-lang/rust/pull/115893 to check for `Eq`, and rule out float matching for good.

Fixes https://github.com/rust-lang/rust/issues/115881
2024-01-26 00:17:00 +00:00
bjorn3
7d3b29399d Use sess.cfg_version instead of rustc_version_str()
This makes it easier to patch cg_clif to be statically linked as part of
rustc.
2024-01-25 21:21:27 +00:00
bors
50a067d7f8 Auto merge of #119911 - NCGThompson:is-statically-known, r=oli-obk
Replacement of #114390: Add new intrinsic `is_var_statically_known` and optimize pow for powers of two

This adds a new intrinsic `is_val_statically_known` that lowers to [``@llvm.is.constant.*`](https://llvm.org/docs/LangRef.html#llvm-is-constant-intrinsic).` It also applies the intrinsic in the int_pow methods to recognize and optimize the idiom `2isize.pow(x)`. See #114390 for more discussion.

While I have extended the scope of the power of two optimization from #114390, I haven't added any new uses for the intrinsic. That can be done in later pull requests.

Note: When testing or using the library, be sure to use `--stage 1` or higher. Otherwise, the intrinsic will be a noop and the doctests will be skipped. If you are trying out edits, you may be interested in [`--keep-stage 0`](https://rustc-dev-guide.rust-lang.org/building/suggested.html#faster-builds-with---keep-stage).

Fixes #47234
Resolves #114390
`@Centri3`
2024-01-25 05:16:53 +00:00
Ralf Jung
adbc67664b remove StructuralEq trait 2024-01-24 07:56:23 +01:00
Nicholas Thompson
55e04d5236 Further Implement is_val_statically_known 2024-01-23 12:02:31 -05:00
Michael Goulet
0c83e434e1 Do not normalize closure signature when building FnOnce shim 2024-01-22 16:50:30 +00:00
bjorn3
24361a1b99 Fix portable-simd tests 2024-01-21 11:38:13 +00:00
bjorn3
60ef392a2a Rustup to rustc 1.77.0-nightly (4cb17b4e7 2024-01-20) 2024-01-21 11:16:00 +00:00
bjorn3
9ab85888b3 Sync from rust 4cb17b4e78 2024-01-21 10:51:49 +00:00
Matthias Krüger
d390c002ae Rollup merge of #119815 - nagisa:nagisa/polishes-libloading-use-somewhat, r=bjorn3
Format sources into the error message when loading codegen backends

cc https://github.com/rust-lang/rustc_codegen_cranelift/issues/1447
cc `@bjorn3`
2024-01-19 19:27:00 +01:00
Martin Nordholts
f40f996562 compiler: Lower fn call arg spans down to MIR
To enable improved accuracy of diagnostics in upcoming commits.
2024-01-15 19:07:11 +01:00
Simonas Kazlauskas
be1b86fef4 Format sources into the error message when loading codegen backends
cc https://github.com/rust-lang/rustc_codegen_cranelift/issues/1447
2024-01-10 18:00:38 +02:00
Simonas Kazlauskas
c8875309b8 deps: deduplicate the version of libloading used
The changelog can be found here:
https://docs.rs/libloading/latest/libloading/changelog/r0_8_0/index.html
2024-01-10 17:18:10 +02:00
bjorn3
0dc13d7acb Implement _mm_prefetch as nop 2024-01-09 23:38:55 +01:00
Guillaume Gomez
18e12dcf6b Rollup merge of #117556 - obeis:static-mut-ref-lint, r=davidtwco
Disallow reference to `static mut` and adding `static_mut_ref` lint

Closes #114447

r? `@scottmcm`
2024-01-09 13:23:15 +01:00
Matthias Krüger
a2a9032d1b Rollup merge of #118903 - azhogin:azhogin/skip_second_stmt_debuginfo.rs, r=petrochenkov
Improved support of collapse_debuginfo attribute for macros.

Added walk_chain_collapsed function to consider collapse_debuginfo attribute in parent macros in call chain.
Fixed collapse_debuginfo attribute processing for cranelift (there was if/else branches error swap).

cc https://github.com/rust-lang/rust/issues/100758
2024-01-09 00:19:32 +01:00
Andrew Zhogin
2b3cd46832 Improved support of collapse_debuginfo attribute for macros. 2024-01-08 17:47:18 +07:00
Nicholas Nethercote
e6570dcccc Use chaining for DiagnosticBuilder construction and emit.
To avoid the use of a mutable local variable, and because it reads more
nicely.
2024-01-08 15:45:29 +11:00
Obei Sideg
837c0305c6 Update test for E0796 and static_mut_ref lint 2024-01-07 17:29:25 +03:00
bjorn3
f69c2e768f
Merge pull request #1445 from matthiaskrgr/clippy_jan2024
fix a couple of clippy warnings
2024-01-06 15:50:43 +01:00
Matthias Krüger
74987d04fc fix a couple of clippy warnings 2024-01-05 22:40:25 +01:00
bjorn3
b0250fca19
Merge pull request #1444 from Nilstrieb/ra-rustc
Use `rust-analyzer.rustc.source` to get r-a working with rustc
2024-01-04 15:28:36 +01:00
Nilstrieb
6fea128f8c Use rust-analyzer.rustc.source to get r-a working with rustc 2024-01-04 15:24:51 +01:00
bjorn3
b3b36e91c6
Merge pull request #1443 from Nilstrieb/x86-signed-pack
Restructure x86 signed pack instructions
2024-01-03 20:43:24 +01:00
Nilstrieb
22019dbac8 Mention correctness test 2024-01-03 20:28:08 +01:00
Nilstrieb
c8f5d35508 Restructure x86 signed pack instructions
This reduces the amount of duplicated code and the chance for bugs.

I validated the new code for correctness against LLVM using the
following script. It found many bugs in the implementation until I was
finally able to get it correct and passing.

```rust
//! Test for x86 pack instructions. Prints deterministic results, use it to compare backends.
use std::arch::x86_64::{self, __m128i, __m256i};
use rand::{rngs::SmallRng, Rng, SeedableRng};
fn main() {
    let rng = &mut SmallRng::seed_from_u64(123);
    for _ in 0..100_000 {
        unsafe {
            sse_test(rng);
            avx_test(rng);
        }
    }
}
unsafe fn sse_test(rng: &mut SmallRng) {
    print_sse_8(x86_64::_mm_packus_epi16(sse16(rng), sse16(rng)));
    print_sse_8(x86_64::_mm_packs_epi16(sse16(rng), sse16(rng)));
    print_sse_16(x86_64::_mm_packus_epi32(sse32(rng), sse32(rng)));
    print_sse_16(x86_64::_mm_packs_epi32(sse32(rng), sse32(rng)));
}
unsafe fn avx_test(rng: &mut SmallRng) {
    print_avx_8(x86_64::_mm256_packs_epi16(avx16(rng), avx16(rng)));
    print_avx_8(x86_64::_mm256_packs_epi16(avx16(rng), avx16(rng)));
    print_avx_16(x86_64::_mm256_packus_epi32(avx32(rng), avx32(rng)));
    print_avx_16(x86_64::_mm256_packs_epi32(avx32(rng), avx32(rng)));
}
fn print_sse_8(t: __m128i) {
    let ints = unsafe { std::mem::transmute::<_, [i8; 16]>(t) };
    println!("{ints:?}");
}
fn print_sse_16(t: __m128i) {
    let ints = unsafe { std::mem::transmute::<_, [i16; 8]>(t) };
    println!("{ints:?}");
}
fn print_avx_8(t: __m256i) {
    let ints = unsafe { std::mem::transmute::<_, [i8; 32]>(t) };
    println!("{ints:?}");
}
fn print_avx_16(t: __m256i) {
    let ints = unsafe { std::mem::transmute::<_, [i16; 16]>(t) };
    println!("{ints:?}");
}
fn sse16(rand: &mut SmallRng) -> __m128i {
    unsafe { std::mem::transmute([(); 8].map(|()| i16(rand))) }
}
fn sse32(rand: &mut SmallRng) -> __m128i {
    unsafe { std::mem::transmute([(); 4].map(|()| i32(rand))) }
}
fn avx16(rand: &mut SmallRng) -> __m256i {
    unsafe { std::mem::transmute([(); 16].map(|()| i16(rand))) }
}
fn avx32(rand: &mut SmallRng) -> __m256i {
    unsafe { std::mem::transmute([(); 8].map(|()| i32(rand))) }
}
fn i16(rand: &mut SmallRng) -> i16 {
    if rand.gen() {
        rand.gen::<i16>()
    } else {
        rand.gen::<i8>() as i16
    }
}
fn i32(rand: &mut SmallRng) -> i32 {
    if rand.gen() {
        rand.gen::<i32>()
    } else {
        rand.gen::<i16>() as i32
    }
}
```
2024-01-03 20:25:44 +01:00
bjorn3
3b8794edf4 Fix xmm operands in inline assembly 2024-01-03 11:08:32 +00:00
bjorn3
45d8c121ba Return architecturally mandated target features to rustc
In the future the actual target features that Cranelift enables should
be returned here, but for now this works.

Fixes rust-lang/rustc_codegen_cranelift#1438
2024-01-02 21:17:00 +00:00
bjorn3
c427754b52 Add platform support matrix
Fixes rust-lang/rustc_codegen_cranelift#1441
2024-01-02 20:39:31 +00:00
bjorn3
0c72b43614 Merge branch 'sync_from_rust' 2023-12-31 13:31:46 +00:00
bjorn3
0cfbc47b9a Merge commit '6d355f6844323db03bfd608899613e363e701951' into sync_cg_clif-2023-12-31 2023-12-31 13:29:53 +00:00
bjorn3
6d355f6844
Merge pull request #1440 from rust-lang/ci_speedup_and_cleanup
Slightly reduce CI runtime and reduce log verbosity
2023-12-31 14:26:48 +01:00
bjorn3
c55aaa55a7 Remove no longer needed config option from setup_rust_fork.sh 2023-12-31 12:39:20 +00:00
bjorn3
02183f79e4 Suppress default config change warnings 2023-12-31 12:22:38 +00:00
bjorn3
d58de3ea81 Suppress progress notifications for all git commands 2023-12-31 11:53:42 +00:00
bjorn3
3fa4efffb0 Install ripgrep using the system package manager 2023-12-31 11:14:50 +00:00
bjorn3
e2502acd15 Update the GHA artifacts actions to v4 2023-12-31 11:04:53 +00:00
bjorn3
4b239facd7 Install hyperfine using the system package manager 2023-12-31 11:01:07 +00:00
bjorn3
75f1c2b5a7 Rustup to rustc 1.77.0-nightly (2a3e63551 2023-12-30) 2023-12-31 10:46:02 +00:00