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

Comments

Projects
None yet
6 participants
@pcwalton
Copy link
Contributor

pcwalton commented Mar 24, 2015

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.

@rprichard

This comment has been minimized.

Copy link
Contributor

rprichard commented Mar 24, 2015

Looks related to #22891.

cc @dotdash

@dotdash

This comment has been minimized.

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).

@cmr

This comment has been minimized.

Copy link
Member

cmr commented Mar 25, 2015

Similar to #21487

@pnkfelix

This comment has been minimized.

Copy link
Member

pnkfelix commented Apr 16, 2015

cc me

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Dec 1, 2016

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

@brson brson closed this Dec 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.