-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Unnecessary memcpy with mir-opt-level=2 and above #77506
Copy link
Copy link
Closed
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: 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.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: 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.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
mir-opt-level=1:
mir-opt-level=2
And here it looks like the whole
Vecstruct is getting copied to a temp stack location forpushand then to the final dest:https://rust.godbolt.org/z/fWvKW6
cc @jonas-schievink Aren't those supposed to be rather eliminated by #72632 ? That said, I've seen 2 and especially 3 producing worse code than 1 even before it landed so there may be something else interfering.