{"action":"opened","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/13305","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/13305/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/13305/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/13305/events","html_url":"https://github.com/JuliaLang/julia/issues/13305","id":108176010,"number":13305,"title":"Unnecessary copying of structs passed by reference","user":{"login":"simonster","id":470884,"avatar_url":"https://avatars.githubusercontent.com/u/470884?v=3","gravatar_id":"","url":"https://api.github.com/users/simonster","html_url":"https://github.com/simonster","followers_url":"https://api.github.com/users/simonster/followers","following_url":"https://api.github.com/users/simonster/following{/other_user}","gists_url":"https://api.github.com/users/simonster/gists{/gist_id}","starred_url":"https://api.github.com/users/simonster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonster/subscriptions","organizations_url":"https://api.github.com/users/simonster/orgs","repos_url":"https://api.github.com/users/simonster/repos","events_url":"https://api.github.com/users/simonster/events{/privacy}","received_events_url":"https://api.github.com/users/simonster/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/codegen","name":"codegen","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-24T17:26:23Z","updated_at":"2015-09-24T17:26:23Z","closed_at":null,"body":"```julia\r\njulia> @noinline f(x) = x;\r\n\r\njulia> g(x) = f(x);\r\n\r\njulia> Base.code_llvm_raw(g, Tuple{Complex64})\r\n\r\ndefine %Complex.12 @julia_g_21408(%Complex.12*) {\r\ntop:\r\n  %x = alloca %Complex.12, align 8, !dbg !1, !julia_type !10\r\n  %1 = load %Complex.12* %0, align 4, !dbg !1\r\n  store %Complex.12 %1, %Complex.12* %x, align 8, !dbg !1\r\n  %2 = call %Complex.12 @julia_f_21409(%Complex.12* %x), !dbg !11\r\n  ret %Complex.12 %2, !dbg !11\r\n}\r\n```\r\n\r\nIt doesn't seem like it should be necessary to copy the input argument to the stack. It could be passed directly to `f`."}}