Skip to content

Inefficient compiler optimization between stable versions on nightly #123262

Open

Description

I have been recently been working on a logic simulator that requires building on the nightly channel. With the release of Rust 1.77.1, I subsequently updated my version from nightly-2024-02-08 to nightly-2024-03-28 and instantly noticed a drastic performance impact. Upon further investigation, starting from nightly-2024-02-12 and onwards, the compiler is no longer able to optimize my multiplexor function.

The godbolt link is unintentionally misleading with its versions. Strangely, this regression does not happen on the equivalent stable channel versions (1.76.0 and 1.77.1), and the reason why this happens only on nightly is beyond my current knowledge.

rustc --version --verbose: (The first bad version, and I think the dates are shifted because of time zones)

rustc 1.78.0-nightly (1a648b397 2024-02-11)
binary: rustc
commit-hash: 1a648b397dedc98ada3dd3360f6d661ec2436c56
commit-date: 2024-02-11
host: aarch64-apple-darwin
release: 1.78.0-nightly
LLVM version: 17.0.6

I'm not sure which regression label to mark this issue with, since it's occurred between stable versions but on the nightly channel, so I'll omit one for now.

@rustbot modify labels: -regression-untriaged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-mir-optArea: MIR optimizationsC-bugCategory: This is a bug.I-slowIssue: Problems and improvements with respect to performance of generated code.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions