-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen #115236
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
#[no_mangle] | ||
// CHECK-LABEL: @replace_short_array_4( | ||
pub fn replace_short_array_4(r: &mut [u32; 4], v: [u32; 4]) -> [u32; 4] { | ||
// CHECK-NOT: alloca | ||
// CHECK: %[[R:.+]] = load <4 x i32>, ptr %r, align 4 | ||
// CHECK: store <4 x i32> %[[R]], ptr %result | ||
// CHECK: %[[V:.+]] = load <4 x i32>, ptr %v, align 4 | ||
// CHECK: store <4 x i32> %[[V]], ptr %r |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RIP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me unless you want a specific review
@bors r=compiler-errors rollup=never |
note that this is also what killed the MIPS backend so it seems reasonable to believe that LLVM backends are not good at this in general |
☀️ Test successful - checks-actions |
1 similar comment
☀️ Test successful - checks-actions |
Finished benchmarking commit (766c0c0): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 631.911s -> 631.395s (-0.08%) |
Beta nominationThis is to address the perf hit seen in #115212 It should be very safe, since it's only one line of product code, and all it does is disable #111999 in more cases, leaving those cases to use the same codepath as in 1.71. (It would also be possible to disable 111999 entirely, but I've also seen cases like https://rust.godbolt.org/z/7s9ob85ja where the vector codegen helps avoid byte-by-byte EDIT: The original issue reporter confirmed in #115212 (comment) that this fixes it. |
Beta backport accepted as per compiler team on Zulip Also in favor of a stable backport in case a 1.72.1 materializes (zulip comment). @rustbot label +beta-accepted +stable-accepted |
[beta] backports - Contents of reachable statics is reachable rust-lang#115114 - Revert "Suggest using `Arc` on `!Send`/`!Sync` types" rust-lang#115311 - Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236 - Do not forget to pass DWARF fragment information to LLVM. rust-lang#115139 - rustdoc: use unicode-aware checks for redundant explicit link fastpath rust-lang#115070 r? cuviper
…Simulacrum [stable] 1.72.1 release This backports: * Remove assert that checks type equality rust-lang#115215 * implied bounds: do not ICE on unconstrained region vars rust-lang#115559 * rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276 * Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236 * Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948 Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test). r? `@Mark-Simulacrum`
…Simulacrum [stable] 1.72.1 release This backports: * Remove assert that checks type equality rust-lang#115215 * implied bounds: do not ICE on unconstrained region vars rust-lang#115559 * rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276 * Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236 * Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948 Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test). r? `@Mark-Simulacrum`
…Simulacrum [stable] 1.72.1 release This backports: * Remove assert that checks type equality rust-lang#115215 * implied bounds: do not ICE on unconstrained region vars rust-lang#115559 * rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276 * Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236 * Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948 Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test). r? `@Mark-Simulacrum`
…Simulacrum [stable] 1.72.1 release This backports: * Remove assert that checks type equality rust-lang#115215 * implied bounds: do not ICE on unconstrained region vars rust-lang#115559 * rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276 * Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236 * Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948 Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test). r? `@Mark-Simulacrum`
…Simulacrum [stable] 1.72.1 release This backports: * Remove assert that checks type equality rust-lang#115215 * implied bounds: do not ICE on unconstrained region vars rust-lang#115559 * rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276 * Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236 * Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948 Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test). r? `@Mark-Simulacrum`
…Simulacrum [stable] 1.72.1 release This backports: * Remove assert that checks type equality rust-lang#115215 * implied bounds: do not ICE on unconstrained region vars rust-lang#115559 * rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276 * Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236 * Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948 Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test). r? `@Mark-Simulacrum`
…Simulacrum [stable] 1.72.1 release This backports: * Remove assert that checks type equality rust-lang#115215 * implied bounds: do not ICE on unconstrained region vars rust-lang#115559 * rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276 * Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236 * Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948 Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test). r? `@Mark-Simulacrum`
> 1.72.1 resolves a few regressions introduced in 1.72.0: > - [Partially revert codegen change, improving codegen](rust-lang/rust#115236) > - [rustdoc: Fix self ty params in objects with lifetimes](rust-lang/rust#115276) > - [Fix regression in compile times](rust-lang/rust#114948) > - Resolve some ICEs in the compiler: > - [#115215](rust-lang/rust#115215) > - [#115559](rust-lang/rust#115559)
Fixes #115212
It's unclear what makes this not work sometimes, since it often does work, so for now just disable the unusual cases. A future PR can consider doing something smarter, but this is an easy and safe tweak that we can do to resolve the regressions for now.