-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[mir-opt] avoid *& when reading primitive from slice #138936
Copy link
Copy link
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-mir-opt-GVNArea: MIR opt Global Value Numbering (GVN)Area: MIR opt Global Value Numbering (GVN)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-mir-opt-GVNArea: MIR opt Global Value Numbering (GVN)Area: MIR opt Global Value Numbering (GVN)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for Enhancement.
Today, this code https://play.rust-lang.org/?version=nightly&mode=release&edition=2024&gist=09a5eaf64b3be527fef5a0589d6fe377
gives this optimized MIR:
It's a shame that we need to take a reference there in the MIR instead of just copying out of the place directly, like
@cjgillot, is this something you think GVN could plausibly do?