{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/4755","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/4755/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/4755/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/4755/events","html_url":"https://github.com/dotnet/coreclr/pull/4755","id":152857669,"number":4755,"title":"Multi-reg call node support for x64 Unix","user":{"login":"sivarv","id":11184808,"avatar_url":"https://avatars.githubusercontent.com/u/11184808?v=3","gravatar_id":"","url":"https://api.github.com/users/sivarv","html_url":"https://github.com/sivarv","followers_url":"https://api.github.com/users/sivarv/followers","following_url":"https://api.github.com/users/sivarv/following{/other_user}","gists_url":"https://api.github.com/users/sivarv/gists{/gist_id}","starred_url":"https://api.github.com/users/sivarv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sivarv/subscriptions","organizations_url":"https://api.github.com/users/sivarv/orgs","repos_url":"https://api.github.com/users/sivarv/repos","events_url":"https://api.github.com/users/sivarv/events{/privacy}","received_events_url":"https://api.github.com/users/sivarv/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/coreclr/labels/2%20-%20In%20Progress","name":"2 - In Progress","color":"CCCCCC"},{"url":"https://api.github.com/repos/dotnet/coreclr/labels/cla-already-signed","name":"cla-already-signed","color":"009800"},{"url":"https://api.github.com/repos/dotnet/coreclr/labels/CodeGen","name":"CodeGen","color":"d4c5f9"},{"url":"https://api.github.com/repos/dotnet/coreclr/labels/Linux","name":"Linux","color":"c7def8"}],"state":"open","locked":false,"assignee":{"login":"sivarv","id":11184808,"avatar_url":"https://avatars.githubusercontent.com/u/11184808?v=3","gravatar_id":"","url":"https://api.github.com/users/sivarv","html_url":"https://github.com/sivarv","followers_url":"https://api.github.com/users/sivarv/followers","following_url":"https://api.github.com/users/sivarv/following{/other_user}","gists_url":"https://api.github.com/users/sivarv/gists{/gist_id}","starred_url":"https://api.github.com/users/sivarv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sivarv/subscriptions","organizations_url":"https://api.github.com/users/sivarv/orgs","repos_url":"https://api.github.com/users/sivarv/repos","events_url":"https://api.github.com/users/sivarv/events{/privacy}","received_events_url":"https://api.github.com/users/sivarv/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2016-05-03T19:41:12Z","updated_at":"2016-05-03T21:58:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/4755","html_url":"https://github.com/dotnet/coreclr/pull/4755","diff_url":"https://github.com/dotnet/coreclr/pull/4755.diff","patch_url":"https://github.com/dotnet/coreclr/pull/4755.patch"},"body":"This is the phase 1 implementation of multi-reg call node support for x64 Unix and corresponds to sub work item 3 mentioned towards the end of the doc in PR #3941 .\r\n\r\nA Multi-reg call node is augmented with gtOtherRegs and gtSpillFlags array.  Existing _gtRegNum field will store the first reg result and rest are given by gtOtherRegs array.  gtSpillFlags array stores spill flag associated with individual result regs of call node.  \r\n\r\nA Multi-reg call is modeled in Lowering to have a dstCount = number of result regs it produces.  There will be one RefTypeDef position created for each reg result defined by call. Each of these Ref positions could be individually spilled or reloaded and carries with it a multi-reg index that indicates the position of result register.  GTF_SPILL/SPILLED flag on a multi-reg call node indicates that one or more of its result regs are in that state.  Which specific regs are in that state is given by gtSpillFlags array.\r\n\r\nA Multi-reg call node could appear in one of two IR forms: var=call or GT_RETURN(call).\r\nGT_STORE_LOC/GT_RETURN will have a source count = number of result regs produced by call.   There will be one RefTypeUse position for each reg result that it consumes.\r\n\r\nIt is also possible that one or more of result regs of a GT_CALL node are spilled and later reloaded (using GT_RELOAD) to a different register. Example: GT_STORE_LOC(op1 = GT_RELOAD(call))\r\nSimilarly, it could even be a GT_COPY to copy a subset of the result regs. This requires that GT_COPY/RELOAD nodes in turn needs to have multi-reg state.  GenTreeCopyOrReload is added for that purpose.  Note that though a call node produces say 2 result regs, only one or both them could be copied/reloaded.  That means a multi-reg GT_COPY/RELOAD node might not have valid regs allocated for all its multi-reg positions.  To support GT_COPY/RELOAD of any subset of result regs, genConsumeReg(), genProduceReg() and genCopy() code paths are updated to handle multi-reg call nodes.\r\n\r\nSince individual result regs could be spilled or unspilled, rsSpillTree() and rsUnspillInPlace() now take a regIdx param.  These routines in case of multi-reg call node will (un)spill the specified result register and set a flag in gtSpillFlags array.  \r\n\r\nGT_RETURN(call): under LSRA stress it is possible that results regs are spilled and a GT_RELOAD was inserted by LSRA and regs allocated is reverse of ABI return sequence.  This case is handled by codegen by generating swap of regs."},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/216677383","html_url":"https://github.com/dotnet/coreclr/pull/4755#issuecomment-216677383","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/4755","id":216677383,"user":{"login":"sivarv","id":11184808,"avatar_url":"https://avatars.githubusercontent.com/u/11184808?v=3","gravatar_id":"","url":"https://api.github.com/users/sivarv","html_url":"https://github.com/sivarv","followers_url":"https://api.github.com/users/sivarv/followers","following_url":"https://api.github.com/users/sivarv/following{/other_user}","gists_url":"https://api.github.com/users/sivarv/gists{/gist_id}","starred_url":"https://api.github.com/users/sivarv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sivarv/subscriptions","organizations_url":"https://api.github.com/users/sivarv/orgs","repos_url":"https://api.github.com/users/sivarv/repos","events_url":"https://api.github.com/users/sivarv/events{/privacy}","received_events_url":"https://api.github.com/users/sivarv/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T21:58:18Z","updated_at":"2016-05-03T21:58:18Z","body":"@dotnet-bot test Ubuntu jitstressregs0x10"}}