{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/189504243","pull_request_review_id":121694501,"id":189504243,"diff_hunk":"@@ -37,69 +39,266 @@ function print_node(io::IO, idx, stmt, used, maxsize; color = true, print_typ=tr\n             e = stmt.edges[i]\n             v = !isassigned(stmt.values, i) ? \"#undef\" :\n                 sprint() do io′\n-                    print_ssa(io′, stmt.values[i])\n+                    print_ssa(io′, stmt.values[i], argnames)\n                 end\n             \"$e => $v\"\n         end\n         Base.print(io, \"φ \", '(', join(args, \", \"), ')')\n     elseif isa(stmt, PhiCNode)\n-        Base.print(io, \"φᶜ \", '(', join(map(x->sprint(print_ssa, x), stmt.values), \", \"), ')')\n+        Base.print(io, \"φᶜ \", '(', join(map(x->sprint(print_ssa, x, argnames), stmt.values), \", \"), ')')\n     elseif isa(stmt, PiNode)\n         Base.print(io, \"π (\")\n-        print_ssa(io, stmt.val)\n+        print_ssa(io, stmt.val, argnames)\n         Base.print(io, \", \")\n         if color\n-            Base.printstyled(io, stmt.typ, color=:red)\n+            Base.printstyled(io, stmt.typ, color=:cyan)\n         else\n             Base.print(io, stmt.typ)\n         end\n         Base.print(io, \")\")\n     elseif isa(stmt, UpsilonNode)\n         Base.print(io, \"ϒ (\")\n         isdefined(stmt, :val) ?\n-            print_ssa(io, stmt.val) :\n+            print_ssa(io, stmt.val, argnames) :\n             Base.print(io, \"#undef\")\n         Base.print(io, \")\")\n     elseif isa(stmt, ReturnNode)\n         if !isdefined(stmt, :val)\n             Base.print(io, \"unreachable\")\n         else\n             Base.print(io, \"return \")\n-            print_ssa(io, stmt.val)\n+            print_ssa(io, stmt.val, argnames)\n         end\n     elseif isa(stmt, GotoIfNot)\n         Base.print(io, \"goto \", stmt.dest, \" if not \")\n-        print_ssa(io, stmt.cond)\n+        print_ssa(io, stmt.cond, argnames)\n     elseif isexpr(stmt, :call)\n-        print_ssa(io, stmt.args[1])\n+        print_ssa(io, stmt.args[1], argnames)\n         Base.print(io, \"(\")\n-        Base.print(io, join(map(arg->sprint(io->print_ssa(io, arg)), stmt.args[2:end]), \", \"))\n+        Base.print(io, join(map(arg->sprint(io->print_ssa(io, arg, argnames)), stmt.args[2:end]), \", \"))\n+        Base.print(io, \")\")\n+        if print_typ && stmt.typ !== Any\n+            Base.print(io, \"::$(stmt.typ)\")\n+        end\n+    elseif isexpr(stmt, :invoke)\n+        print(io, \"invoke \")\n+        linfo = stmt.args[1]\n+        print_ssa(io, stmt.args[2], argnames)\n+        Base.print(io, \"(\")\n+        print_arg((typ, arg)) = sprint(io->(print_ssa(io, arg, argnames); print(io, \"::$(typ)\")))\n+        Base.print(io, join(map(print_arg, zip(linfo.specTypes.parameters[2:end], stmt.args[3:end])), \", \"))","path":"base/compiler/ssair/show.jl","position":95,"original_position":95,"commit_id":"6f756e89990981579222cbb7dc8d882272c42df2","original_commit_id":"6f756e89990981579222cbb7dc8d882272c42df2","user":{"login":"vtjnash","id":330950,"avatar_url":"https://avatars1.githubusercontent.com/u/330950?v=4","gravatar_id":"","url":"https://api.github.com/users/vtjnash","html_url":"https://github.com/vtjnash","followers_url":"https://api.github.com/users/vtjnash/followers","following_url":"https://api.github.com/users/vtjnash/following{/other_user}","gists_url":"https://api.github.com/users/vtjnash/gists{/gist_id}","starred_url":"https://api.github.com/users/vtjnash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtjnash/subscriptions","organizations_url":"https://api.github.com/users/vtjnash/orgs","repos_url":"https://api.github.com/users/vtjnash/repos","events_url":"https://api.github.com/users/vtjnash/events{/privacy}","received_events_url":"https://api.github.com/users/vtjnash/received_events","type":"User","site_admin":false},"body":"This code is very hard to parse. Why are you stringifying everything multiple times? At least skip the obvious copy:\r\n```julia\r\nBase.join(io, map(print_arg, zip(linfo.specTypes.parameters[2:end], stmt.args[3:end])), \", \")\r\n```\r\n\r\n`linfo.specTypes.parameters[:]` - this quantity doesn't always exist. use `fieldtype(linfo.specTypes, i)`.\r\n\r\nAs I've said before, using `zip` on `args` (in Inference) is usually a very bad idea (very, very slow, and poisons the dispatch, Tuple, and Type caches for later with too many entries). There's some helper functions in Core.Compiler (such as `_any`, `contains_is`, and `anymap`) which help ensure Inference compiles fast and small which should be used instead (and add more if you need them).","created_at":"2018-05-21T06:30:03Z","updated_at":"2018-05-21T06:30:03Z","html_url":"https://github.com/JuliaLang/julia/pull/27177#discussion_r189504243","pull_request_url":"https://api.github.com/repos/JuliaLang/julia/pulls/27177","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/189504243"},"html":{"href":"https://github.com/JuliaLang/julia/pull/27177#discussion_r189504243"},"pull_request":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/27177"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/27177","id":189209915,"html_url":"https://github.com/JuliaLang/julia/pull/27177","diff_url":"https://github.com/JuliaLang/julia/pull/27177.diff","patch_url":"https://github.com/JuliaLang/julia/pull/27177.patch","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/27177","number":27177,"state":"open","locked":false,"title":"[NewOptimizer] Hook up printing, print linetable","user":{"login":"Keno","id":1291671,"avatar_url":"https://avatars1.githubusercontent.com/u/1291671?v=4","gravatar_id":"","url":"https://api.github.com/users/Keno","html_url":"https://github.com/Keno","followers_url":"https://api.github.com/users/Keno/followers","following_url":"https://api.github.com/users/Keno/following{/other_user}","gists_url":"https://api.github.com/users/Keno/gists{/gist_id}","starred_url":"https://api.github.com/users/Keno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Keno/subscriptions","organizations_url":"https://api.github.com/users/Keno/orgs","repos_url":"https://api.github.com/users/Keno/repos","events_url":"https://api.github.com/users/Keno/events{/privacy}","received_events_url":"https://api.github.com/users/Keno/received_events","type":"User","site_admin":false},"body":"This hooks up printing for the new IR and teaches it to print the\r\nlinetable. In printing a linetable, I tried to strike a balance\r\nbetween verboseness (I think the old printing and our printing of LLVM IR\r\nis significantly too verbose). There's a description of the idea in\r\nshow.jl.\r\n\r\nScreenshot:\r\n![screen shot 2018-05-19 at 5 38 38 pm](https://user-images.githubusercontent.com/1291671/40273721-067eead4-5b94-11e8-8a49-d8c60e27cc1b.png)\r\n\r\nFixes #27149","created_at":"2018-05-19T22:40:12Z","updated_at":"2018-05-21T06:30:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3316d5df4f60204304766a7b2f7af2b733a447f8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":511192218,"url":"https://api.github.com/repos/JuliaLang/julia/labels/display%20and%20printing","name":"display and printing","color":"e5ff9e","default":false},{"id":854410734,"url":"https://api.github.com/repos/JuliaLang/julia/labels/optimizer","name":"optimizer","color":"55db9f","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/JuliaLang/julia/pulls/27177/commits","review_comments_url":"https://api.github.com/repos/JuliaLang/julia/pulls/27177/comments","review_comment_url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/27177/comments","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/6f756e89990981579222cbb7dc8d882272c42df2","head":{"label":"JuliaLang:kf/newirprint","ref":"kf/newirprint","sha":"6f756e89990981579222cbb7dc8d882272c42df2","user":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars0.githubusercontent.com/u/743164?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"repo":{"id":1644196,"name":"julia","full_name":"JuliaLang/julia","owner":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars0.githubusercontent.com/u/743164?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaLang/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":false,"url":"https://api.github.com/repos/JuliaLang/julia","forks_url":"https://api.github.com/repos/JuliaLang/julia/forks","keys_url":"https://api.github.com/repos/JuliaLang/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaLang/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaLang/julia/teams","hooks_url":"https://api.github.com/repos/JuliaLang/julia/hooks","issue_events_url":"https://api.github.com/repos/JuliaLang/julia/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaLang/julia/events","assignees_url":"https://api.github.com/repos/JuliaLang/julia/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaLang/julia/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaLang/julia/tags","blobs_url":"https://api.github.com/repos/JuliaLang/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaLang/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaLang/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaLang/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaLang/julia/languages","stargazers_url":"https://api.github.com/repos/JuliaLang/julia/stargazers","contributors_url":"https://api.github.com/repos/JuliaLang/julia/contributors","subscribers_url":"https://api.github.com/repos/JuliaLang/julia/subscribers","subscription_url":"https://api.github.com/repos/JuliaLang/julia/subscription","commits_url":"https://api.github.com/repos/JuliaLang/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaLang/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaLang/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaLang/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaLang/julia/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaLang/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaLang/julia/merges","archive_url":"https://api.github.com/repos/JuliaLang/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaLang/julia/downloads","issues_url":"https://api.github.com/repos/JuliaLang/julia/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaLang/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaLang/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaLang/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaLang/julia/labels{/name}","releases_url":"https://api.github.com/repos/JuliaLang/julia/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaLang/julia/deployments","created_at":"2011-04-21T07:01:50Z","updated_at":"2018-05-21T06:20:07Z","pushed_at":"2018-05-21T06:16:38Z","git_url":"git://github.com/JuliaLang/julia.git","ssh_url":"git@github.com:JuliaLang/julia.git","clone_url":"https://github.com/JuliaLang/julia.git","svn_url":"https://github.com/JuliaLang/julia","homepage":"https://julialang.org/","size":385204,"stargazers_count":11010,"watchers_count":11010,"language":"Julia","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2351,"mirror_url":null,"archived":false,"open_issues_count":2582,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2351,"open_issues":2582,"watchers":11010,"default_branch":"master"}},"base":{"label":"JuliaLang:master","ref":"master","sha":"9a0ff525c1c589348f8b48eb1ebd9585357cf365","user":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars0.githubusercontent.com/u/743164?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"repo":{"id":1644196,"name":"julia","full_name":"JuliaLang/julia","owner":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars0.githubusercontent.com/u/743164?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaLang/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":false,"url":"https://api.github.com/repos/JuliaLang/julia","forks_url":"https://api.github.com/repos/JuliaLang/julia/forks","keys_url":"https://api.github.com/repos/JuliaLang/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaLang/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaLang/julia/teams","hooks_url":"https://api.github.com/repos/JuliaLang/julia/hooks","issue_events_url":"https://api.github.com/repos/JuliaLang/julia/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaLang/julia/events","assignees_url":"https://api.github.com/repos/JuliaLang/julia/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaLang/julia/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaLang/julia/tags","blobs_url":"https://api.github.com/repos/JuliaLang/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaLang/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaLang/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaLang/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaLang/julia/languages","stargazers_url":"https://api.github.com/repos/JuliaLang/julia/stargazers","contributors_url":"https://api.github.com/repos/JuliaLang/julia/contributors","subscribers_url":"https://api.github.com/repos/JuliaLang/julia/subscribers","subscription_url":"https://api.github.com/repos/JuliaLang/julia/subscription","commits_url":"https://api.github.com/repos/JuliaLang/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaLang/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaLang/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaLang/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaLang/julia/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaLang/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaLang/julia/merges","archive_url":"https://api.github.com/repos/JuliaLang/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaLang/julia/downloads","issues_url":"https://api.github.com/repos/JuliaLang/julia/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaLang/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaLang/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaLang/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaLang/julia/labels{/name}","releases_url":"https://api.github.com/repos/JuliaLang/julia/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaLang/julia/deployments","created_at":"2011-04-21T07:01:50Z","updated_at":"2018-05-21T06:20:07Z","pushed_at":"2018-05-21T06:16:38Z","git_url":"git://github.com/JuliaLang/julia.git","ssh_url":"git@github.com:JuliaLang/julia.git","clone_url":"https://github.com/JuliaLang/julia.git","svn_url":"https://github.com/JuliaLang/julia","homepage":"https://julialang.org/","size":385204,"stargazers_count":11010,"watchers_count":11010,"language":"Julia","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2351,"mirror_url":null,"archived":false,"open_issues_count":2582,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2351,"open_issues":2582,"watchers":11010,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/27177"},"html":{"href":"https://github.com/JuliaLang/julia/pull/27177"},"issue":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/27177"},"comments":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/27177/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/27177/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/27177/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaLang/julia/statuses/6f756e89990981579222cbb7dc8d882272c42df2"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"vtjnash"}}