<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_monomorphize/src/partitioning, branch 1.86.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.86.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.86.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-01-30T02:31:13+00:00</updated>
<entry>
<title>upstream rustc_codegen_ssa/rustc_middle changes for enzyme/autodiff</title>
<updated>2025-01-30T02:31:13+00:00</updated>
<author>
<name>Manuel Drehwald</name>
<email>git@manuel.drehwald.info</email>
</author>
<published>2025-01-30T02:31:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1f30517d40a9a8fe3b89479891c7a167adb75cbd'/>
<id>urn:sha1:1f30517d40a9a8fe3b89479891c7a167adb75cbd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rename `partitioning/mod.rs` as `partitioning.rs`.</title>
<updated>2023-05-30T07:48:55+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-05-30T07:41:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5ed014977e59f886a51844fcae8eab80467e45e6'/>
<id>urn:sha1:5ed014977e59f886a51844fcae8eab80467e45e6</id>
<content type='text'>
Because it's now the only file within
`compiler/rustc_monomorphize/src/partitioning/`.
</content>
</entry>
<entry>
<title>Merge `default.rs` into `mod.rs`.</title>
<updated>2023-05-30T07:48:54+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-05-30T07:39:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=66cf072ac8fa10648d5eccbacb75c7423204af1e'/>
<id>urn:sha1:66cf072ac8fa10648d5eccbacb75c7423204af1e</id>
<content type='text'>
Within `compiler/rustc_monomorphize/src/partitioning/`, because the
previous commit removed the need for `default.rs` to be a separate file.
</content>
</entry>
<entry>
<title>Remove `-Zcgu-partitioning-strategy`.</title>
<updated>2023-05-30T07:48:49+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-05-28T23:56:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=97d4a38de9fd6efb4588a7262cd9c66c2093e29f'/>
<id>urn:sha1:97d4a38de9fd6efb4588a7262cd9c66c2093e29f</id>
<content type='text'>
This option was introduced three years ago, but it's never been
meaningfully used, and `default` is the only acceptable value.

Also, I think the `Partition` trait presents an interface that is too
closely tied to the existing strategy and would probably be wrong for
other strategies. (My rule of thumb is to not make something generic
until there are at least two instances of it, to avoid this kind of
problem.)

Also, I don't think providing multiple partitioning strategies to the
user is a good idea, because the compiler already has enough obscure
knobs.

This commit removes the option, along with the `Partition` trait, and
the `Partitioner` and `DefaultPartitioning` types. I left the existing
code in `compiler/rustc_monomorphize/src/partitioning/default.rs`,
though I could be persuaded that moving it into
`compiler/rustc_monomorphize/src/partitioning/mod.rs` is better.
</content>
</entry>
<entry>
<title>Add struct for the return type of `place_root_mono_items`.</title>
<updated>2023-05-25T21:28:02+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-05-25T21:28:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e6b99a6521535d79a53b2111f236f82fae0b123e'/>
<id>urn:sha1:e6b99a6521535d79a53b2111f236f82fae0b123e</id>
<content type='text'>
As per review request.
</content>
</entry>
<entry>
<title>Remove some unnecessary `pub` markers.</title>
<updated>2023-05-25T04:27:37+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-05-25T04:27:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=86754cd8f280657d75b7dbae1845fa2c45ad28a9'/>
<id>urn:sha1:86754cd8f280657d75b7dbae1845fa2c45ad28a9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add a clarifying comment.</title>
<updated>2023-05-24T02:33:35+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-05-24T01:50:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=59c5259bc92542f76db04cfc96bdb92c4b15401a'/>
<id>urn:sha1:59c5259bc92542f76db04cfc96bdb92c4b15401a</id>
<content type='text'>
This is something that took me some time to figure out.
</content>
</entry>
<entry>
<title>Remove `{Pre,Post}InliningPartitioning`.</title>
<updated>2023-05-24T02:33:35+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-05-24T00:49:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=20de2ba7596322026501e1b5134c8724224b844e'/>
<id>urn:sha1:20de2ba7596322026501e1b5134c8724224b844e</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Remove the `merging` module.</title>
<updated>2023-05-24T02:25:58+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-05-24T00:08:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b39b7098eaaf5eb99e2f210ad98307ab310c1eee'/>
<id>urn:sha1:b39b7098eaaf5eb99e2f210ad98307ab310c1eee</id>
<content type='text'>
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 #74275 this explanation was given:

&gt; I pulled this out into a separate module since it seemed like we might
&gt; 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.
</content>
</entry>
<entry>
<title>Inline and remove `numbered_codegen_unit_name`.</title>
<updated>2023-05-24T00:05:15+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-05-24T00:05:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e26c0c92bda6a66a5ea2f308b28e53a0a9bfba7f'/>
<id>urn:sha1:e26c0c92bda6a66a5ea2f308b28e53a0a9bfba7f</id>
<content type='text'>
It is small and has a single call site, and this change will facilitate
the next commit.
</content>
</entry>
</feed>
