{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/45301855","id":45301855,"diff_hunk":"@@ -3123,6 +3133,195 @@ void Lowering::LowerAdd(GenTreePtr* pTree, Compiler::fgWalkData* data)\n #endif // !_TARGET_ARMARCH_\n }\n \n+//------------------------------------------------------------------------\n+// LowerUDivUMod: transform GT_UDIV/GT_UMOD nodes with a const power of 2\n+// divisor into GT_RSZ/GT_AND nodes.\n+//\n+// Arguments:\n+//    tree:   pointer to the GT_UDIV/GT_UMOD node to be lowered\n+\n+void Lowering::LowerUDivUMod(GenTree* tree)\n+{\n+    GenTreeOp* divmod = tree->AsOp();\n+    GenTree* divisor = divmod->gtOp2;\n+\n+    if (divisor->IsCnsIntOrI())\n+    {\n+        size_t divisorValue = static_cast<size_t>(divisor->gtIntCon.IconValue());\n+\n+        if (isPow2(divisorValue))\n+        {\n+            genTreeOps newOper;\n+\n+            if (divmod->gtOper == GT_UDIV)","path":"src/jit/lower.cpp","position":41,"original_position":41,"commit_id":"999347b6ecf01cd89a63ade4fd8ac8a99873ac16","original_commit_id":"999347b6ecf01cd89a63ade4fd8ac8a99873ac16","user":{"login":"mikedn","id":9973420,"avatar_url":"https://avatars.githubusercontent.com/u/9973420?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedn","html_url":"https://github.com/mikedn","followers_url":"https://api.github.com/users/mikedn/followers","following_url":"https://api.github.com/users/mikedn/following{/other_user}","gists_url":"https://api.github.com/users/mikedn/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedn/subscriptions","organizations_url":"https://api.github.com/users/mikedn/orgs","repos_url":"https://api.github.com/users/mikedn/repos","events_url":"https://api.github.com/users/mikedn/events{/privacy}","received_events_url":"https://api.github.com/users/mikedn/received_events","type":"User","site_admin":false},"body":"@sivarv Presumably the same is true about other data members which have get accessors - `gtType` and `gtOp1`?","created_at":"2015-11-19T05:38:02Z","updated_at":"2015-11-19T05:38:02Z","html_url":"https://github.com/dotnet/coreclr/pull/1241#discussion_r45301855","pull_request_url":"https://api.github.com/repos/dotnet/coreclr/pulls/1241","_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/45301855"},"html":{"href":"https://github.com/dotnet/coreclr/pull/1241#discussion_r45301855"},"pull_request":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/1241"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/1241","id":40015287,"html_url":"https://github.com/dotnet/coreclr/pull/1241","diff_url":"https://github.com/dotnet/coreclr/pull/1241.diff","patch_url":"https://github.com/dotnet/coreclr/pull/1241.patch","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/1241","number":1241,"state":"open","locked":false,"title":"Extend the DIV/MOD dividend into RDX:RAX only if needed","user":{"login":"mikedn","id":9973420,"avatar_url":"https://avatars.githubusercontent.com/u/9973420?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedn","html_url":"https://github.com/mikedn","followers_url":"https://api.github.com/users/mikedn/followers","following_url":"https://api.github.com/users/mikedn/following{/other_user}","gists_url":"https://api.github.com/users/mikedn/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedn/subscriptions","organizations_url":"https://api.github.com/users/mikedn/orgs","repos_url":"https://api.github.com/users/mikedn/repos","events_url":"https://api.github.com/users/mikedn/events{/privacy}","received_events_url":"https://api.github.com/users/mikedn/received_events","type":"User","site_admin":false},"body":"When the divisor is a power of 2 GT_UMOD/GT_UDIV are emitted as INS_shr/INS_and. This codepath doesn't require the dividend to be in RDX:RAX.\r\nThis includes the special case where the divisor is 1 and the dividend can be moved direclty to the target register without going through RAX. This case doesn't appear to be ever hit, probably it is handled earlier.\r\n\r\nFixes #1207\r\n\r\nThere are quite a few other issues in this area (including the fact that RAX and RDX are reserved anyway) but fixing those would probably require a discussion first. For now a small fix. I can do more if the JIT team agrees.","created_at":"2015-07-15T12:06:43Z","updated_at":"2015-11-19T05:38:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eed8c7334653dd06172de7a6eb9107900171a872","assignee":null,"milestone":{"url":"https://api.github.com/repos/dotnet/coreclr/milestones/6","html_url":"https://github.com/dotnet/coreclr/milestones/1.0.0-rc2%20","labels_url":"https://api.github.com/repos/dotnet/coreclr/milestones/6/labels","id":1380513,"number":6,"title":"1.0.0-rc2 ","description":"","creator":{"login":"tzwlai","id":9966807,"avatar_url":"https://avatars.githubusercontent.com/u/9966807?v=3","gravatar_id":"","url":"https://api.github.com/users/tzwlai","html_url":"https://github.com/tzwlai","followers_url":"https://api.github.com/users/tzwlai/followers","following_url":"https://api.github.com/users/tzwlai/following{/other_user}","gists_url":"https://api.github.com/users/tzwlai/gists{/gist_id}","starred_url":"https://api.github.com/users/tzwlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzwlai/subscriptions","organizations_url":"https://api.github.com/users/tzwlai/orgs","repos_url":"https://api.github.com/users/tzwlai/repos","events_url":"https://api.github.com/users/tzwlai/events{/privacy}","received_events_url":"https://api.github.com/users/tzwlai/received_events","type":"User","site_admin":false},"open_issues":71,"closed_issues":14,"state":"open","created_at":"2015-10-27T22:42:35Z","updated_at":"2015-11-18T18:06:19Z","due_on":"2016-02-02T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/dotnet/coreclr/pulls/1241/commits","review_comments_url":"https://api.github.com/repos/dotnet/coreclr/pulls/1241/comments","review_comment_url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/1241/comments","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/999347b6ecf01cd89a63ade4fd8ac8a99873ac16","head":{"label":"mikedn:modopt","ref":"modopt","sha":"999347b6ecf01cd89a63ade4fd8ac8a99873ac16","user":{"login":"mikedn","id":9973420,"avatar_url":"https://avatars.githubusercontent.com/u/9973420?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedn","html_url":"https://github.com/mikedn","followers_url":"https://api.github.com/users/mikedn/followers","following_url":"https://api.github.com/users/mikedn/following{/other_user}","gists_url":"https://api.github.com/users/mikedn/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedn/subscriptions","organizations_url":"https://api.github.com/users/mikedn/orgs","repos_url":"https://api.github.com/users/mikedn/repos","events_url":"https://api.github.com/users/mikedn/events{/privacy}","received_events_url":"https://api.github.com/users/mikedn/received_events","type":"User","site_admin":false},"repo":{"id":38843321,"name":"coreclr","full_name":"mikedn/coreclr","owner":{"login":"mikedn","id":9973420,"avatar_url":"https://avatars.githubusercontent.com/u/9973420?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedn","html_url":"https://github.com/mikedn","followers_url":"https://api.github.com/users/mikedn/followers","following_url":"https://api.github.com/users/mikedn/following{/other_user}","gists_url":"https://api.github.com/users/mikedn/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedn/subscriptions","organizations_url":"https://api.github.com/users/mikedn/orgs","repos_url":"https://api.github.com/users/mikedn/repos","events_url":"https://api.github.com/users/mikedn/events{/privacy}","received_events_url":"https://api.github.com/users/mikedn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikedn/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called mscorlib. It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes.","fork":true,"url":"https://api.github.com/repos/mikedn/coreclr","forks_url":"https://api.github.com/repos/mikedn/coreclr/forks","keys_url":"https://api.github.com/repos/mikedn/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikedn/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikedn/coreclr/teams","hooks_url":"https://api.github.com/repos/mikedn/coreclr/hooks","issue_events_url":"https://api.github.com/repos/mikedn/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/mikedn/coreclr/events","assignees_url":"https://api.github.com/repos/mikedn/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/mikedn/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/mikedn/coreclr/tags","blobs_url":"https://api.github.com/repos/mikedn/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikedn/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikedn/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikedn/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikedn/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/mikedn/coreclr/languages","stargazers_url":"https://api.github.com/repos/mikedn/coreclr/stargazers","contributors_url":"https://api.github.com/repos/mikedn/coreclr/contributors","subscribers_url":"https://api.github.com/repos/mikedn/coreclr/subscribers","subscription_url":"https://api.github.com/repos/mikedn/coreclr/subscription","commits_url":"https://api.github.com/repos/mikedn/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikedn/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikedn/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikedn/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikedn/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/mikedn/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikedn/coreclr/merges","archive_url":"https://api.github.com/repos/mikedn/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikedn/coreclr/downloads","issues_url":"https://api.github.com/repos/mikedn/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/mikedn/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/mikedn/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/mikedn/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikedn/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/mikedn/coreclr/releases{/id}","created_at":"2015-07-09T20:23:09Z","updated_at":"2015-09-12T08:38:58Z","pushed_at":"2015-11-17T18:23:00Z","git_url":"git://github.com/mikedn/coreclr.git","ssh_url":"git@github.com:mikedn/coreclr.git","clone_url":"https://github.com/mikedn/coreclr.git","svn_url":"https://github.com/mikedn/coreclr","homepage":"http://dotnet.github.io/core/","size":41971,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"dotnet:master","ref":"master","sha":"d9baf060f209f20c302700b2aee778b48e32b9dc","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":30092893,"name":"coreclr","full_name":"dotnet/coreclr","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called mscorlib. It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes.","fork":false,"url":"https://api.github.com/repos/dotnet/coreclr","forks_url":"https://api.github.com/repos/dotnet/coreclr/forks","keys_url":"https://api.github.com/repos/dotnet/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/coreclr/teams","hooks_url":"https://api.github.com/repos/dotnet/coreclr/hooks","issue_events_url":"https://api.github.com/repos/dotnet/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/coreclr/events","assignees_url":"https://api.github.com/repos/dotnet/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/coreclr/tags","blobs_url":"https://api.github.com/repos/dotnet/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/coreclr/languages","stargazers_url":"https://api.github.com/repos/dotnet/coreclr/stargazers","contributors_url":"https://api.github.com/repos/dotnet/coreclr/contributors","subscribers_url":"https://api.github.com/repos/dotnet/coreclr/subscribers","subscription_url":"https://api.github.com/repos/dotnet/coreclr/subscription","commits_url":"https://api.github.com/repos/dotnet/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/coreclr/merges","archive_url":"https://api.github.com/repos/dotnet/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/coreclr/downloads","issues_url":"https://api.github.com/repos/dotnet/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/coreclr/releases{/id}","created_at":"2015-01-30T22:10:02Z","updated_at":"2015-11-19T03:08:24Z","pushed_at":"2015-11-19T05:01:22Z","git_url":"git://github.com/dotnet/coreclr.git","ssh_url":"git@github.com:dotnet/coreclr.git","clone_url":"https://github.com/dotnet/coreclr.git","svn_url":"https://github.com/dotnet/coreclr","homepage":"http://dotnet.github.io/","size":44656,"stargazers_count":5398,"watchers_count":5398,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1150,"mirror_url":null,"open_issues_count":336,"forks":1150,"open_issues":336,"watchers":5398,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/1241"},"html":{"href":"https://github.com/dotnet/coreclr/pull/1241"},"issue":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/1241"},"comments":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/1241/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/1241/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/1241/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/coreclr/statuses/999347b6ecf01cd89a63ade4fd8ac8a99873ac16"}}}}