{"action":"opened","number":64,"pull_request":{"url":"https://api.github.com/repos/Maratyszcza/PeachPy/pulls/64","id":96623683,"html_url":"https://github.com/Maratyszcza/PeachPy/pull/64","diff_url":"https://github.com/Maratyszcza/PeachPy/pull/64.diff","patch_url":"https://github.com/Maratyszcza/PeachPy/pull/64.patch","issue_url":"https://api.github.com/repos/Maratyszcza/PeachPy/issues/64","number":64,"state":"open","locked":false,"title":"x86-64: compute conflicts with live physical regs","user":{"login":"pwaller","id":438648,"avatar_url":"https://avatars.githubusercontent.com/u/438648?v=3","gravatar_id":"","url":"https://api.github.com/users/pwaller","html_url":"https://github.com/pwaller","followers_url":"https://api.github.com/users/pwaller/followers","following_url":"https://api.github.com/users/pwaller/following{/other_user}","gists_url":"https://api.github.com/users/pwaller/gists{/gist_id}","starred_url":"https://api.github.com/users/pwaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwaller/subscriptions","organizations_url":"https://api.github.com/users/pwaller/orgs","repos_url":"https://api.github.com/users/pwaller/repos","events_url":"https://api.github.com/users/pwaller/events{/privacy}","received_events_url":"https://api.github.com/users/pwaller/received_events","type":"User","site_admin":false},"body":"See #63.\n\nThe register allocator was not noticing when a physical register was\nbeing used. Now for each instruction, all live physical registers are\nadded as conflicts to all live virtual registers.\n\nI believe this fixes #63 (and possibly #60, but I haven't tested that yet).\n\nConsider:\n```python\ninput_ptr = Argument(ptr())\n\nwith Function(\"foo\", (input_ptr,), int64_t)  as function:\n    name = LOAD.ARGUMENT(r15, input_ptr)\n\n    r = GeneralPurposeRegister64()\n    MOV(r, 1234)\n    MOV(rax, 4567)\n    MOV([r15], rax)\n    RETURN(r)\n```\n\nBefore, the code generation was overwriting `rax` with the virutal register `r`:\n\n```\n// func foo(input_ptr uintptr) int64\nTEXT ·foo(SB),4,$0-16\n\tMOVQ input_ptr+0(FP), R15\n\tMOVQ $1234, AX\n\tMOVQ $4567, AX\n\tMOVQ AX, 0(R15)\n\tMOVQ AX, ret+8(FP)\n\tRET\n```\n\nAnd now, it produces the following:\n\n```\n// func foo(input_ptr uintptr) int64\nTEXT ·foo(SB),4,$0-16\n\tMOVQ input_ptr+0(FP), R15\n\tMOVQ $1234, BX\n\tMOVQ $4567, AX\n\tMOVQ AX, 0(R15)\n\tMOVQ BX, ret+8(FP)\n\tRET\n```\n\nI do not know if this implementation is correct. The tests appear to pass.\n\nThere is this [telling TODO](https://github.com/Maratyszcza/PeachPy/blob/6640053b8b4279536c4483fecd72432bef15ae82/peachpy/x86_64/function.py#L685):\n\n```python\nfor virtual_register in unallocated_registers:\n    # TODO: generalize conflicts\n    conflict_internal_ids = [reg_id for (reg_id, reg_mask)\n                             in six.iteritems(instruction._live_registers)\n                             if reg_mask & virtual_register.mask != 0]\n    self._register_allocators[virtual_register.kind].add_conflicts(\nvirtual_register.virtual_id, conflict_internal_ids)\n```\n\nI do not know if the implementation in this PR makes this TODO irrelevant.","created_at":"2016-12-05T22:35:09Z","updated_at":"2016-12-05T22:35:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Maratyszcza/PeachPy/pulls/64/commits","review_comments_url":"https://api.github.com/repos/Maratyszcza/PeachPy/pulls/64/comments","review_comment_url":"https://api.github.com/repos/Maratyszcza/PeachPy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Maratyszcza/PeachPy/issues/64/comments","statuses_url":"https://api.github.com/repos/Maratyszcza/PeachPy/statuses/046ef7d2a02d55c2f61333587b518ea4f32c1c64","head":{"label":"pwaller:compute-physical-conflicts","ref":"compute-physical-conflicts","sha":"046ef7d2a02d55c2f61333587b518ea4f32c1c64","user":{"login":"pwaller","id":438648,"avatar_url":"https://avatars.githubusercontent.com/u/438648?v=3","gravatar_id":"","url":"https://api.github.com/users/pwaller","html_url":"https://github.com/pwaller","followers_url":"https://api.github.com/users/pwaller/followers","following_url":"https://api.github.com/users/pwaller/following{/other_user}","gists_url":"https://api.github.com/users/pwaller/gists{/gist_id}","starred_url":"https://api.github.com/users/pwaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwaller/subscriptions","organizations_url":"https://api.github.com/users/pwaller/orgs","repos_url":"https://api.github.com/users/pwaller/repos","events_url":"https://api.github.com/users/pwaller/events{/privacy}","received_events_url":"https://api.github.com/users/pwaller/received_events","type":"User","site_admin":false},"repo":{"id":75563470,"name":"PeachPy","full_name":"pwaller/PeachPy","owner":{"login":"pwaller","id":438648,"avatar_url":"https://avatars.githubusercontent.com/u/438648?v=3","gravatar_id":"","url":"https://api.github.com/users/pwaller","html_url":"https://github.com/pwaller","followers_url":"https://api.github.com/users/pwaller/followers","following_url":"https://api.github.com/users/pwaller/following{/other_user}","gists_url":"https://api.github.com/users/pwaller/gists{/gist_id}","starred_url":"https://api.github.com/users/pwaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwaller/subscriptions","organizations_url":"https://api.github.com/users/pwaller/orgs","repos_url":"https://api.github.com/users/pwaller/repos","events_url":"https://api.github.com/users/pwaller/events{/privacy}","received_events_url":"https://api.github.com/users/pwaller/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pwaller/PeachPy","description":"x86-64 assembler embedded in Python","fork":true,"url":"https://api.github.com/repos/pwaller/PeachPy","forks_url":"https://api.github.com/repos/pwaller/PeachPy/forks","keys_url":"https://api.github.com/repos/pwaller/PeachPy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pwaller/PeachPy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pwaller/PeachPy/teams","hooks_url":"https://api.github.com/repos/pwaller/PeachPy/hooks","issue_events_url":"https://api.github.com/repos/pwaller/PeachPy/issues/events{/number}","events_url":"https://api.github.com/repos/pwaller/PeachPy/events","assignees_url":"https://api.github.com/repos/pwaller/PeachPy/assignees{/user}","branches_url":"https://api.github.com/repos/pwaller/PeachPy/branches{/branch}","tags_url":"https://api.github.com/repos/pwaller/PeachPy/tags","blobs_url":"https://api.github.com/repos/pwaller/PeachPy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pwaller/PeachPy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pwaller/PeachPy/git/refs{/sha}","trees_url":"https://api.github.com/repos/pwaller/PeachPy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pwaller/PeachPy/statuses/{sha}","languages_url":"https://api.github.com/repos/pwaller/PeachPy/languages","stargazers_url":"https://api.github.com/repos/pwaller/PeachPy/stargazers","contributors_url":"https://api.github.com/repos/pwaller/PeachPy/contributors","subscribers_url":"https://api.github.com/repos/pwaller/PeachPy/subscribers","subscription_url":"https://api.github.com/repos/pwaller/PeachPy/subscription","commits_url":"https://api.github.com/repos/pwaller/PeachPy/commits{/sha}","git_commits_url":"https://api.github.com/repos/pwaller/PeachPy/git/commits{/sha}","comments_url":"https://api.github.com/repos/pwaller/PeachPy/comments{/number}","issue_comment_url":"https://api.github.com/repos/pwaller/PeachPy/issues/comments{/number}","contents_url":"https://api.github.com/repos/pwaller/PeachPy/contents/{+path}","compare_url":"https://api.github.com/repos/pwaller/PeachPy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pwaller/PeachPy/merges","archive_url":"https://api.github.com/repos/pwaller/PeachPy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pwaller/PeachPy/downloads","issues_url":"https://api.github.com/repos/pwaller/PeachPy/issues{/number}","pulls_url":"https://api.github.com/repos/pwaller/PeachPy/pulls{/number}","milestones_url":"https://api.github.com/repos/pwaller/PeachPy/milestones{/number}","notifications_url":"https://api.github.com/repos/pwaller/PeachPy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pwaller/PeachPy/labels{/name}","releases_url":"https://api.github.com/repos/pwaller/PeachPy/releases{/id}","deployments_url":"https://api.github.com/repos/pwaller/PeachPy/deployments","created_at":"2016-12-04T20:46:15Z","updated_at":"2016-12-04T20:46:16Z","pushed_at":"2016-12-05T22:31:21Z","git_url":"git://github.com/pwaller/PeachPy.git","ssh_url":"git@github.com:pwaller/PeachPy.git","clone_url":"https://github.com/pwaller/PeachPy.git","svn_url":"https://github.com/pwaller/PeachPy","homepage":"","size":734,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Maratyszcza:master","ref":"master","sha":"6640053b8b4279536c4483fecd72432bef15ae82","user":{"login":"Maratyszcza","id":1093985,"avatar_url":"https://avatars.githubusercontent.com/u/1093985?v=3","gravatar_id":"","url":"https://api.github.com/users/Maratyszcza","html_url":"https://github.com/Maratyszcza","followers_url":"https://api.github.com/users/Maratyszcza/followers","following_url":"https://api.github.com/users/Maratyszcza/following{/other_user}","gists_url":"https://api.github.com/users/Maratyszcza/gists{/gist_id}","starred_url":"https://api.github.com/users/Maratyszcza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maratyszcza/subscriptions","organizations_url":"https://api.github.com/users/Maratyszcza/orgs","repos_url":"https://api.github.com/users/Maratyszcza/repos","events_url":"https://api.github.com/users/Maratyszcza/events{/privacy}","received_events_url":"https://api.github.com/users/Maratyszcza/received_events","type":"User","site_admin":false},"repo":{"id":29848246,"name":"PeachPy","full_name":"Maratyszcza/PeachPy","owner":{"login":"Maratyszcza","id":1093985,"avatar_url":"https://avatars.githubusercontent.com/u/1093985?v=3","gravatar_id":"","url":"https://api.github.com/users/Maratyszcza","html_url":"https://github.com/Maratyszcza","followers_url":"https://api.github.com/users/Maratyszcza/followers","following_url":"https://api.github.com/users/Maratyszcza/following{/other_user}","gists_url":"https://api.github.com/users/Maratyszcza/gists{/gist_id}","starred_url":"https://api.github.com/users/Maratyszcza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maratyszcza/subscriptions","organizations_url":"https://api.github.com/users/Maratyszcza/orgs","repos_url":"https://api.github.com/users/Maratyszcza/repos","events_url":"https://api.github.com/users/Maratyszcza/events{/privacy}","received_events_url":"https://api.github.com/users/Maratyszcza/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Maratyszcza/PeachPy","description":"x86-64 assembler embedded in Python","fork":false,"url":"https://api.github.com/repos/Maratyszcza/PeachPy","forks_url":"https://api.github.com/repos/Maratyszcza/PeachPy/forks","keys_url":"https://api.github.com/repos/Maratyszcza/PeachPy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Maratyszcza/PeachPy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Maratyszcza/PeachPy/teams","hooks_url":"https://api.github.com/repos/Maratyszcza/PeachPy/hooks","issue_events_url":"https://api.github.com/repos/Maratyszcza/PeachPy/issues/events{/number}","events_url":"https://api.github.com/repos/Maratyszcza/PeachPy/events","assignees_url":"https://api.github.com/repos/Maratyszcza/PeachPy/assignees{/user}","branches_url":"https://api.github.com/repos/Maratyszcza/PeachPy/branches{/branch}","tags_url":"https://api.github.com/repos/Maratyszcza/PeachPy/tags","blobs_url":"https://api.github.com/repos/Maratyszcza/PeachPy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Maratyszcza/PeachPy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Maratyszcza/PeachPy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Maratyszcza/PeachPy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Maratyszcza/PeachPy/statuses/{sha}","languages_url":"https://api.github.com/repos/Maratyszcza/PeachPy/languages","stargazers_url":"https://api.github.com/repos/Maratyszcza/PeachPy/stargazers","contributors_url":"https://api.github.com/repos/Maratyszcza/PeachPy/contributors","subscribers_url":"https://api.github.com/repos/Maratyszcza/PeachPy/subscribers","subscription_url":"https://api.github.com/repos/Maratyszcza/PeachPy/subscription","commits_url":"https://api.github.com/repos/Maratyszcza/PeachPy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Maratyszcza/PeachPy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Maratyszcza/PeachPy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Maratyszcza/PeachPy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Maratyszcza/PeachPy/contents/{+path}","compare_url":"https://api.github.com/repos/Maratyszcza/PeachPy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Maratyszcza/PeachPy/merges","archive_url":"https://api.github.com/repos/Maratyszcza/PeachPy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Maratyszcza/PeachPy/downloads","issues_url":"https://api.github.com/repos/Maratyszcza/PeachPy/issues{/number}","pulls_url":"https://api.github.com/repos/Maratyszcza/PeachPy/pulls{/number}","milestones_url":"https://api.github.com/repos/Maratyszcza/PeachPy/milestones{/number}","notifications_url":"https://api.github.com/repos/Maratyszcza/PeachPy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Maratyszcza/PeachPy/labels{/name}","releases_url":"https://api.github.com/repos/Maratyszcza/PeachPy/releases{/id}","deployments_url":"https://api.github.com/repos/Maratyszcza/PeachPy/deployments","created_at":"2015-01-26T06:32:48Z","updated_at":"2016-12-05T20:32:58Z","pushed_at":"2016-12-05T22:35:10Z","git_url":"git://github.com/Maratyszcza/PeachPy.git","ssh_url":"git@github.com:Maratyszcza/PeachPy.git","clone_url":"https://github.com/Maratyszcza/PeachPy.git","svn_url":"https://github.com/Maratyszcza/PeachPy","homepage":"","size":716,"stargazers_count":819,"watchers_count":819,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":20,"forks":44,"open_issues":20,"watchers":819,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Maratyszcza/PeachPy/pulls/64"},"html":{"href":"https://github.com/Maratyszcza/PeachPy/pull/64"},"issue":{"href":"https://api.github.com/repos/Maratyszcza/PeachPy/issues/64"},"comments":{"href":"https://api.github.com/repos/Maratyszcza/PeachPy/issues/64/comments"},"review_comments":{"href":"https://api.github.com/repos/Maratyszcza/PeachPy/pulls/64/comments"},"review_comment":{"href":"https://api.github.com/repos/Maratyszcza/PeachPy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Maratyszcza/PeachPy/pulls/64/commits"},"statuses":{"href":"https://api.github.com/repos/Maratyszcza/PeachPy/statuses/046ef7d2a02d55c2f61333587b518ea4f32c1c64"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":14,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"pwaller"}}