Unnecessary memcpy with mir-opt-level=2 and above #77506
Labels
A-mir-opt
Area: MIR optimizations
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
mir-opt-level=1:
mir-opt-level=2
And here it looks like the whole
Vec
struct is getting copied to a temp stack location forpush
and 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.
The text was updated successfully, but these errors were encountered: