{"action":"created","comment":{"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments/168589700","pull_request_review_id":96983994,"id":168589700,"diff_hunk":"@@ -250,7 +255,8 @@ bool DeadBranchElimPass::FixPhiNodesInLiveBlocks(\n           modified = true;\n           uint32_t continue_id = block.ContinueBlockIdIfAny();\n           if (!backedge_added && continue_id != 0 &&\n-              unreachable_continues.count(GetParentBlock(continue_id))) {\n+              unreachable_continues.count(GetParentBlock(continue_id)) &&\n+              operands.size() > 4) {","path":"source/opt/dead_branch_elim_pass.cpp","position":26,"original_position":26,"commit_id":"aaaf3728033e7b9c0204e3d88065a71855fd12c2","original_commit_id":"aaaf3728033e7b9c0204e3d88065a71855fd12c2","user":{"login":"alan-baker","id":33432579,"avatar_url":"https://avatars1.githubusercontent.com/u/33432579?v=4","gravatar_id":"","url":"https://api.github.com/users/alan-baker","html_url":"https://github.com/alan-baker","followers_url":"https://api.github.com/users/alan-baker/followers","following_url":"https://api.github.com/users/alan-baker/following{/other_user}","gists_url":"https://api.github.com/users/alan-baker/gists{/gist_id}","starred_url":"https://api.github.com/users/alan-baker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alan-baker/subscriptions","organizations_url":"https://api.github.com/users/alan-baker/orgs","repos_url":"https://api.github.com/users/alan-baker/repos","events_url":"https://api.github.com/users/alan-baker/events{/privacy}","received_events_url":"https://api.github.com/users/alan-baker/received_events","type":"User","site_admin":false},"body":"I think this should be >=. In this case we haven't added a backedge (because the backedge block was the successor of an unreachable continue). So we have two valid incoming edges and would have a third from the unreachable continue.\r\n\r\nApparently no test covers this properly. Also please double check the subsequent code which special cases a two input phi node.","created_at":"2018-02-15T19:53:26Z","updated_at":"2018-02-15T19:57:21Z","html_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/1315#discussion_r168589700","pull_request_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1315","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments/168589700"},"html":{"href":"https://github.com/KhronosGroup/SPIRV-Tools/pull/1315#discussion_r168589700"},"pull_request":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1315"}}},"pull_request":{"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1315","id":169466498,"html_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/1315","diff_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/1315.diff","patch_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/1315.patch","issue_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1315","number":1315,"state":"open","locked":false,"title":"Simplify OpPhi instructions referencing unreachable continues","user":{"login":"s-perron","id":31666470,"avatar_url":"https://avatars1.githubusercontent.com/u/31666470?v=4","gravatar_id":"","url":"https://api.github.com/users/s-perron","html_url":"https://github.com/s-perron","followers_url":"https://api.github.com/users/s-perron/followers","following_url":"https://api.github.com/users/s-perron/following{/other_user}","gists_url":"https://api.github.com/users/s-perron/gists{/gist_id}","starred_url":"https://api.github.com/users/s-perron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-perron/subscriptions","organizations_url":"https://api.github.com/users/s-perron/orgs","repos_url":"https://api.github.com/users/s-perron/repos","events_url":"https://api.github.com/users/s-perron/events{/privacy}","received_events_url":"https://api.github.com/users/s-perron/received_events","type":"User","site_admin":false},"body":"In dead branch elimination, we already recognize unreachable continue\r\nblocks, and update OpPhi instruction accordingly.  This change adds an\r\nextra check: if the head block has exactly 1 other incoming edge, then\r\nreplace the OpPhi with the value from that edge.\r\n\r\nFixes #1314.","created_at":"2018-02-15T19:42:38Z","updated_at":"2018-02-15T19:57:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a2191391a5e2962f752889c85660e10ee2296bb","assignee":{"login":"s-perron","id":31666470,"avatar_url":"https://avatars1.githubusercontent.com/u/31666470?v=4","gravatar_id":"","url":"https://api.github.com/users/s-perron","html_url":"https://github.com/s-perron","followers_url":"https://api.github.com/users/s-perron/followers","following_url":"https://api.github.com/users/s-perron/following{/other_user}","gists_url":"https://api.github.com/users/s-perron/gists{/gist_id}","starred_url":"https://api.github.com/users/s-perron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-perron/subscriptions","organizations_url":"https://api.github.com/users/s-perron/orgs","repos_url":"https://api.github.com/users/s-perron/repos","events_url":"https://api.github.com/users/s-perron/events{/privacy}","received_events_url":"https://api.github.com/users/s-perron/received_events","type":"User","site_admin":false},"assignees":[{"login":"s-perron","id":31666470,"avatar_url":"https://avatars1.githubusercontent.com/u/31666470?v=4","gravatar_id":"","url":"https://api.github.com/users/s-perron","html_url":"https://github.com/s-perron","followers_url":"https://api.github.com/users/s-perron/followers","following_url":"https://api.github.com/users/s-perron/following{/other_user}","gists_url":"https://api.github.com/users/s-perron/gists{/gist_id}","starred_url":"https://api.github.com/users/s-perron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-perron/subscriptions","organizations_url":"https://api.github.com/users/s-perron/orgs","repos_url":"https://api.github.com/users/s-perron/repos","events_url":"https://api.github.com/users/s-perron/events{/privacy}","received_events_url":"https://api.github.com/users/s-perron/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1315/commits","review_comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1315/comments","review_comment_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1315/comments","statuses_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/statuses/aaaf3728033e7b9c0204e3d88065a71855fd12c2","head":{"label":"s-perron:folding","ref":"folding","sha":"aaaf3728033e7b9c0204e3d88065a71855fd12c2","user":{"login":"s-perron","id":31666470,"avatar_url":"https://avatars1.githubusercontent.com/u/31666470?v=4","gravatar_id":"","url":"https://api.github.com/users/s-perron","html_url":"https://github.com/s-perron","followers_url":"https://api.github.com/users/s-perron/followers","following_url":"https://api.github.com/users/s-perron/following{/other_user}","gists_url":"https://api.github.com/users/s-perron/gists{/gist_id}","starred_url":"https://api.github.com/users/s-perron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-perron/subscriptions","organizations_url":"https://api.github.com/users/s-perron/orgs","repos_url":"https://api.github.com/users/s-perron/repos","events_url":"https://api.github.com/users/s-perron/events{/privacy}","received_events_url":"https://api.github.com/users/s-perron/received_events","type":"User","site_admin":false},"repo":{"id":102877047,"name":"SPIRV-Tools","full_name":"s-perron/SPIRV-Tools","owner":{"login":"s-perron","id":31666470,"avatar_url":"https://avatars1.githubusercontent.com/u/31666470?v=4","gravatar_id":"","url":"https://api.github.com/users/s-perron","html_url":"https://github.com/s-perron","followers_url":"https://api.github.com/users/s-perron/followers","following_url":"https://api.github.com/users/s-perron/following{/other_user}","gists_url":"https://api.github.com/users/s-perron/gists{/gist_id}","starred_url":"https://api.github.com/users/s-perron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-perron/subscriptions","organizations_url":"https://api.github.com/users/s-perron/orgs","repos_url":"https://api.github.com/users/s-perron/repos","events_url":"https://api.github.com/users/s-perron/events{/privacy}","received_events_url":"https://api.github.com/users/s-perron/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/s-perron/SPIRV-Tools","description":null,"fork":true,"url":"https://api.github.com/repos/s-perron/SPIRV-Tools","forks_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/forks","keys_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/teams","hooks_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/hooks","issue_events_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/issues/events{/number}","events_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/events","assignees_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/assignees{/user}","branches_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/branches{/branch}","tags_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/tags","blobs_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/statuses/{sha}","languages_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/languages","stargazers_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/stargazers","contributors_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/contributors","subscribers_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/subscribers","subscription_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/subscription","commits_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/contents/{+path}","compare_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/merges","archive_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/downloads","issues_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/issues{/number}","pulls_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/pulls{/number}","milestones_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/milestones{/number}","notifications_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/labels{/name}","releases_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/releases{/id}","deployments_url":"https://api.github.com/repos/s-perron/SPIRV-Tools/deployments","created_at":"2017-09-08T15:37:23Z","updated_at":"2017-10-08T20:52:50Z","pushed_at":"2018-02-15T19:42:15Z","git_url":"git://github.com/s-perron/SPIRV-Tools.git","ssh_url":"git@github.com:s-perron/SPIRV-Tools.git","clone_url":"https://github.com/s-perron/SPIRV-Tools.git","svn_url":"https://github.com/s-perron/SPIRV-Tools","homepage":null,"size":5856,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"KhronosGroup:master","ref":"master","sha":"5d442fad2f00fcca8354aaaa9bfd36be8c418a1b","user":{"login":"KhronosGroup","id":1608701,"avatar_url":"https://avatars3.githubusercontent.com/u/1608701?v=4","gravatar_id":"","url":"https://api.github.com/users/KhronosGroup","html_url":"https://github.com/KhronosGroup","followers_url":"https://api.github.com/users/KhronosGroup/followers","following_url":"https://api.github.com/users/KhronosGroup/following{/other_user}","gists_url":"https://api.github.com/users/KhronosGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KhronosGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhronosGroup/subscriptions","organizations_url":"https://api.github.com/users/KhronosGroup/orgs","repos_url":"https://api.github.com/users/KhronosGroup/repos","events_url":"https://api.github.com/users/KhronosGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KhronosGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":45981801,"name":"SPIRV-Tools","full_name":"KhronosGroup/SPIRV-Tools","owner":{"login":"KhronosGroup","id":1608701,"avatar_url":"https://avatars3.githubusercontent.com/u/1608701?v=4","gravatar_id":"","url":"https://api.github.com/users/KhronosGroup","html_url":"https://github.com/KhronosGroup","followers_url":"https://api.github.com/users/KhronosGroup/followers","following_url":"https://api.github.com/users/KhronosGroup/following{/other_user}","gists_url":"https://api.github.com/users/KhronosGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KhronosGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhronosGroup/subscriptions","organizations_url":"https://api.github.com/users/KhronosGroup/orgs","repos_url":"https://api.github.com/users/KhronosGroup/repos","events_url":"https://api.github.com/users/KhronosGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KhronosGroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KhronosGroup/SPIRV-Tools","description":null,"fork":false,"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools","forks_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/forks","keys_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/teams","hooks_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/hooks","issue_events_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/events{/number}","events_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/events","assignees_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/assignees{/user}","branches_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/branches{/branch}","tags_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tags","blobs_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/statuses/{sha}","languages_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/languages","stargazers_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/stargazers","contributors_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/contributors","subscribers_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/subscribers","subscription_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/subscription","commits_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/contents/{+path}","compare_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/merges","archive_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/downloads","issues_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues{/number}","pulls_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls{/number}","milestones_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/milestones{/number}","notifications_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/labels{/name}","releases_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/releases{/id}","deployments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/deployments","created_at":"2015-11-11T12:56:25Z","updated_at":"2018-02-14T20:11:34Z","pushed_at":"2018-02-15T19:44:30Z","git_url":"git://github.com/KhronosGroup/SPIRV-Tools.git","ssh_url":"git@github.com:KhronosGroup/SPIRV-Tools.git","clone_url":"https://github.com/KhronosGroup/SPIRV-Tools.git","svn_url":"https://github.com/KhronosGroup/SPIRV-Tools","homepage":null,"size":5861,"stargazers_count":253,"watchers_count":253,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":100,"mirror_url":null,"archived":false,"open_issues_count":177,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":100,"open_issues":177,"watchers":253,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1315"},"html":{"href":"https://github.com/KhronosGroup/SPIRV-Tools/pull/1315"},"issue":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1315"},"comments":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1315/comments"},"review_comments":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1315/comments"},"review_comment":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1315/commits"},"statuses":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/statuses/aaaf3728033e7b9c0204e3d88065a71855fd12c2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alan-baker"}}