Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try not to copy outgoing arguments #23657

Closed
pcwalton opened this issue Mar 24, 2015 · 5 comments
Closed

Try not to copy outgoing arguments #23657

pcwalton opened this issue Mar 24, 2015 · 5 comments
Labels
A-codegen Area: Code generation I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@pcwalton
Copy link
Contributor

I see stuff like this in Servo's disassembly for arguments that are moved:

+0x1bcc             movq                -6256(%rbp), %rax
+0x1bd3             movq                %rax, -3344(%rbp)
+0x1bda             movaps              -6272(%rbp), %xmm0
+0x1be1             movaps              %xmm0, -3360(%rbp)
+0x1be8             movaps              -6288(%rbp), %xmm0
+0x1bef             movaps              %xmm0, -3376(%rbp)
+0x1bf6             movaps              -6304(%rbp), %xmm0
+0x1bfd             movaps              %xmm0, -3392(%rbp)
+0x1c04             movaps              -6368(%rbp), %xmm0
+0x1c0b             movaps              -6352(%rbp), %xmm1
+0x1c12             movaps              -6336(%rbp), %xmm2
+0x1c19             movaps              -6320(%rbp), %xmm3
+0x1c20             movaps              %xmm3, -3408(%rbp)
+0x1c27             movaps              %xmm2, -3424(%rbp)
+0x1c2e             movaps              %xmm1, -3440(%rbp)
+0x1c35             movaps              %xmm0, -3456(%rbp)
+0x1c3c             xorps               %xmm0, %xmm0
+0x1c3f             movaps              %xmm0, -6272(%rbp)
+0x1c46             movaps              %xmm0, -6288(%rbp)
+0x1c4d             movaps              %xmm0, -6304(%rbp)
+0x1c54             movaps              %xmm0, -6320(%rbp)
+0x1c5b             movaps              %xmm0, -6336(%rbp)
+0x1c62             movaps              %xmm0, -6352(%rbp)
+0x1c69             movaps              %xmm0, -6368(%rbp)
+0x1c70             movq                $0, -6256(%rbp)
+0x1c7b             leaq                -7600(%rbp), %rdi
+0x1c82             leaq                -3456(%rbp), %rsi
+0x1c89             callq               "vec_deque::VecDeque$LT$T$GT$::push_front::h12917901159388456219"

There's generally no need to copy by-move arguments. They should not be by-value at the LLVM level but should instead be by-pointer. Essentially codegen should opportunistically treat by-value as a hypothetical &own for aggregates.

@pcwalton pcwalton added I-slow Issue: Problems and improvements with respect to performance of generated code. A-codegen Area: Code generation labels Mar 24, 2015
@rprichard
Copy link
Contributor

Looks related to #22891.

cc @dotdash

@dotdash
Copy link
Contributor

dotdash commented Mar 24, 2015

Already playing with some patch that prefers to always zero after drop to
avoid having to copy (and zero) when passing by value, hitting a weird
crash at the moment though.

2015-03-24 19:48 GMT+01:00 Ryan Prichard notifications@github.com:

Looks related to #22891 #22891.

cc @dotdash https://github.com/dotdash


Reply to this email directly or view it on GitHub
#23657 (comment).

@emberian
Copy link
Member

Similar to #21487

@pnkfelix
Copy link
Member

cc me

@brson
Copy link
Contributor

brson commented Dec 1, 2016

Closing. This is old and pretty vague. New concrete test cases welcome.

@brson brson closed this as completed Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

6 participants