{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/132568793","pull_request_review_id":55666058,"id":132568793,"diff_hunk":"@@ -1790,7 +1774,268 @@ void Compiler::optFindNaturalLoops()\n                 }\n #endif // FEATURE_EH_FUNCLETS && defined(_TARGET_ARM_)\n \n-                /* At this point we have a loop - record it in the loop table\n+                // Compact the loop (sweep through it and move out any blocks that aren't part of the\n+                // flow cycle), and count the exits.\n+                BasicBlock* moveAfter = nullptr;\n+                for (BasicBlock* previous = top->bbPrev; previous != bottom;)\n+                {\n+                    BasicBlock* block = previous->bbNext;\n+\n+                    if (!loopBlocks.isMember(block->bbNum))\n+                    {\n+                        // This code is lexically between TOP and BOTTOM, but it does not\n+                        // participate in the flow cycle.  Check for a run of consecutive\n+                        // such blocks.\n+                        BasicBlock* lastExitBlock = block;","path":"src/jit/optimizer.cpp","position":null,"original_position":338,"commit_id":"00ea5afde1f1c95f1c17ef5a0c79e81650f034b1","original_commit_id":"2c598e5264302cad3716aca2276196cefb714dcb","user":{"login":"JosephTremoulet","id":10655216,"avatar_url":"https://avatars3.githubusercontent.com/u/10655216?v=4","gravatar_id":"","url":"https://api.github.com/users/JosephTremoulet","html_url":"https://github.com/JosephTremoulet","followers_url":"https://api.github.com/users/JosephTremoulet/followers","following_url":"https://api.github.com/users/JosephTremoulet/following{/other_user}","gists_url":"https://api.github.com/users/JosephTremoulet/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephTremoulet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephTremoulet/subscriptions","organizations_url":"https://api.github.com/users/JosephTremoulet/orgs","repos_url":"https://api.github.com/users/JosephTremoulet/repos","events_url":"https://api.github.com/users/JosephTremoulet/events{/privacy}","received_events_url":"https://api.github.com/users/JosephTremoulet/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2017-08-10T21:10:14Z","updated_at":"2017-08-10T21:10:14Z","html_url":"https://github.com/dotnet/coreclr/pull/13314#discussion_r132568793","pull_request_url":"https://api.github.com/repos/dotnet/coreclr/pulls/13314","_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/132568793"},"html":{"href":"https://github.com/dotnet/coreclr/pull/13314#discussion_r132568793"},"pull_request":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/13314"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/13314","id":135146674,"html_url":"https://github.com/dotnet/coreclr/pull/13314","diff_url":"https://github.com/dotnet/coreclr/pull/13314.diff","patch_url":"https://github.com/dotnet/coreclr/pull/13314.patch","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/13314","number":13314,"state":"open","locked":false,"title":"Lay out loop bodies contiguously","user":{"login":"JosephTremoulet","id":10655216,"avatar_url":"https://avatars3.githubusercontent.com/u/10655216?v=4","gravatar_id":"","url":"https://api.github.com/users/JosephTremoulet","html_url":"https://github.com/JosephTremoulet","followers_url":"https://api.github.com/users/JosephTremoulet/followers","following_url":"https://api.github.com/users/JosephTremoulet/following{/other_user}","gists_url":"https://api.github.com/users/JosephTremoulet/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephTremoulet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephTremoulet/subscriptions","organizations_url":"https://api.github.com/users/JosephTremoulet/orgs","repos_url":"https://api.github.com/users/JosephTremoulet/repos","events_url":"https://api.github.com/users/JosephTremoulet/events{/privacy}","received_events_url":"https://api.github.com/users/JosephTremoulet/received_events","type":"User","site_admin":false},"body":"Rearrange basic blocks during loop identification so that loop bodies\r\nare kept contiguous when possible.  Blocks in the lexical range of the\r\nloop which do not participate in the flow cycle (which typically\r\ncorrespond to code associated with early exits using `break` or\r\n`return`) are moved out below the loop when possible without breaking EH\r\nregion nesting.  The target insertion point, when possible, is chosen to\r\nbe the first spot below the loop that will not break up fall-through.\r\n\r\nLayout can significantly affect the performance of loops, particularly\r\nsmall search loops, by avoiding the taken branch on the hot path,\r\nimproving the locality of the code fetched while iterating the loop, and\r\npotentially aiding loop stream detection.\r\n\r\nResolves #9692.\r\n","created_at":"2017-08-10T14:57:15Z","updated_at":"2017-08-10T21:10:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"144380229d003b1f2b760d7f06fbcace6fbc555a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/coreclr/pulls/13314/commits","review_comments_url":"https://api.github.com/repos/dotnet/coreclr/pulls/13314/comments","review_comment_url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/13314/comments","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/00ea5afde1f1c95f1c17ef5a0c79e81650f034b1","head":{"label":"JosephTremoulet:loops","ref":"loops","sha":"00ea5afde1f1c95f1c17ef5a0c79e81650f034b1","user":{"login":"JosephTremoulet","id":10655216,"avatar_url":"https://avatars3.githubusercontent.com/u/10655216?v=4","gravatar_id":"","url":"https://api.github.com/users/JosephTremoulet","html_url":"https://github.com/JosephTremoulet","followers_url":"https://api.github.com/users/JosephTremoulet/followers","following_url":"https://api.github.com/users/JosephTremoulet/following{/other_user}","gists_url":"https://api.github.com/users/JosephTremoulet/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephTremoulet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephTremoulet/subscriptions","organizations_url":"https://api.github.com/users/JosephTremoulet/orgs","repos_url":"https://api.github.com/users/JosephTremoulet/repos","events_url":"https://api.github.com/users/JosephTremoulet/events{/privacy}","received_events_url":"https://api.github.com/users/JosephTremoulet/received_events","type":"User","site_admin":false},"repo":{"id":31388796,"name":"coreclr","full_name":"JosephTremoulet/coreclr","owner":{"login":"JosephTremoulet","id":10655216,"avatar_url":"https://avatars3.githubusercontent.com/u/10655216?v=4","gravatar_id":"","url":"https://api.github.com/users/JosephTremoulet","html_url":"https://github.com/JosephTremoulet","followers_url":"https://api.github.com/users/JosephTremoulet/followers","following_url":"https://api.github.com/users/JosephTremoulet/following{/other_user}","gists_url":"https://api.github.com/users/JosephTremoulet/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephTremoulet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephTremoulet/subscriptions","organizations_url":"https://api.github.com/users/JosephTremoulet/orgs","repos_url":"https://api.github.com/users/JosephTremoulet/repos","events_url":"https://api.github.com/users/JosephTremoulet/events{/privacy}","received_events_url":"https://api.github.com/users/JosephTremoulet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JosephTremoulet/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR. It is an execution engine for .NET apps, performing functions such as IL byte code loading, compilation to machine code and garbage collection. The repo contains the complete up-to-date CoreCLR codebase.","fork":true,"url":"https://api.github.com/repos/JosephTremoulet/coreclr","forks_url":"https://api.github.com/repos/JosephTremoulet/coreclr/forks","keys_url":"https://api.github.com/repos/JosephTremoulet/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JosephTremoulet/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JosephTremoulet/coreclr/teams","hooks_url":"https://api.github.com/repos/JosephTremoulet/coreclr/hooks","issue_events_url":"https://api.github.com/repos/JosephTremoulet/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/JosephTremoulet/coreclr/events","assignees_url":"https://api.github.com/repos/JosephTremoulet/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/JosephTremoulet/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/JosephTremoulet/coreclr/tags","blobs_url":"https://api.github.com/repos/JosephTremoulet/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JosephTremoulet/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JosephTremoulet/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/JosephTremoulet/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JosephTremoulet/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/JosephTremoulet/coreclr/languages","stargazers_url":"https://api.github.com/repos/JosephTremoulet/coreclr/stargazers","contributors_url":"https://api.github.com/repos/JosephTremoulet/coreclr/contributors","subscribers_url":"https://api.github.com/repos/JosephTremoulet/coreclr/subscribers","subscription_url":"https://api.github.com/repos/JosephTremoulet/coreclr/subscription","commits_url":"https://api.github.com/repos/JosephTremoulet/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/JosephTremoulet/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/JosephTremoulet/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/JosephTremoulet/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/JosephTremoulet/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/JosephTremoulet/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JosephTremoulet/coreclr/merges","archive_url":"https://api.github.com/repos/JosephTremoulet/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JosephTremoulet/coreclr/downloads","issues_url":"https://api.github.com/repos/JosephTremoulet/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/JosephTremoulet/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/JosephTremoulet/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/JosephTremoulet/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JosephTremoulet/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/JosephTremoulet/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/JosephTremoulet/coreclr/deployments","created_at":"2015-02-26T21:05:15Z","updated_at":"2016-03-24T15:18:56Z","pushed_at":"2017-08-10T21:04:15Z","git_url":"git://github.com/JosephTremoulet/coreclr.git","ssh_url":"git@github.com:JosephTremoulet/coreclr.git","clone_url":"https://github.com/JosephTremoulet/coreclr.git","svn_url":"https://github.com/JosephTremoulet/coreclr","homepage":"","size":170830,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"51ef3969ccbeddb6ed1557fadb4bf2f36689437a","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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://avatars0.githubusercontent.com/u/9141961?v=4","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. We welcome contributions.","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}","deployments_url":"https://api.github.com/repos/dotnet/coreclr/deployments","created_at":"2015-01-30T22:10:02Z","updated_at":"2017-08-10T15:23:57Z","pushed_at":"2017-08-10T21:10:06Z","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":"https://github.com/dotnet/core","size":172284,"stargazers_count":7986,"watchers_count":7986,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2018,"mirror_url":null,"open_issues_count":1395,"forks":2018,"open_issues":1395,"watchers":7986,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/13314"},"html":{"href":"https://github.com/dotnet/coreclr/pull/13314"},"issue":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/13314"},"comments":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/13314/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/13314/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/13314/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/coreclr/statuses/00ea5afde1f1c95f1c17ef5a0c79e81650f034b1"}}}}
{"actor":{"display_login":"JosephTremoulet"}}