-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CGU cleanups #111899
Merged
Merged
CGU cleanups #111899
Commits on May 24, 2023
-
Inline and remove
numbered_codegen_unit_name
.It is small and has a single call site, and this change will facilitate the next commit.
Configuration menu - View commit details
-
Copy full SHA for e26c0c9 - Browse repository at this point
Copy the full SHA e26c0c9View commit details -
Three of the four methods in `DefaultPartitioning` are defined in `default.rs`. But `merge_codegen_units` is defined in a separate module, `merging`, even though it's less than 100 lines of code and roughly the same size as the other three methods. (Also, the `merging` module currently sits alongside `default`, when it should be a submodule of `default`, adding to the confusion.) In rust-lang#74275 this explanation was given: > I pulled this out into a separate module since it seemed like we might > want a few different merge algorithms to choose from. But in the three years since there have been no additional merging algorithms, and there is no mechanism for choosing between different merging algorithms. (There is a mechanism, `-Zcgu-partitioning-strategy`, for choosing between different partitioning strategies, but the merging algorithm is just one piece of a partitioning strategy.) This commit merges `merging` into `default`, making the code easier to navigate and read.
Configuration menu - View commit details
-
Copy full SHA for b39b709 - Browse repository at this point
Copy the full SHA b39b709View commit details -
Remove
{Pre,Post}InliningPartitioning
.I find that these structs obfuscate the code. Removing them and just passing the individual fields around makes the `Partition` method signatures a little longer, but makes the data flow much clearer. E.g. - `codegen_units` is mutable all the way through. - `codegen_units`'s length is changed by `merge_codegen_units`, but only the individual elements are changed by `place_inlined_mono_items` and `internalize_symbols`. - `roots`, `internalization_candidates`, and `mono_item_placements` are all immutable after creation, and all used by just one of the four methods.
Configuration menu - View commit details
-
Copy full SHA for 20de2ba - Browse repository at this point
Copy the full SHA 20de2baView commit details -
This is something that took me some time to figure out.
Configuration menu - View commit details
-
Copy full SHA for 59c5259 - Browse repository at this point
Copy the full SHA 59c5259View commit details
Commits on May 25, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 86754cd - Browse repository at this point
Copy the full SHA 86754cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for ed216e2 - Browse repository at this point
Copy the full SHA ed216e2View commit details -
Add struct for the return type of
place_root_mono_items
.As per review request.
Configuration menu - View commit details
-
Copy full SHA for e6b99a6 - Browse repository at this point
Copy the full SHA e6b99a6View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.