{"action":"created","comment":{"url":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls/comments/126966707","pull_request_review_id":49503493,"id":126966707,"diff_hunk":"@@ -0,0 +1,173 @@\n+//===------ SelectAcceleratorCode.cpp - Select only accelerator code ------===//\n+//\n+//                     The LLVM Compiler Infrastructure\n+//\n+// This file is distributed under the University of Illinois Open Source\n+// License. See LICENSE.TXT for details.\n+//\n+//===----------------------------------------------------------------------===//\n+//\n+// This file declares and defines a pass which selects only code which is\n+// expected to be run by an accelerator i.e. referenced directly of indirectly\n+// (through a fully inlineable call-chain) by a [[hc]] function. To support\n+// subsequent processing, it also marks all identified functions as AlwaysInline\n+// thus making it possible to use only the AlwaysInliner without resorting to a\n+// more expensive full Inliner pass.\n+//\n+//===----------------------------------------------------------------------===//\n+#include \"llvm/Analysis/InlineCost.h\"\n+#include \"llvm/IR/Attributes.h\"\n+#include \"llvm/IR/Constants.h\"\n+#include \"llvm/IR/DiagnosticInfo.h\"\n+#include \"llvm/IR/Function.h\"\n+#include \"llvm/IR/Instructions.h\"\n+#include \"llvm/IR/Module.h\"\n+#include \"llvm/Pass.h\"\n+#include \"llvm/Support/raw_ostream.h\"\n+\n+#include <algorithm>\n+#include <unordered_set>\n+\n+using namespace llvm;\n+using namespace std;\n+\n+namespace\n+{\n+    class SelectAcceleratorCode : public ModulePass {\n+        unordered_set<Function*> f_;","path":"lib/Transforms/HC/SelectAcceleratorCode/SelectAcceleratorCode.cpp","position":null,"original_position":37,"commit_id":"266f84609375ea63b661cc59fa47c5fb3b2f6a24","original_commit_id":"6e827c6763d2709fbc93daa51a67c6795d1bdfda","user":{"login":"AlexVlx","id":23191400,"avatar_url":"https://avatars1.githubusercontent.com/u/23191400?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexVlx","html_url":"https://github.com/AlexVlx","followers_url":"https://api.github.com/users/AlexVlx/followers","following_url":"https://api.github.com/users/AlexVlx/following{/other_user}","gists_url":"https://api.github.com/users/AlexVlx/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexVlx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexVlx/subscriptions","organizations_url":"https://api.github.com/users/AlexVlx/orgs","repos_url":"https://api.github.com/users/AlexVlx/repos","events_url":"https://api.github.com/users/AlexVlx/events{/privacy}","received_events_url":"https://api.github.com/users/AlexVlx/received_events","type":"User","site_admin":false},"body":"Done, thanks for pointing it out.","created_at":"2017-07-12T14:17:32Z","updated_at":"2017-07-12T14:17:32Z","html_url":"https://github.com/RadeonOpenCompute/llvm/pull/89#discussion_r126966707","pull_request_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls/89","_links":{"self":{"href":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls/comments/126966707"},"html":{"href":"https://github.com/RadeonOpenCompute/llvm/pull/89#discussion_r126966707"},"pull_request":{"href":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls/89"}}},"pull_request":{"url":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls/89","id":128660851,"html_url":"https://github.com/RadeonOpenCompute/llvm/pull/89","diff_url":"https://github.com/RadeonOpenCompute/llvm/pull/89.diff","patch_url":"https://github.com/RadeonOpenCompute/llvm/pull/89.patch","issue_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/issues/89","number":89,"state":"open","locked":false,"title":"Replace EraseNonKernel","user":{"login":"AlexVlx","id":23191400,"avatar_url":"https://avatars1.githubusercontent.com/u/23191400?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexVlx","html_url":"https://github.com/AlexVlx","followers_url":"https://api.github.com/users/AlexVlx/followers","following_url":"https://api.github.com/users/AlexVlx/following{/other_user}","gists_url":"https://api.github.com/users/AlexVlx/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexVlx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexVlx/subscriptions","organizations_url":"https://api.github.com/users/AlexVlx/orgs","repos_url":"https://api.github.com/users/AlexVlx/repos","events_url":"https://api.github.com/users/AlexVlx/events{/privacy}","received_events_url":"https://api.github.com/users/AlexVlx/received_events","type":"User","site_admin":false},"body":"This handles the LLVM part of removing usage of a whitelist from HCC. To wit,\nit aims to replace the EraseNonKernel pass with a new pass which tries to \nbuild the transitive closure of all [[hc]] functions in a module, by way of \nDFS. Everything that is not part of the closure is subsequently removed. If \na non-inlineable function is in the closure, this is an error by virtue of \nnon-existing call support. At finalization all functions in the closure are \nmarked as AlwaysInline. This is done so as to make it possible to get full \ninlining solely with the AlwaysInliner, without needing the more expensive \nfull Inliner. The intended sequencing for the pass is that it runs on the \nfully linked bitcode, immediately before invoking AMDGPU / LC.","created_at":"2017-07-03T16:17:21Z","updated_at":"2017-07-12T14:17:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bbc3984136e5b9c0da4c1983be9e7e61eb9eea2c","assignee":null,"assignees":[],"requested_reviewers":[{"login":"yxsamliu","id":6145511,"avatar_url":"https://avatars3.githubusercontent.com/u/6145511?v=3","gravatar_id":"","url":"https://api.github.com/users/yxsamliu","html_url":"https://github.com/yxsamliu","followers_url":"https://api.github.com/users/yxsamliu/followers","following_url":"https://api.github.com/users/yxsamliu/following{/other_user}","gists_url":"https://api.github.com/users/yxsamliu/gists{/gist_id}","starred_url":"https://api.github.com/users/yxsamliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yxsamliu/subscriptions","organizations_url":"https://api.github.com/users/yxsamliu/orgs","repos_url":"https://api.github.com/users/yxsamliu/repos","events_url":"https://api.github.com/users/yxsamliu/events{/privacy}","received_events_url":"https://api.github.com/users/yxsamliu/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls/89/commits","review_comments_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls/89/comments","review_comment_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/issues/89/comments","statuses_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/statuses/266f84609375ea63b661cc59fa47c5fb3b2f6a24","head":{"label":"RadeonOpenCompute:feature-amd-hcc-remove-erasenonkernel","ref":"feature-amd-hcc-remove-erasenonkernel","sha":"266f84609375ea63b661cc59fa47c5fb3b2f6a24","user":{"login":"RadeonOpenCompute","id":16900649,"avatar_url":"https://avatars0.githubusercontent.com/u/16900649?v=3","gravatar_id":"","url":"https://api.github.com/users/RadeonOpenCompute","html_url":"https://github.com/RadeonOpenCompute","followers_url":"https://api.github.com/users/RadeonOpenCompute/followers","following_url":"https://api.github.com/users/RadeonOpenCompute/following{/other_user}","gists_url":"https://api.github.com/users/RadeonOpenCompute/gists{/gist_id}","starred_url":"https://api.github.com/users/RadeonOpenCompute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RadeonOpenCompute/subscriptions","organizations_url":"https://api.github.com/users/RadeonOpenCompute/orgs","repos_url":"https://api.github.com/users/RadeonOpenCompute/repos","events_url":"https://api.github.com/users/RadeonOpenCompute/events{/privacy}","received_events_url":"https://api.github.com/users/RadeonOpenCompute/received_events","type":"Organization","site_admin":false},"repo":{"id":67689072,"name":"llvm","full_name":"RadeonOpenCompute/llvm","owner":{"login":"RadeonOpenCompute","id":16900649,"avatar_url":"https://avatars0.githubusercontent.com/u/16900649?v=3","gravatar_id":"","url":"https://api.github.com/users/RadeonOpenCompute","html_url":"https://github.com/RadeonOpenCompute","followers_url":"https://api.github.com/users/RadeonOpenCompute/followers","following_url":"https://api.github.com/users/RadeonOpenCompute/following{/other_user}","gists_url":"https://api.github.com/users/RadeonOpenCompute/gists{/gist_id}","starred_url":"https://api.github.com/users/RadeonOpenCompute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RadeonOpenCompute/subscriptions","organizations_url":"https://api.github.com/users/RadeonOpenCompute/orgs","repos_url":"https://api.github.com/users/RadeonOpenCompute/repos","events_url":"https://api.github.com/users/RadeonOpenCompute/events{/privacy}","received_events_url":"https://api.github.com/users/RadeonOpenCompute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RadeonOpenCompute/llvm","description":null,"fork":true,"url":"https://api.github.com/repos/RadeonOpenCompute/llvm","forks_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/forks","keys_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/teams","hooks_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/hooks","issue_events_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/issues/events{/number}","events_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/events","assignees_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/assignees{/user}","branches_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/branches{/branch}","tags_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/tags","blobs_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/statuses/{sha}","languages_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/languages","stargazers_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/stargazers","contributors_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/contributors","subscribers_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/subscribers","subscription_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/subscription","commits_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/contents/{+path}","compare_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/merges","archive_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/downloads","issues_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/issues{/number}","pulls_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls{/number}","milestones_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/milestones{/number}","notifications_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/labels{/name}","releases_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/releases{/id}","deployments_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/deployments","created_at":"2016-09-08T09:29:29Z","updated_at":"2017-05-10T17:28:13Z","pushed_at":"2017-07-12T14:16:16Z","git_url":"git://github.com/RadeonOpenCompute/llvm.git","ssh_url":"git@github.com:RadeonOpenCompute/llvm.git","clone_url":"https://github.com/RadeonOpenCompute/llvm.git","svn_url":"https://github.com/RadeonOpenCompute/llvm","homepage":"","size":678426,"stargazers_count":6,"watchers_count":6,"language":"LLVM","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":3,"forks":10,"open_issues":3,"watchers":6,"default_branch":"amd-common"}},"base":{"label":"RadeonOpenCompute:amd-hcc","ref":"amd-hcc","sha":"40a7e4dbaca213638051ac2d8672550c996c4452","user":{"login":"RadeonOpenCompute","id":16900649,"avatar_url":"https://avatars0.githubusercontent.com/u/16900649?v=3","gravatar_id":"","url":"https://api.github.com/users/RadeonOpenCompute","html_url":"https://github.com/RadeonOpenCompute","followers_url":"https://api.github.com/users/RadeonOpenCompute/followers","following_url":"https://api.github.com/users/RadeonOpenCompute/following{/other_user}","gists_url":"https://api.github.com/users/RadeonOpenCompute/gists{/gist_id}","starred_url":"https://api.github.com/users/RadeonOpenCompute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RadeonOpenCompute/subscriptions","organizations_url":"https://api.github.com/users/RadeonOpenCompute/orgs","repos_url":"https://api.github.com/users/RadeonOpenCompute/repos","events_url":"https://api.github.com/users/RadeonOpenCompute/events{/privacy}","received_events_url":"https://api.github.com/users/RadeonOpenCompute/received_events","type":"Organization","site_admin":false},"repo":{"id":67689072,"name":"llvm","full_name":"RadeonOpenCompute/llvm","owner":{"login":"RadeonOpenCompute","id":16900649,"avatar_url":"https://avatars0.githubusercontent.com/u/16900649?v=3","gravatar_id":"","url":"https://api.github.com/users/RadeonOpenCompute","html_url":"https://github.com/RadeonOpenCompute","followers_url":"https://api.github.com/users/RadeonOpenCompute/followers","following_url":"https://api.github.com/users/RadeonOpenCompute/following{/other_user}","gists_url":"https://api.github.com/users/RadeonOpenCompute/gists{/gist_id}","starred_url":"https://api.github.com/users/RadeonOpenCompute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RadeonOpenCompute/subscriptions","organizations_url":"https://api.github.com/users/RadeonOpenCompute/orgs","repos_url":"https://api.github.com/users/RadeonOpenCompute/repos","events_url":"https://api.github.com/users/RadeonOpenCompute/events{/privacy}","received_events_url":"https://api.github.com/users/RadeonOpenCompute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RadeonOpenCompute/llvm","description":null,"fork":true,"url":"https://api.github.com/repos/RadeonOpenCompute/llvm","forks_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/forks","keys_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/teams","hooks_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/hooks","issue_events_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/issues/events{/number}","events_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/events","assignees_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/assignees{/user}","branches_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/branches{/branch}","tags_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/tags","blobs_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/statuses/{sha}","languages_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/languages","stargazers_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/stargazers","contributors_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/contributors","subscribers_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/subscribers","subscription_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/subscription","commits_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/contents/{+path}","compare_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/merges","archive_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/downloads","issues_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/issues{/number}","pulls_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls{/number}","milestones_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/milestones{/number}","notifications_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/labels{/name}","releases_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/releases{/id}","deployments_url":"https://api.github.com/repos/RadeonOpenCompute/llvm/deployments","created_at":"2016-09-08T09:29:29Z","updated_at":"2017-05-10T17:28:13Z","pushed_at":"2017-07-12T14:16:16Z","git_url":"git://github.com/RadeonOpenCompute/llvm.git","ssh_url":"git@github.com:RadeonOpenCompute/llvm.git","clone_url":"https://github.com/RadeonOpenCompute/llvm.git","svn_url":"https://github.com/RadeonOpenCompute/llvm","homepage":"","size":678426,"stargazers_count":6,"watchers_count":6,"language":"LLVM","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":3,"forks":10,"open_issues":3,"watchers":6,"default_branch":"amd-common"}},"_links":{"self":{"href":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls/89"},"html":{"href":"https://github.com/RadeonOpenCompute/llvm/pull/89"},"issue":{"href":"https://api.github.com/repos/RadeonOpenCompute/llvm/issues/89"},"comments":{"href":"https://api.github.com/repos/RadeonOpenCompute/llvm/issues/89/comments"},"review_comments":{"href":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls/89/comments"},"review_comment":{"href":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RadeonOpenCompute/llvm/pulls/89/commits"},"statuses":{"href":"https://api.github.com/repos/RadeonOpenCompute/llvm/statuses/266f84609375ea63b661cc59fa47c5fb3b2f6a24"}}}}
{"actor":{"display_login":"AlexVlx"}}