{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/88808087","pull_request_review_id":9370202,"id":88808087,"diff_hunk":"@@ -511,41 +512,76 @@ pub struct Struct {\n     /// If true, the size is exact, otherwise it's only a lower bound.\n     pub sized: bool,\n \n-    /// Offsets for the first byte of each field.\n+    /// Offsets for the first byte of each field, ordered to match the tys.\n+    /// This vector does not go in increasing order.\n     /// FIXME(eddyb) use small vector optimization for the common case.\n     pub offsets: Vec<Size>,\n \n+    /// Maps field indices to GEP indices, depending how fields were permuted.","path":"src/librustc/ty/layout.rs","position":18,"original_position":18,"commit_id":"1fbefa0d74b6d44ffe83229c1145135e3e3b378c","original_commit_id":"4b6edffc233a9b30b3c51bda2f4e293613325ec1","user":{"login":"camlorn","id":6968705,"avatar_url":"https://avatars.githubusercontent.com/u/6968705?v=3","gravatar_id":"","url":"https://api.github.com/users/camlorn","html_url":"https://github.com/camlorn","followers_url":"https://api.github.com/users/camlorn/followers","following_url":"https://api.github.com/users/camlorn/following{/other_user}","gists_url":"https://api.github.com/users/camlorn/gists{/gist_id}","starred_url":"https://api.github.com/users/camlorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camlorn/subscriptions","organizations_url":"https://api.github.com/users/camlorn/orgs","repos_url":"https://api.github.com/users/camlorn/repos","events_url":"https://api.github.com/users/camlorn/events{/privacy}","received_events_url":"https://api.github.com/users/camlorn/received_events","type":"User","site_admin":false},"body":"I ended up calling these source order and memory order, I don't think there's anything better.  The `gep_index` vec is now `memory_index`.\r\n\r\nIf there's better nomenclature, I don't know what it is.","created_at":"2016-11-20T18:36:44Z","updated_at":"2016-11-20T18:36:44Z","html_url":"https://github.com/rust-lang/rust/pull/37429#discussion_r88808087","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/37429","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/88808087"},"html":{"href":"https://github.com/rust-lang/rust/pull/37429#discussion_r88808087"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/37429"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/37429","id":91130640,"html_url":"https://github.com/rust-lang/rust/pull/37429","diff_url":"https://github.com/rust-lang/rust/pull/37429.diff","patch_url":"https://github.com/rust-lang/rust/pull/37429.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/37429","number":37429,"state":"open","locked":false,"title":"[WIP] struct field reordering and optimization","user":{"login":"camlorn","id":6968705,"avatar_url":"https://avatars.githubusercontent.com/u/6968705?v=3","gravatar_id":"","url":"https://api.github.com/users/camlorn","html_url":"https://github.com/camlorn","followers_url":"https://api.github.com/users/camlorn/followers","following_url":"https://api.github.com/users/camlorn/following{/other_user}","gists_url":"https://api.github.com/users/camlorn/gists{/gist_id}","starred_url":"https://api.github.com/users/camlorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camlorn/subscriptions","organizations_url":"https://api.github.com/users/camlorn/orgs","repos_url":"https://api.github.com/users/camlorn/repos","events_url":"https://api.github.com/users/camlorn/events{/privacy}","received_events_url":"https://api.github.com/users/camlorn/received_events","type":"User","site_admin":false},"body":"This is work in progress.  The goal is to divorce the order of fields in source code from the order of fields in the LLVM IR, then optimize structs (and tuples/enum variants)by always ordering fields from least to most aligned.  It does not work yet.  I intend to check compiler memory usage as a benchmark, and a crater run will probably be required.\n\nI don't know enough of the compiler to complete this work unaided.  If you see places that still need updating, please mention them.  The only one I know of currently is debuginfo, which I'm putting off intentionally until a bit later.\n\nr? @eddyb\n","created_at":"2016-10-27T04:14:02Z","updated_at":"2016-11-20T18:36:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98ced455173f18de06a0fae6fae6877e8c448695","assignee":{"login":"eddyb","id":77424,"avatar_url":"https://avatars.githubusercontent.com/u/77424?v=3","gravatar_id":"","url":"https://api.github.com/users/eddyb","html_url":"https://github.com/eddyb","followers_url":"https://api.github.com/users/eddyb/followers","following_url":"https://api.github.com/users/eddyb/following{/other_user}","gists_url":"https://api.github.com/users/eddyb/gists{/gist_id}","starred_url":"https://api.github.com/users/eddyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddyb/subscriptions","organizations_url":"https://api.github.com/users/eddyb/orgs","repos_url":"https://api.github.com/users/eddyb/repos","events_url":"https://api.github.com/users/eddyb/events{/privacy}","received_events_url":"https://api.github.com/users/eddyb/received_events","type":"User","site_admin":false},"assignees":[{"login":"eddyb","id":77424,"avatar_url":"https://avatars.githubusercontent.com/u/77424?v=3","gravatar_id":"","url":"https://api.github.com/users/eddyb","html_url":"https://github.com/eddyb","followers_url":"https://api.github.com/users/eddyb/followers","following_url":"https://api.github.com/users/eddyb/following{/other_user}","gists_url":"https://api.github.com/users/eddyb/gists{/gist_id}","starred_url":"https://api.github.com/users/eddyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddyb/subscriptions","organizations_url":"https://api.github.com/users/eddyb/orgs","repos_url":"https://api.github.com/users/eddyb/repos","events_url":"https://api.github.com/users/eddyb/events{/privacy}","received_events_url":"https://api.github.com/users/eddyb/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/37429/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/37429/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/37429/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/1fbefa0d74b6d44ffe83229c1145135e3e3b378c","head":{"label":"camlorn:univariant_layout_optimization","ref":"univariant_layout_optimization","sha":"1fbefa0d74b6d44ffe83229c1145135e3e3b378c","user":{"login":"camlorn","id":6968705,"avatar_url":"https://avatars.githubusercontent.com/u/6968705?v=3","gravatar_id":"","url":"https://api.github.com/users/camlorn","html_url":"https://github.com/camlorn","followers_url":"https://api.github.com/users/camlorn/followers","following_url":"https://api.github.com/users/camlorn/following{/other_user}","gists_url":"https://api.github.com/users/camlorn/gists{/gist_id}","starred_url":"https://api.github.com/users/camlorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camlorn/subscriptions","organizations_url":"https://api.github.com/users/camlorn/orgs","repos_url":"https://api.github.com/users/camlorn/repos","events_url":"https://api.github.com/users/camlorn/events{/privacy}","received_events_url":"https://api.github.com/users/camlorn/received_events","type":"User","site_admin":false},"repo":{"id":66574752,"name":"rust","full_name":"camlorn/rust","owner":{"login":"camlorn","id":6968705,"avatar_url":"https://avatars.githubusercontent.com/u/6968705?v=3","gravatar_id":"","url":"https://api.github.com/users/camlorn","html_url":"https://github.com/camlorn","followers_url":"https://api.github.com/users/camlorn/followers","following_url":"https://api.github.com/users/camlorn/following{/other_user}","gists_url":"https://api.github.com/users/camlorn/gists{/gist_id}","starred_url":"https://api.github.com/users/camlorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camlorn/subscriptions","organizations_url":"https://api.github.com/users/camlorn/orgs","repos_url":"https://api.github.com/users/camlorn/repos","events_url":"https://api.github.com/users/camlorn/events{/privacy}","received_events_url":"https://api.github.com/users/camlorn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/camlorn/rust","description":"A safe, concurrent, practical language.","fork":true,"url":"https://api.github.com/repos/camlorn/rust","forks_url":"https://api.github.com/repos/camlorn/rust/forks","keys_url":"https://api.github.com/repos/camlorn/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/camlorn/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/camlorn/rust/teams","hooks_url":"https://api.github.com/repos/camlorn/rust/hooks","issue_events_url":"https://api.github.com/repos/camlorn/rust/issues/events{/number}","events_url":"https://api.github.com/repos/camlorn/rust/events","assignees_url":"https://api.github.com/repos/camlorn/rust/assignees{/user}","branches_url":"https://api.github.com/repos/camlorn/rust/branches{/branch}","tags_url":"https://api.github.com/repos/camlorn/rust/tags","blobs_url":"https://api.github.com/repos/camlorn/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/camlorn/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/camlorn/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/camlorn/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/camlorn/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/camlorn/rust/languages","stargazers_url":"https://api.github.com/repos/camlorn/rust/stargazers","contributors_url":"https://api.github.com/repos/camlorn/rust/contributors","subscribers_url":"https://api.github.com/repos/camlorn/rust/subscribers","subscription_url":"https://api.github.com/repos/camlorn/rust/subscription","commits_url":"https://api.github.com/repos/camlorn/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/camlorn/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/camlorn/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/camlorn/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/camlorn/rust/contents/{+path}","compare_url":"https://api.github.com/repos/camlorn/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/camlorn/rust/merges","archive_url":"https://api.github.com/repos/camlorn/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/camlorn/rust/downloads","issues_url":"https://api.github.com/repos/camlorn/rust/issues{/number}","pulls_url":"https://api.github.com/repos/camlorn/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/camlorn/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/camlorn/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/camlorn/rust/labels{/name}","releases_url":"https://api.github.com/repos/camlorn/rust/releases{/id}","deployments_url":"https://api.github.com/repos/camlorn/rust/deployments","created_at":"2016-08-25T16:25:46Z","updated_at":"2016-08-25T16:26:06Z","pushed_at":"2016-11-20T18:23:04Z","git_url":"git://github.com/camlorn/rust.git","ssh_url":"git@github.com:camlorn/rust.git","clone_url":"https://github.com/camlorn/rust.git","svn_url":"https://github.com/camlorn/rust","homepage":"https://www.rust-lang.org","size":310071,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":"rust-lang:master","ref":"master","sha":"9d4b6fa51d86ad6141679a5a157fcd9bca48064c","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":724712,"name":"rust","full_name":"rust-lang/rust","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/rust","description":"A safe, concurrent, practical language.","fork":false,"url":"https://api.github.com/repos/rust-lang/rust","forks_url":"https://api.github.com/repos/rust-lang/rust/forks","keys_url":"https://api.github.com/repos/rust-lang/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rust/teams","hooks_url":"https://api.github.com/repos/rust-lang/rust/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rust/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rust/events","assignees_url":"https://api.github.com/repos/rust-lang/rust/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rust/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rust/tags","blobs_url":"https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rust/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rust/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rust/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rust/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rust/subscription","commits_url":"https://api.github.com/repos/rust-lang/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/rust/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rust/merges","archive_url":"https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rust/downloads","issues_url":"https://api.github.com/repos/rust-lang/rust/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rust/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rust/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang/rust/deployments","created_at":"2010-06-16T20:39:03Z","updated_at":"2016-11-20T16:30:31Z","pushed_at":"2016-11-20T18:23:12Z","git_url":"git://github.com/rust-lang/rust.git","ssh_url":"git@github.com:rust-lang/rust.git","clone_url":"https://github.com/rust-lang/rust.git","svn_url":"https://github.com/rust-lang/rust","homepage":"https://www.rust-lang.org","size":526987,"stargazers_count":19052,"watchers_count":19052,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3659,"mirror_url":null,"open_issues_count":2890,"forks":3659,"open_issues":2890,"watchers":19052,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/37429"},"html":{"href":"https://github.com/rust-lang/rust/pull/37429"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/37429"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/37429/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/37429/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/37429/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/1fbefa0d74b6d44ffe83229c1145135e3e3b378c"}}}}
{"actor":{"display_login":"camlorn"}}