{"action":"created","comment":{"url":"https://api.github.com/repos/KhronosGroup/glslang/pulls/comments/55710522","id":55710522,"diff_hunk":"@@ -2130,6 +2130,35 @@ Id Builder::accessChainGetInferredType()\n     return type;\n }\n \n+// comment in header\n+void Builder::eliminateDeadDecorations() {\n+    std::unordered_set<const Block*> reachable_blocks;\n+    std::unordered_set<Id> unreachable_definitions;\n+    // Collect IDs defined in unreachable blocks. For each function, label the\n+    // reachable blocks first. Then for each unreachable block, collect the\n+    // result IDs of the instructions in it.\n+    for (auto& f : module.getFunctions()) {\n+        Block* entry = f->getEntryBlock();\n+        inReadableOrder(entry, [&reachable_blocks](const Block* b) {\n+            reachable_blocks.insert(b);\n+        });\n+        for (auto& b : f->getBlocks()) {\n+            if (!reachable_blocks.count(b)) {\n+                for (auto& i : b->getInstructions()) {\n+                    unreachable_definitions.insert(i->getResultId());\n+                }\n+            }\n+        }\n+    }\n+    decorations.erase(std::remove_if(decorations.begin(), decorations.end(),","path":"SPIRV/SpvBuilder.cpp","position":31,"original_position":24,"commit_id":"95aa52737d6b7053578aba772b7ccc7e80df6d28","original_commit_id":"da39733f2892d3e65af8e1286fbb348cfc2883fd","user":{"login":"johnkslang","id":5607714,"avatar_url":"https://avatars.githubusercontent.com/u/5607714?v=3","gravatar_id":"","url":"https://api.github.com/users/johnkslang","html_url":"https://github.com/johnkslang","followers_url":"https://api.github.com/users/johnkslang/followers","following_url":"https://api.github.com/users/johnkslang/following{/other_user}","gists_url":"https://api.github.com/users/johnkslang/gists{/gist_id}","starred_url":"https://api.github.com/users/johnkslang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnkslang/subscriptions","organizations_url":"https://api.github.com/users/johnkslang/orgs","repos_url":"https://api.github.com/users/johnkslang/repos","events_url":"https://api.github.com/users/johnkslang/events{/privacy}","received_events_url":"https://api.github.com/users/johnkslang/received_events","type":"User","site_admin":false},"body":"I think you're right, that you'd want an ordered set for cross platform test-result consistency.  That would change the time complexity.  It's okay as is.","created_at":"2016-03-10T16:53:53Z","updated_at":"2016-03-10T16:53:53Z","html_url":"https://github.com/KhronosGroup/glslang/pull/195#discussion_r55710522","pull_request_url":"https://api.github.com/repos/KhronosGroup/glslang/pulls/195","_links":{"self":{"href":"https://api.github.com/repos/KhronosGroup/glslang/pulls/comments/55710522"},"html":{"href":"https://github.com/KhronosGroup/glslang/pull/195#discussion_r55710522"},"pull_request":{"href":"https://api.github.com/repos/KhronosGroup/glslang/pulls/195"}}},"pull_request":{"url":"https://api.github.com/repos/KhronosGroup/glslang/pulls/195","id":62324166,"html_url":"https://github.com/KhronosGroup/glslang/pull/195","diff_url":"https://github.com/KhronosGroup/glslang/pull/195.diff","patch_url":"https://github.com/KhronosGroup/glslang/pull/195.patch","issue_url":"https://api.github.com/repos/KhronosGroup/glslang/issues/195","number":195,"state":"closed","locked":false,"title":"Remove decoration of undefined IDs","user":{"login":"Qining","id":2983685,"avatar_url":"https://avatars.githubusercontent.com/u/2983685?v=3","gravatar_id":"","url":"https://api.github.com/users/Qining","html_url":"https://github.com/Qining","followers_url":"https://api.github.com/users/Qining/followers","following_url":"https://api.github.com/users/Qining/following{/other_user}","gists_url":"https://api.github.com/users/Qining/gists{/gist_id}","starred_url":"https://api.github.com/users/Qining/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qining/subscriptions","organizations_url":"https://api.github.com/users/Qining/orgs","repos_url":"https://api.github.com/users/Qining/repos","events_url":"https://api.github.com/users/Qining/events{/privacy}","received_events_url":"https://api.github.com/users/Qining/received_events","type":"User","site_admin":false},"body":"Fix issue #185 by removing OpDecorate instructions whose target IDs are\r\ndefined in unreachable blocks and thus not dumped in the generated\r\nSPIR-V code.\r\n\r\nAlternative to PR #193 ","created_at":"2016-03-10T01:08:46Z","updated_at":"2016-03-10T16:53:53Z","closed_at":"2016-03-10T16:51:22Z","merged_at":"2016-03-10T16:51:22Z","merge_commit_sha":"6037a5c7f09c38d7c1fa29a1ab3c037501c064de","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/KhronosGroup/glslang/pulls/195/commits","review_comments_url":"https://api.github.com/repos/KhronosGroup/glslang/pulls/195/comments","review_comment_url":"https://api.github.com/repos/KhronosGroup/glslang/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KhronosGroup/glslang/issues/195/comments","statuses_url":"https://api.github.com/repos/KhronosGroup/glslang/statuses/95aa52737d6b7053578aba772b7ccc7e80df6d28","head":{"label":"Qining:remove-decoration-on-undef-IDs","ref":"remove-decoration-on-undef-IDs","sha":"95aa52737d6b7053578aba772b7ccc7e80df6d28","user":{"login":"Qining","id":2983685,"avatar_url":"https://avatars.githubusercontent.com/u/2983685?v=3","gravatar_id":"","url":"https://api.github.com/users/Qining","html_url":"https://github.com/Qining","followers_url":"https://api.github.com/users/Qining/followers","following_url":"https://api.github.com/users/Qining/following{/other_user}","gists_url":"https://api.github.com/users/Qining/gists{/gist_id}","starred_url":"https://api.github.com/users/Qining/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qining/subscriptions","organizations_url":"https://api.github.com/users/Qining/orgs","repos_url":"https://api.github.com/users/Qining/repos","events_url":"https://api.github.com/users/Qining/events{/privacy}","received_events_url":"https://api.github.com/users/Qining/received_events","type":"User","site_admin":false},"repo":{"id":53376214,"name":"glslang","full_name":"Qining/glslang","owner":{"login":"Qining","id":2983685,"avatar_url":"https://avatars.githubusercontent.com/u/2983685?v=3","gravatar_id":"","url":"https://api.github.com/users/Qining","html_url":"https://github.com/Qining","followers_url":"https://api.github.com/users/Qining/followers","following_url":"https://api.github.com/users/Qining/following{/other_user}","gists_url":"https://api.github.com/users/Qining/gists{/gist_id}","starred_url":"https://api.github.com/users/Qining/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qining/subscriptions","organizations_url":"https://api.github.com/users/Qining/orgs","repos_url":"https://api.github.com/users/Qining/repos","events_url":"https://api.github.com/users/Qining/events{/privacy}","received_events_url":"https://api.github.com/users/Qining/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Qining/glslang","description":"Khronos reference front-end for GLSL and ESSL","fork":true,"url":"https://api.github.com/repos/Qining/glslang","forks_url":"https://api.github.com/repos/Qining/glslang/forks","keys_url":"https://api.github.com/repos/Qining/glslang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Qining/glslang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Qining/glslang/teams","hooks_url":"https://api.github.com/repos/Qining/glslang/hooks","issue_events_url":"https://api.github.com/repos/Qining/glslang/issues/events{/number}","events_url":"https://api.github.com/repos/Qining/glslang/events","assignees_url":"https://api.github.com/repos/Qining/glslang/assignees{/user}","branches_url":"https://api.github.com/repos/Qining/glslang/branches{/branch}","tags_url":"https://api.github.com/repos/Qining/glslang/tags","blobs_url":"https://api.github.com/repos/Qining/glslang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Qining/glslang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Qining/glslang/git/refs{/sha}","trees_url":"https://api.github.com/repos/Qining/glslang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Qining/glslang/statuses/{sha}","languages_url":"https://api.github.com/repos/Qining/glslang/languages","stargazers_url":"https://api.github.com/repos/Qining/glslang/stargazers","contributors_url":"https://api.github.com/repos/Qining/glslang/contributors","subscribers_url":"https://api.github.com/repos/Qining/glslang/subscribers","subscription_url":"https://api.github.com/repos/Qining/glslang/subscription","commits_url":"https://api.github.com/repos/Qining/glslang/commits{/sha}","git_commits_url":"https://api.github.com/repos/Qining/glslang/git/commits{/sha}","comments_url":"https://api.github.com/repos/Qining/glslang/comments{/number}","issue_comment_url":"https://api.github.com/repos/Qining/glslang/issues/comments{/number}","contents_url":"https://api.github.com/repos/Qining/glslang/contents/{+path}","compare_url":"https://api.github.com/repos/Qining/glslang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Qining/glslang/merges","archive_url":"https://api.github.com/repos/Qining/glslang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Qining/glslang/downloads","issues_url":"https://api.github.com/repos/Qining/glslang/issues{/number}","pulls_url":"https://api.github.com/repos/Qining/glslang/pulls{/number}","milestones_url":"https://api.github.com/repos/Qining/glslang/milestones{/number}","notifications_url":"https://api.github.com/repos/Qining/glslang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Qining/glslang/labels{/name}","releases_url":"https://api.github.com/repos/Qining/glslang/releases{/id}","deployments_url":"https://api.github.com/repos/Qining/glslang/deployments","created_at":"2016-03-08T02:35:58Z","updated_at":"2016-03-08T02:36:02Z","pushed_at":"2016-03-10T02:40:46Z","git_url":"git://github.com/Qining/glslang.git","ssh_url":"git@github.com:Qining/glslang.git","clone_url":"https://github.com/Qining/glslang.git","svn_url":"https://github.com/Qining/glslang","homepage":null,"size":24517,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"KhronosGroup:master","ref":"master","sha":"f7497e289bcd214e33fbf29a34b693acb82a0fb0","user":{"login":"KhronosGroup","id":1608701,"avatar_url":"https://avatars.githubusercontent.com/u/1608701?v=3","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":38064932,"name":"glslang","full_name":"KhronosGroup/glslang","owner":{"login":"KhronosGroup","id":1608701,"avatar_url":"https://avatars.githubusercontent.com/u/1608701?v=3","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/glslang","description":"Khronos reference front-end for GLSL and ESSL","fork":false,"url":"https://api.github.com/repos/KhronosGroup/glslang","forks_url":"https://api.github.com/repos/KhronosGroup/glslang/forks","keys_url":"https://api.github.com/repos/KhronosGroup/glslang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KhronosGroup/glslang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KhronosGroup/glslang/teams","hooks_url":"https://api.github.com/repos/KhronosGroup/glslang/hooks","issue_events_url":"https://api.github.com/repos/KhronosGroup/glslang/issues/events{/number}","events_url":"https://api.github.com/repos/KhronosGroup/glslang/events","assignees_url":"https://api.github.com/repos/KhronosGroup/glslang/assignees{/user}","branches_url":"https://api.github.com/repos/KhronosGroup/glslang/branches{/branch}","tags_url":"https://api.github.com/repos/KhronosGroup/glslang/tags","blobs_url":"https://api.github.com/repos/KhronosGroup/glslang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KhronosGroup/glslang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KhronosGroup/glslang/git/refs{/sha}","trees_url":"https://api.github.com/repos/KhronosGroup/glslang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KhronosGroup/glslang/statuses/{sha}","languages_url":"https://api.github.com/repos/KhronosGroup/glslang/languages","stargazers_url":"https://api.github.com/repos/KhronosGroup/glslang/stargazers","contributors_url":"https://api.github.com/repos/KhronosGroup/glslang/contributors","subscribers_url":"https://api.github.com/repos/KhronosGroup/glslang/subscribers","subscription_url":"https://api.github.com/repos/KhronosGroup/glslang/subscription","commits_url":"https://api.github.com/repos/KhronosGroup/glslang/commits{/sha}","git_commits_url":"https://api.github.com/repos/KhronosGroup/glslang/git/commits{/sha}","comments_url":"https://api.github.com/repos/KhronosGroup/glslang/comments{/number}","issue_comment_url":"https://api.github.com/repos/KhronosGroup/glslang/issues/comments{/number}","contents_url":"https://api.github.com/repos/KhronosGroup/glslang/contents/{+path}","compare_url":"https://api.github.com/repos/KhronosGroup/glslang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KhronosGroup/glslang/merges","archive_url":"https://api.github.com/repos/KhronosGroup/glslang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KhronosGroup/glslang/downloads","issues_url":"https://api.github.com/repos/KhronosGroup/glslang/issues{/number}","pulls_url":"https://api.github.com/repos/KhronosGroup/glslang/pulls{/number}","milestones_url":"https://api.github.com/repos/KhronosGroup/glslang/milestones{/number}","notifications_url":"https://api.github.com/repos/KhronosGroup/glslang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KhronosGroup/glslang/labels{/name}","releases_url":"https://api.github.com/repos/KhronosGroup/glslang/releases{/id}","deployments_url":"https://api.github.com/repos/KhronosGroup/glslang/deployments","created_at":"2015-06-25T17:54:39Z","updated_at":"2016-03-10T00:56:58Z","pushed_at":"2016-03-10T16:51:22Z","git_url":"git://github.com/KhronosGroup/glslang.git","ssh_url":"git@github.com:KhronosGroup/glslang.git","clone_url":"https://github.com/KhronosGroup/glslang.git","svn_url":"https://github.com/KhronosGroup/glslang","homepage":null,"size":25179,"stargazers_count":220,"watchers_count":220,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":66,"mirror_url":null,"open_issues_count":42,"forks":66,"open_issues":42,"watchers":220,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KhronosGroup/glslang/pulls/195"},"html":{"href":"https://github.com/KhronosGroup/glslang/pull/195"},"issue":{"href":"https://api.github.com/repos/KhronosGroup/glslang/issues/195"},"comments":{"href":"https://api.github.com/repos/KhronosGroup/glslang/issues/195/comments"},"review_comments":{"href":"https://api.github.com/repos/KhronosGroup/glslang/pulls/195/comments"},"review_comment":{"href":"https://api.github.com/repos/KhronosGroup/glslang/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KhronosGroup/glslang/pulls/195/commits"},"statuses":{"href":"https://api.github.com/repos/KhronosGroup/glslang/statuses/95aa52737d6b7053578aba772b7ccc7e80df6d28"}}}}