{"action":"created","comment":{"url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls/comments/172457750","pull_request_review_id":101470566,"id":172457750,"diff_hunk":"@@ -351,6 +355,45 @@ class CodeGen_TC : public Halide::Internal::CodeGen_X86 {\n           << \"[LLVM-IR] After optimization:\\n\"\n           << toString(module.get());\n     }\n+\n+    // In a separate process call the LLC and dump the ASM\n+    // Since this is for debugging purposes only atm, separate process is fine.\n+    if (FLAGS_llvm_dump_asm) {\n+      // Create a temporary file (do not use racy tmpname;\n+      // do not use tmpnam that immediately destroys the file).\n+      char fileCName[256] = \"/tmp/XXXXXXXXXX\";\n+      auto fd = mkstemp(fileCName);\n+      ScopeGuard sg([fileCName]() { unlink(fileCName); });\n+      CHECK_GE(fd, 0) << \"mkstemp(): \" << fileCName << \" returned fd: \" << fd;\n+      close(fd);\n+\n+      // Close and reopen as FILE*\n+      auto tmp = fopen(fileCName, \"wb+\");\n+      auto llvmIr = toString(module.get());\n+      std::fputs(llvmIr.c_str(), tmp);\n+      fclose(tmp); // Close properly so the piped command can open without race\n+\n+      std::string fileName(fileCName);\n+      // TODO: evolve this in a better way to find LLVM\n+      auto command = std::string(\" `which llc || which llc-5.0` \") +\n+          std::string(\" -asm-verbose \") + std::string(\" < \") + fileName;\n+      FILE* fpipe = popen(command.c_str(), \"r\");\n+      if (fpipe == nullptr) {\n+        CHECK(false) << \"Failed to popen() on command: \" << command;","path":"src/core/polyhedral/codegen_llvm.cc","position":88,"original_position":42,"commit_id":"67e001c00d84c3c9187abaad05ee53116ece03fe","original_commit_id":"7c333f4c4e33c7ec848b6642b52bd4342935ba08","user":{"login":"skimo-openhub","id":17313619,"avatar_url":"https://avatars1.githubusercontent.com/u/17313619?v=4","gravatar_id":"","url":"https://api.github.com/users/skimo-openhub","html_url":"https://github.com/skimo-openhub","followers_url":"https://api.github.com/users/skimo-openhub/followers","following_url":"https://api.github.com/users/skimo-openhub/following{/other_user}","gists_url":"https://api.github.com/users/skimo-openhub/gists{/gist_id}","starred_url":"https://api.github.com/users/skimo-openhub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skimo-openhub/subscriptions","organizations_url":"https://api.github.com/users/skimo-openhub/orgs","repos_url":"https://api.github.com/users/skimo-openhub/repos","events_url":"https://api.github.com/users/skimo-openhub/events{/privacy}","received_events_url":"https://api.github.com/users/skimo-openhub/received_events","type":"User","site_admin":false},"body":"Why not `CHECK(fpipe != nullptr)`?","created_at":"2018-03-06T09:38:10Z","updated_at":"2018-03-06T09:41:11Z","html_url":"https://github.com/facebookresearch/TensorComprehensions/pull/102#discussion_r172457750","pull_request_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls/102","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls/comments/172457750"},"html":{"href":"https://github.com/facebookresearch/TensorComprehensions/pull/102#discussion_r172457750"},"pull_request":{"href":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls/102"}}},"pull_request":{"url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls/102","id":173041501,"html_url":"https://github.com/facebookresearch/TensorComprehensions/pull/102","diff_url":"https://github.com/facebookresearch/TensorComprehensions/pull/102.diff","patch_url":"https://github.com/facebookresearch/TensorComprehensions/pull/102.patch","issue_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/issues/102","number":102,"state":"open","locked":false,"title":"Cleanups towards CPU mapper","user":{"login":"nicolasvasilache","id":10148468,"avatar_url":"https://avatars3.githubusercontent.com/u/10148468?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolasvasilache","html_url":"https://github.com/nicolasvasilache","followers_url":"https://api.github.com/users/nicolasvasilache/followers","following_url":"https://api.github.com/users/nicolasvasilache/following{/other_user}","gists_url":"https://api.github.com/users/nicolasvasilache/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolasvasilache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolasvasilache/subscriptions","organizations_url":"https://api.github.com/users/nicolasvasilache/orgs","repos_url":"https://api.github.com/users/nicolasvasilache/repos","events_url":"https://api.github.com/users/nicolasvasilache/events{/privacy}","received_events_url":"https://api.github.com/users/nicolasvasilache/received_events","type":"User","site_admin":false},"body":"This PR implements various cleanups which are part of the process of getting a proper CPU mapper:\r\n1. bunch of cleanups\r\n2. adds the ability to call the LLVM LLC and dump assembly when ```--llvm_dump_asm=1```\r\n3. drops (Cuda)ExecutionInfo which is just pure technical debt","created_at":"2018-03-06T02:24:33Z","updated_at":"2018-03-06T09:41:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c29c7473e62ffe676aef078d0cbaa4ab75b14125","assignee":null,"assignees":[],"requested_reviewers":[{"login":"salexspb","id":20307328,"avatar_url":"https://avatars2.githubusercontent.com/u/20307328?v=4","gravatar_id":"","url":"https://api.github.com/users/salexspb","html_url":"https://github.com/salexspb","followers_url":"https://api.github.com/users/salexspb/followers","following_url":"https://api.github.com/users/salexspb/following{/other_user}","gists_url":"https://api.github.com/users/salexspb/gists{/gist_id}","starred_url":"https://api.github.com/users/salexspb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salexspb/subscriptions","organizations_url":"https://api.github.com/users/salexspb/orgs","repos_url":"https://api.github.com/users/salexspb/repos","events_url":"https://api.github.com/users/salexspb/events{/privacy}","received_events_url":"https://api.github.com/users/salexspb/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":829008246,"url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/labels/CLA%20Signed","name":"CLA Signed","color":"c2f4fc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls/102/commits","review_comments_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls/102/comments","review_comment_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/issues/102/comments","statuses_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/statuses/67e001c00d84c3c9187abaad05ee53116ece03fe","head":{"label":"facebookresearch:pr/dev/cpu","ref":"pr/dev/cpu","sha":"67e001c00d84c3c9187abaad05ee53116ece03fe","user":{"login":"facebookresearch","id":16943930,"avatar_url":"https://avatars0.githubusercontent.com/u/16943930?v=4","gravatar_id":"","url":"https://api.github.com/users/facebookresearch","html_url":"https://github.com/facebookresearch","followers_url":"https://api.github.com/users/facebookresearch/followers","following_url":"https://api.github.com/users/facebookresearch/following{/other_user}","gists_url":"https://api.github.com/users/facebookresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookresearch/subscriptions","organizations_url":"https://api.github.com/users/facebookresearch/orgs","repos_url":"https://api.github.com/users/facebookresearch/repos","events_url":"https://api.github.com/users/facebookresearch/events{/privacy}","received_events_url":"https://api.github.com/users/facebookresearch/received_events","type":"Organization","site_admin":false},"repo":{"id":120494252,"name":"TensorComprehensions","full_name":"facebookresearch/TensorComprehensions","owner":{"login":"facebookresearch","id":16943930,"avatar_url":"https://avatars0.githubusercontent.com/u/16943930?v=4","gravatar_id":"","url":"https://api.github.com/users/facebookresearch","html_url":"https://github.com/facebookresearch","followers_url":"https://api.github.com/users/facebookresearch/followers","following_url":"https://api.github.com/users/facebookresearch/following{/other_user}","gists_url":"https://api.github.com/users/facebookresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookresearch/subscriptions","organizations_url":"https://api.github.com/users/facebookresearch/orgs","repos_url":"https://api.github.com/users/facebookresearch/repos","events_url":"https://api.github.com/users/facebookresearch/events{/privacy}","received_events_url":"https://api.github.com/users/facebookresearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebookresearch/TensorComprehensions","description":"A domain specific language to express machine learning workloads.","fork":false,"url":"https://api.github.com/repos/facebookresearch/TensorComprehensions","forks_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/forks","keys_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/teams","hooks_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/hooks","issue_events_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/issues/events{/number}","events_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/events","assignees_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/assignees{/user}","branches_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/branches{/branch}","tags_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/tags","blobs_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/statuses/{sha}","languages_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/languages","stargazers_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/stargazers","contributors_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/contributors","subscribers_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/subscribers","subscription_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/subscription","commits_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/contents/{+path}","compare_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/merges","archive_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/downloads","issues_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/issues{/number}","pulls_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls{/number}","milestones_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/milestones{/number}","notifications_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/labels{/name}","releases_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/releases{/id}","deployments_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/deployments","created_at":"2018-02-06T17:11:07Z","updated_at":"2018-03-06T09:01:42Z","pushed_at":"2018-03-06T05:22:16Z","git_url":"git://github.com/facebookresearch/TensorComprehensions.git","ssh_url":"git@github.com:facebookresearch/TensorComprehensions.git","clone_url":"https://github.com/facebookresearch/TensorComprehensions.git","svn_url":"https://github.com/facebookresearch/TensorComprehensions","homepage":"https://facebookresearch.github.io/TensorComprehensions/","size":30678,"stargazers_count":877,"watchers_count":877,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":61,"mirror_url":null,"archived":false,"open_issues_count":23,"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":61,"open_issues":23,"watchers":877,"default_branch":"master"}},"base":{"label":"facebookresearch:dev","ref":"dev","sha":"dac1f48253846956a77ba3c227e78505debf7ece","user":{"login":"facebookresearch","id":16943930,"avatar_url":"https://avatars0.githubusercontent.com/u/16943930?v=4","gravatar_id":"","url":"https://api.github.com/users/facebookresearch","html_url":"https://github.com/facebookresearch","followers_url":"https://api.github.com/users/facebookresearch/followers","following_url":"https://api.github.com/users/facebookresearch/following{/other_user}","gists_url":"https://api.github.com/users/facebookresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookresearch/subscriptions","organizations_url":"https://api.github.com/users/facebookresearch/orgs","repos_url":"https://api.github.com/users/facebookresearch/repos","events_url":"https://api.github.com/users/facebookresearch/events{/privacy}","received_events_url":"https://api.github.com/users/facebookresearch/received_events","type":"Organization","site_admin":false},"repo":{"id":120494252,"name":"TensorComprehensions","full_name":"facebookresearch/TensorComprehensions","owner":{"login":"facebookresearch","id":16943930,"avatar_url":"https://avatars0.githubusercontent.com/u/16943930?v=4","gravatar_id":"","url":"https://api.github.com/users/facebookresearch","html_url":"https://github.com/facebookresearch","followers_url":"https://api.github.com/users/facebookresearch/followers","following_url":"https://api.github.com/users/facebookresearch/following{/other_user}","gists_url":"https://api.github.com/users/facebookresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookresearch/subscriptions","organizations_url":"https://api.github.com/users/facebookresearch/orgs","repos_url":"https://api.github.com/users/facebookresearch/repos","events_url":"https://api.github.com/users/facebookresearch/events{/privacy}","received_events_url":"https://api.github.com/users/facebookresearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebookresearch/TensorComprehensions","description":"A domain specific language to express machine learning workloads.","fork":false,"url":"https://api.github.com/repos/facebookresearch/TensorComprehensions","forks_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/forks","keys_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/teams","hooks_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/hooks","issue_events_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/issues/events{/number}","events_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/events","assignees_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/assignees{/user}","branches_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/branches{/branch}","tags_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/tags","blobs_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/statuses/{sha}","languages_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/languages","stargazers_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/stargazers","contributors_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/contributors","subscribers_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/subscribers","subscription_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/subscription","commits_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/contents/{+path}","compare_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/merges","archive_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/downloads","issues_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/issues{/number}","pulls_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls{/number}","milestones_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/milestones{/number}","notifications_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/labels{/name}","releases_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/releases{/id}","deployments_url":"https://api.github.com/repos/facebookresearch/TensorComprehensions/deployments","created_at":"2018-02-06T17:11:07Z","updated_at":"2018-03-06T09:01:42Z","pushed_at":"2018-03-06T05:22:16Z","git_url":"git://github.com/facebookresearch/TensorComprehensions.git","ssh_url":"git@github.com:facebookresearch/TensorComprehensions.git","clone_url":"https://github.com/facebookresearch/TensorComprehensions.git","svn_url":"https://github.com/facebookresearch/TensorComprehensions","homepage":"https://facebookresearch.github.io/TensorComprehensions/","size":30678,"stargazers_count":877,"watchers_count":877,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":61,"mirror_url":null,"archived":false,"open_issues_count":23,"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":61,"open_issues":23,"watchers":877,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls/102"},"html":{"href":"https://github.com/facebookresearch/TensorComprehensions/pull/102"},"issue":{"href":"https://api.github.com/repos/facebookresearch/TensorComprehensions/issues/102"},"comments":{"href":"https://api.github.com/repos/facebookresearch/TensorComprehensions/issues/102/comments"},"review_comments":{"href":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls/102/comments"},"review_comment":{"href":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebookresearch/TensorComprehensions/pulls/102/commits"},"statuses":{"href":"https://api.github.com/repos/facebookresearch/TensorComprehensions/statuses/67e001c00d84c3c9187abaad05ee53116ece03fe"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"skimo-openhub"}}