Skip to content

Missed optimization: Array shadowed in same scope of declaration unnecessarily copied. #72313

Description

@PrototypeNM1

Edit: initial attempt at reducing the scope led to an incorrect example, updating with the motivating example.

https://rust.godbolt.org/z/g4imX-

The above shadow on line 119 let position_deltas = position_deltas; results in a series of vmovups, but should be optimized to a noop.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-mir-optArea: MIR optimizationsA-mir-opt-nrvoFixed by the Named Return Value Opt. (NRVO)C-enhancementCategory: An issue proposing an enhancement or a PR with one.C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchE-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-slowIssue: Problems and improvements with respect to performance of generated code.T-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