{"action":"created","comment":{"url":"https://api.github.com/repos/mono/mono/pulls/comments/47414365","id":47414365,"diff_hunk":"@@ -3685,6 +3685,8 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl\n \t\tmono_local_deadce (cfg);\n \tif (cfg->opt & MONO_OPT_ALIAS_ANALYSIS)\n \t\tmono_local_alias_analysis (cfg);\n+\tif (cfg->opt & MONO_OPT_DIVREM && cfg->has_divisions)\n+\t\tmono_local_div_imm_removal (cfg);","path":"mono/mini/mini.c","position":5,"original_position":5,"commit_id":"4157412e0d1c88602484755fb2c10198e3be55db","original_commit_id":"4157412e0d1c88602484755fb2c10198e3be55db","user":{"login":"lewurm","id":75403,"avatar_url":"https://avatars.githubusercontent.com/u/75403?v=3","gravatar_id":"","url":"https://api.github.com/users/lewurm","html_url":"https://github.com/lewurm","followers_url":"https://api.github.com/users/lewurm/followers","following_url":"https://api.github.com/users/lewurm/following{/other_user}","gists_url":"https://api.github.com/users/lewurm/gists{/gist_id}","starred_url":"https://api.github.com/users/lewurm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lewurm/subscriptions","organizations_url":"https://api.github.com/users/lewurm/orgs","repos_url":"https://api.github.com/users/lewurm/repos","events_url":"https://api.github.com/users/lewurm/events{/privacy}","received_events_url":"https://api.github.com/users/lewurm/received_events","type":"User","site_admin":false},"body":"just saw the `cfg->has_divisions` hack. it helps, but oh well.","created_at":"2015-12-11T22:40:33Z","updated_at":"2015-12-11T22:40:33Z","html_url":"https://github.com/mono/mono/pull/2332#discussion_r47414365","pull_request_url":"https://api.github.com/repos/mono/mono/pulls/2332","_links":{"self":{"href":"https://api.github.com/repos/mono/mono/pulls/comments/47414365"},"html":{"href":"https://github.com/mono/mono/pull/2332#discussion_r47414365"},"pull_request":{"href":"https://api.github.com/repos/mono/mono/pulls/2332"}}},"pull_request":{"url":"https://api.github.com/repos/mono/mono/pulls/2332","id":53441170,"html_url":"https://github.com/mono/mono/pull/2332","diff_url":"https://github.com/mono/mono/pull/2332.diff","patch_url":"https://github.com/mono/mono/pull/2332.patch","issue_url":"https://api.github.com/repos/mono/mono/issues/2332","number":2332,"state":"open","locked":false,"title":"[jit] Optimize divisions by immediate","user":{"login":"BrzVlad","id":4720621,"avatar_url":"https://avatars.githubusercontent.com/u/4720621?v=3","gravatar_id":"","url":"https://api.github.com/users/BrzVlad","html_url":"https://github.com/BrzVlad","followers_url":"https://api.github.com/users/BrzVlad/followers","following_url":"https://api.github.com/users/BrzVlad/following{/other_user}","gists_url":"https://api.github.com/users/BrzVlad/gists{/gist_id}","starred_url":"https://api.github.com/users/BrzVlad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrzVlad/subscriptions","organizations_url":"https://api.github.com/users/BrzVlad/orgs","repos_url":"https://api.github.com/users/BrzVlad/repos","events_url":"https://api.github.com/users/BrzVlad/events{/privacy}","received_events_url":"https://api.github.com/users/BrzVlad/received_events","type":"User","site_admin":false},"body":"This optimizes div imm operations by replacing them with multiplication, addition and shift operations which are faster. We only use it on 64bit architectures, since 32 bit architectures emulate OP_LMUL.\r\n\r\nThe performance increase is about 3 times for signed division and about 6 times for unsigned division. On amd64 the emitted code for an immediate division can increase from ~15 bytes, up to ~30 bytes, while on arm64 it actually decreases the size of the emitted code. The overall jit processing time per division would increase from ~1μs to ~1.5μs (about 200 runs of the optimized code would make up for this time). But the code size/jit time is negligible since it is not common in most methods (the optimization applies to 64 cases in corlib, 220 cases in entire bcl)\r\n\r\nHistoric PR : https://github.com/mono/mono/pull/1350\r\n\r\nhttp://www.hackersdelight.org/permissions.htm","created_at":"2015-12-11T20:38:14Z","updated_at":"2015-12-11T22:40:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eaa27dda674bed0d8fb154f994f634f627fdc2b5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mono/mono/pulls/2332/commits","review_comments_url":"https://api.github.com/repos/mono/mono/pulls/2332/comments","review_comment_url":"https://api.github.com/repos/mono/mono/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mono/mono/issues/2332/comments","statuses_url":"https://api.github.com/repos/mono/mono/statuses/4157412e0d1c88602484755fb2c10198e3be55db","head":{"label":"BrzVlad:feature-div-with-mul","ref":"feature-div-with-mul","sha":"4157412e0d1c88602484755fb2c10198e3be55db","user":{"login":"BrzVlad","id":4720621,"avatar_url":"https://avatars.githubusercontent.com/u/4720621?v=3","gravatar_id":"","url":"https://api.github.com/users/BrzVlad","html_url":"https://github.com/BrzVlad","followers_url":"https://api.github.com/users/BrzVlad/followers","following_url":"https://api.github.com/users/BrzVlad/following{/other_user}","gists_url":"https://api.github.com/users/BrzVlad/gists{/gist_id}","starred_url":"https://api.github.com/users/BrzVlad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrzVlad/subscriptions","organizations_url":"https://api.github.com/users/BrzVlad/orgs","repos_url":"https://api.github.com/users/BrzVlad/repos","events_url":"https://api.github.com/users/BrzVlad/events{/privacy}","received_events_url":"https://api.github.com/users/BrzVlad/received_events","type":"User","site_admin":false},"repo":{"id":10743068,"name":"mono","full_name":"BrzVlad/mono","owner":{"login":"BrzVlad","id":4720621,"avatar_url":"https://avatars.githubusercontent.com/u/4720621?v=3","gravatar_id":"","url":"https://api.github.com/users/BrzVlad","html_url":"https://github.com/BrzVlad","followers_url":"https://api.github.com/users/BrzVlad/followers","following_url":"https://api.github.com/users/BrzVlad/following{/other_user}","gists_url":"https://api.github.com/users/BrzVlad/gists{/gist_id}","starred_url":"https://api.github.com/users/BrzVlad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrzVlad/subscriptions","organizations_url":"https://api.github.com/users/BrzVlad/orgs","repos_url":"https://api.github.com/users/BrzVlad/repos","events_url":"https://api.github.com/users/BrzVlad/events{/privacy}","received_events_url":"https://api.github.com/users/BrzVlad/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BrzVlad/mono","description":"Mono open source ECMA CLI, C# and .NET implementation.","fork":true,"url":"https://api.github.com/repos/BrzVlad/mono","forks_url":"https://api.github.com/repos/BrzVlad/mono/forks","keys_url":"https://api.github.com/repos/BrzVlad/mono/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BrzVlad/mono/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BrzVlad/mono/teams","hooks_url":"https://api.github.com/repos/BrzVlad/mono/hooks","issue_events_url":"https://api.github.com/repos/BrzVlad/mono/issues/events{/number}","events_url":"https://api.github.com/repos/BrzVlad/mono/events","assignees_url":"https://api.github.com/repos/BrzVlad/mono/assignees{/user}","branches_url":"https://api.github.com/repos/BrzVlad/mono/branches{/branch}","tags_url":"https://api.github.com/repos/BrzVlad/mono/tags","blobs_url":"https://api.github.com/repos/BrzVlad/mono/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BrzVlad/mono/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BrzVlad/mono/git/refs{/sha}","trees_url":"https://api.github.com/repos/BrzVlad/mono/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BrzVlad/mono/statuses/{sha}","languages_url":"https://api.github.com/repos/BrzVlad/mono/languages","stargazers_url":"https://api.github.com/repos/BrzVlad/mono/stargazers","contributors_url":"https://api.github.com/repos/BrzVlad/mono/contributors","subscribers_url":"https://api.github.com/repos/BrzVlad/mono/subscribers","subscription_url":"https://api.github.com/repos/BrzVlad/mono/subscription","commits_url":"https://api.github.com/repos/BrzVlad/mono/commits{/sha}","git_commits_url":"https://api.github.com/repos/BrzVlad/mono/git/commits{/sha}","comments_url":"https://api.github.com/repos/BrzVlad/mono/comments{/number}","issue_comment_url":"https://api.github.com/repos/BrzVlad/mono/issues/comments{/number}","contents_url":"https://api.github.com/repos/BrzVlad/mono/contents/{+path}","compare_url":"https://api.github.com/repos/BrzVlad/mono/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BrzVlad/mono/merges","archive_url":"https://api.github.com/repos/BrzVlad/mono/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BrzVlad/mono/downloads","issues_url":"https://api.github.com/repos/BrzVlad/mono/issues{/number}","pulls_url":"https://api.github.com/repos/BrzVlad/mono/pulls{/number}","milestones_url":"https://api.github.com/repos/BrzVlad/mono/milestones{/number}","notifications_url":"https://api.github.com/repos/BrzVlad/mono/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BrzVlad/mono/labels{/name}","releases_url":"https://api.github.com/repos/BrzVlad/mono/releases{/id}","created_at":"2013-06-17T17:40:26Z","updated_at":"2015-07-30T20:59:06Z","pushed_at":"2015-12-11T19:36:59Z","git_url":"git://github.com/BrzVlad/mono.git","ssh_url":"git@github.com:BrzVlad/mono.git","clone_url":"https://github.com/BrzVlad/mono.git","svn_url":"https://github.com/BrzVlad/mono","homepage":"http://www.mono-project.com/","size":451072,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"mono:master","ref":"master","sha":"60e1beca4a884cf219670c0822994263a52309e4","user":{"login":"mono","id":53395,"avatar_url":"https://avatars.githubusercontent.com/u/53395?v=3","gravatar_id":"","url":"https://api.github.com/users/mono","html_url":"https://github.com/mono","followers_url":"https://api.github.com/users/mono/followers","following_url":"https://api.github.com/users/mono/following{/other_user}","gists_url":"https://api.github.com/users/mono/gists{/gist_id}","starred_url":"https://api.github.com/users/mono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mono/subscriptions","organizations_url":"https://api.github.com/users/mono/orgs","repos_url":"https://api.github.com/users/mono/repos","events_url":"https://api.github.com/users/mono/events{/privacy}","received_events_url":"https://api.github.com/users/mono/received_events","type":"Organization","site_admin":false},"repo":{"id":791611,"name":"mono","full_name":"mono/mono","owner":{"login":"mono","id":53395,"avatar_url":"https://avatars.githubusercontent.com/u/53395?v=3","gravatar_id":"","url":"https://api.github.com/users/mono","html_url":"https://github.com/mono","followers_url":"https://api.github.com/users/mono/followers","following_url":"https://api.github.com/users/mono/following{/other_user}","gists_url":"https://api.github.com/users/mono/gists{/gist_id}","starred_url":"https://api.github.com/users/mono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mono/subscriptions","organizations_url":"https://api.github.com/users/mono/orgs","repos_url":"https://api.github.com/users/mono/repos","events_url":"https://api.github.com/users/mono/events{/privacy}","received_events_url":"https://api.github.com/users/mono/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mono/mono","description":"Mono open source ECMA CLI, C# and .NET implementation.","fork":false,"url":"https://api.github.com/repos/mono/mono","forks_url":"https://api.github.com/repos/mono/mono/forks","keys_url":"https://api.github.com/repos/mono/mono/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mono/mono/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mono/mono/teams","hooks_url":"https://api.github.com/repos/mono/mono/hooks","issue_events_url":"https://api.github.com/repos/mono/mono/issues/events{/number}","events_url":"https://api.github.com/repos/mono/mono/events","assignees_url":"https://api.github.com/repos/mono/mono/assignees{/user}","branches_url":"https://api.github.com/repos/mono/mono/branches{/branch}","tags_url":"https://api.github.com/repos/mono/mono/tags","blobs_url":"https://api.github.com/repos/mono/mono/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mono/mono/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mono/mono/git/refs{/sha}","trees_url":"https://api.github.com/repos/mono/mono/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mono/mono/statuses/{sha}","languages_url":"https://api.github.com/repos/mono/mono/languages","stargazers_url":"https://api.github.com/repos/mono/mono/stargazers","contributors_url":"https://api.github.com/repos/mono/mono/contributors","subscribers_url":"https://api.github.com/repos/mono/mono/subscribers","subscription_url":"https://api.github.com/repos/mono/mono/subscription","commits_url":"https://api.github.com/repos/mono/mono/commits{/sha}","git_commits_url":"https://api.github.com/repos/mono/mono/git/commits{/sha}","comments_url":"https://api.github.com/repos/mono/mono/comments{/number}","issue_comment_url":"https://api.github.com/repos/mono/mono/issues/comments{/number}","contents_url":"https://api.github.com/repos/mono/mono/contents/{+path}","compare_url":"https://api.github.com/repos/mono/mono/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mono/mono/merges","archive_url":"https://api.github.com/repos/mono/mono/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mono/mono/downloads","issues_url":"https://api.github.com/repos/mono/mono/issues{/number}","pulls_url":"https://api.github.com/repos/mono/mono/pulls{/number}","milestones_url":"https://api.github.com/repos/mono/mono/milestones{/number}","notifications_url":"https://api.github.com/repos/mono/mono/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mono/mono/labels{/name}","releases_url":"https://api.github.com/repos/mono/mono/releases{/id}","created_at":"2010-07-22T18:06:36Z","updated_at":"2015-12-11T08:29:56Z","pushed_at":"2015-12-11T21:27:51Z","git_url":"git://github.com/mono/mono.git","ssh_url":"git@github.com:mono/mono.git","clone_url":"https://github.com/mono/mono.git","svn_url":"https://github.com/mono/mono","homepage":"http://www.mono-project.com/","size":481779,"stargazers_count":4102,"watchers_count":4102,"language":"C#","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2025,"mirror_url":null,"open_issues_count":122,"forks":2025,"open_issues":122,"watchers":4102,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mono/mono/pulls/2332"},"html":{"href":"https://github.com/mono/mono/pull/2332"},"issue":{"href":"https://api.github.com/repos/mono/mono/issues/2332"},"comments":{"href":"https://api.github.com/repos/mono/mono/issues/2332/comments"},"review_comments":{"href":"https://api.github.com/repos/mono/mono/pulls/2332/comments"},"review_comment":{"href":"https://api.github.com/repos/mono/mono/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mono/mono/pulls/2332/commits"},"statuses":{"href":"https://api.github.com/repos/mono/mono/statuses/4157412e0d1c88602484755fb2c10198e3be55db"}}}}