{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/23657","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/23657/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/23657/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/23657/events","html_url":"https://github.com/rust-lang/rust/issues/23657","id":63899346,"number":23657,"title":"Try not to copy outgoing arguments","user":{"login":"pcwalton","id":157897,"avatar_url":"https://avatars.githubusercontent.com/u/157897?v=3","gravatar_id":"","url":"https://api.github.com/users/pcwalton","html_url":"https://github.com/pcwalton","followers_url":"https://api.github.com/users/pcwalton/followers","following_url":"https://api.github.com/users/pcwalton/following{/other_user}","gists_url":"https://api.github.com/users/pcwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/pcwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcwalton/subscriptions","organizations_url":"https://api.github.com/users/pcwalton/orgs","repos_url":"https://api.github.com/users/pcwalton/repos","events_url":"https://api.github.com/users/pcwalton/events{/privacy}","received_events_url":"https://api.github.com/users/pcwalton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-codegen","name":"A-codegen","color":"d7e102"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/I-slow","name":"I-slow","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-24T04:15:10Z","updated_at":"2015-03-24T18:54:19Z","closed_at":null,"body":"I see stuff like this in Servo's disassembly for arguments that are moved:\r\n\r\n    +0x1bcc\t            movq                -6256(%rbp), %rax\r\n    +0x1bd3\t            movq                %rax, -3344(%rbp)\r\n    +0x1bda\t            movaps              -6272(%rbp), %xmm0\r\n    +0x1be1\t            movaps              %xmm0, -3360(%rbp)\r\n    +0x1be8\t            movaps              -6288(%rbp), %xmm0\r\n    +0x1bef\t            movaps              %xmm0, -3376(%rbp)\r\n    +0x1bf6\t            movaps              -6304(%rbp), %xmm0\r\n    +0x1bfd\t            movaps              %xmm0, -3392(%rbp)\r\n    +0x1c04\t            movaps              -6368(%rbp), %xmm0\r\n    +0x1c0b\t            movaps              -6352(%rbp), %xmm1\r\n    +0x1c12\t            movaps              -6336(%rbp), %xmm2\r\n    +0x1c19\t            movaps              -6320(%rbp), %xmm3\r\n    +0x1c20\t            movaps              %xmm3, -3408(%rbp)\r\n    +0x1c27\t            movaps              %xmm2, -3424(%rbp)\r\n    +0x1c2e\t            movaps              %xmm1, -3440(%rbp)\r\n    +0x1c35\t            movaps              %xmm0, -3456(%rbp)\r\n    +0x1c3c\t            xorps               %xmm0, %xmm0\r\n    +0x1c3f\t            movaps              %xmm0, -6272(%rbp)\r\n    +0x1c46\t            movaps              %xmm0, -6288(%rbp)\r\n    +0x1c4d\t            movaps              %xmm0, -6304(%rbp)\r\n    +0x1c54\t            movaps              %xmm0, -6320(%rbp)\r\n    +0x1c5b\t            movaps              %xmm0, -6336(%rbp)\r\n    +0x1c62\t            movaps              %xmm0, -6352(%rbp)\r\n    +0x1c69\t            movaps              %xmm0, -6368(%rbp)\r\n    +0x1c70\t            movq                $0, -6256(%rbp)\r\n    +0x1c7b\t            leaq                -7600(%rbp), %rdi\r\n    +0x1c82\t            leaq                -3456(%rbp), %rsi\r\n    +0x1c89\t            callq               \"vec_deque::VecDeque$LT$T$GT$::push_front::h12917901159388456219\"\r\n\r\nThere'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."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/85641506","html_url":"https://github.com/rust-lang/rust/issues/23657#issuecomment-85641506","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/23657","id":85641506,"user":{"login":"dotdash","id":230962,"avatar_url":"https://avatars.githubusercontent.com/u/230962?v=3","gravatar_id":"","url":"https://api.github.com/users/dotdash","html_url":"https://github.com/dotdash","followers_url":"https://api.github.com/users/dotdash/followers","following_url":"https://api.github.com/users/dotdash/following{/other_user}","gists_url":"https://api.github.com/users/dotdash/gists{/gist_id}","starred_url":"https://api.github.com/users/dotdash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotdash/subscriptions","organizations_url":"https://api.github.com/users/dotdash/orgs","repos_url":"https://api.github.com/users/dotdash/repos","events_url":"https://api.github.com/users/dotdash/events{/privacy}","received_events_url":"https://api.github.com/users/dotdash/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T18:54:19Z","updated_at":"2015-03-24T18:54:19Z","body":"Already playing with some patch that prefers to always zero after drop to\navoid having to copy (and zero) when passing by value, hitting a weird\ncrash at the moment though.\n\n2015-03-24 19:48 GMT+01:00 Ryan Prichard <notifications@github.com>:\n\n> Looks related to #22891 <https://github.com/rust-lang/rust/issues/22891>.\n>\n> cc @dotdash <https://github.com/dotdash>\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/rust-lang/rust/issues/23657#issuecomment-85639430>.\n>\n"}}