rustc_llvm: Emit module summaries when using -Clto=fat - #159029
Conversation
|
r? @cuviper rustbot has assigned @cuviper. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
cc @ilovepi |
141d64a to
10ed1e0
Compare
This comment has been minimized.
This comment has been minimized.
10ed1e0 to
25ec857
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
25ec857 to
162ba1c
Compare
|
@rustbot ready |
162ba1c to
dbe5531
Compare
|
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
dbe5531 to
fe44964
Compare
|
@bjorn3 - I think I did a force push and lost a comment from you. Does the latest version still have the concern you mentioned? |
|
I assume they deleted their own comment, but do speak up if that's still relevant. Otherwise, it looks good to me! @bors r+ |
|
I don't fully remember what my comment was, but I did indeed delete it when I realized I was thinking wrong. I don't have any objections to this PR. |
…iper rustc_llvm: Emit module summaries when using -Clto=fat Currently, module summaries are only emitted with thin lto. If we would link full/fat lto'd rust code against lto'd c++ code built with CFI (or WPD), those passes would fail during the link step because the participating rust modules are missing module summaries. Rust code does not know at compile-time if it would be participating in some special link which may require module summaries, so this PR ensures module summaries are unconditionally emitted for full/fat lto, just like with thin lto. The WriteBitcodeToFile function just invokes the normal BitcodeWriterPass under the hood, but doesn't provide a way to set the argument for emitting module summaries. So this patch just adds the pass directly and sets that argument. This is a rebase of @PiJoules's rust-lang#158099, which also should fix up the tests with the gcc tools.
…iper rustc_llvm: Emit module summaries when using -Clto=fat Currently, module summaries are only emitted with thin lto. If we would link full/fat lto'd rust code against lto'd c++ code built with CFI (or WPD), those passes would fail during the link step because the participating rust modules are missing module summaries. Rust code does not know at compile-time if it would be participating in some special link which may require module summaries, so this PR ensures module summaries are unconditionally emitted for full/fat lto, just like with thin lto. The WriteBitcodeToFile function just invokes the normal BitcodeWriterPass under the hood, but doesn't provide a way to set the argument for emitting module summaries. So this patch just adds the pass directly and sets that argument. This is a rebase of @PiJoules's rust-lang#158099, which also should fix up the tests with the gcc tools.
|
|
This pull request was unapproved. This PR was contained in a rollup (#159803), which was unapproved. |
Currently, module summaries are only emitted with thin lto. If we would link full/fat lto'd rust code against lto'd c++ code built with CFI (or WPD), those passes would fail during the link step because the participating rust modules are missing module summaries. Rust code does not know at compile-time if it would be participating in some special link which may require module summaries, so this PR ensures module summaries are unconditionally emitted for full/fat lto, just like with thin lto. The WriteBitcodeToFile function just invokes the normal BitcodeWriterPass under the hood, but doesn't provide a way to set the argument for emitting module summaries. So this patch just adds the pass directly and sets that argument. Finally, now that we're generating module summaries for `-Clto=fat` without using ThinLTO, we need to update `rustc-metadata` to keep around a temporary directory that contains the `.rmeta` for a little longer before we deserialize it.
fe44964 to
a4bc26a
Compare
This comment has been minimized.
This comment has been minimized.
rustc_llvm: Emit module summaries when using -Clto=fat try-job: dist-various-1
|
Unknown command "ready". Run |
|
@rustbot ready |
|
@bors r+ rollup=iffy |
…uwer Rollup of 12 pull requests Successful merges: - #159014 ([rustdoc] Do not take `doc(cfg())` into account when filtering doctests) - #159029 (rustc_llvm: Emit module summaries when using -Clto=fat) - #160574 (Update rustc-perf submodule) - #154585 (treat no_mangle_generic_items as hard error instead of lint warning) - #159473 (Fix, simplify, and document doc meta finalize mode) - #157489 (Add CoerceShared field-wise reborrow WF checks) - #160532 (Add Enzyme bugfix to support rust+llvm23) - #160545 (Reorder the methods in `#[rustc_must_implement_one_of]`) - #160558 (Revert "codegen_ssa: no dbginfo for scalable vec local w/ `-O0`") - #160566 (Re-enable bool indexing assembly test for LLVM 23) - #160569 (Remove `OnDuplicate::Custom`) - #160576 ([rustdoc] Create output file after we checked that the standalone markdown file is valid)
Rollup merge of #159029 - erickt:lto-module-summaries, r=cuviper rustc_llvm: Emit module summaries when using -Clto=fat Currently, module summaries are only emitted with thin lto. If we would link full/fat lto'd rust code against lto'd c++ code built with CFI (or WPD), those passes would fail during the link step because the participating rust modules are missing module summaries. Rust code does not know at compile-time if it would be participating in some special link which may require module summaries, so this PR ensures module summaries are unconditionally emitted for full/fat lto, just like with thin lto. The WriteBitcodeToFile function just invokes the normal BitcodeWriterPass under the hood, but doesn't provide a way to set the argument for emitting module summaries. So this patch just adds the pass directly and sets that argument. This is a rebase of @PiJoules's #158099, which also should fix up the tests with the gcc tools.
…uwer Rollup of 12 pull requests Successful merges: - rust-lang/rust#159014 ([rustdoc] Do not take `doc(cfg())` into account when filtering doctests) - rust-lang/rust#159029 (rustc_llvm: Emit module summaries when using -Clto=fat) - rust-lang/rust#160574 (Update rustc-perf submodule) - rust-lang/rust#154585 (treat no_mangle_generic_items as hard error instead of lint warning) - rust-lang/rust#159473 (Fix, simplify, and document doc meta finalize mode) - rust-lang/rust#157489 (Add CoerceShared field-wise reborrow WF checks) - rust-lang/rust#160532 (Add Enzyme bugfix to support rust+llvm23) - rust-lang/rust#160545 (Reorder the methods in `#[rustc_must_implement_one_of]`) - rust-lang/rust#160558 (Revert "codegen_ssa: no dbginfo for scalable vec local w/ `-O0`") - rust-lang/rust#160566 (Re-enable bool indexing assembly test for LLVM 23) - rust-lang/rust#160569 (Remove `OnDuplicate::Custom`) - rust-lang/rust#160576 ([rustdoc] Create output file after we checked that the standalone markdown file is valid)
…uwer Rollup of 12 pull requests Successful merges: - rust-lang/rust#159014 ([rustdoc] Do not take `doc(cfg())` into account when filtering doctests) - rust-lang/rust#159029 (rustc_llvm: Emit module summaries when using -Clto=fat) - rust-lang/rust#160574 (Update rustc-perf submodule) - rust-lang/rust#154585 (treat no_mangle_generic_items as hard error instead of lint warning) - rust-lang/rust#159473 (Fix, simplify, and document doc meta finalize mode) - rust-lang/rust#157489 (Add CoerceShared field-wise reborrow WF checks) - rust-lang/rust#160532 (Add Enzyme bugfix to support rust+llvm23) - rust-lang/rust#160545 (Reorder the methods in `#[rustc_must_implement_one_of]`) - rust-lang/rust#160558 (Revert "codegen_ssa: no dbginfo for scalable vec local w/ `-O0`") - rust-lang/rust#160566 (Re-enable bool indexing assembly test for LLVM 23) - rust-lang/rust#160569 (Remove `OnDuplicate::Custom`) - rust-lang/rust#160576 ([rustdoc] Create output file after we checked that the standalone markdown file is valid)
View all comments
Currently, module summaries are only emitted with thin lto. If we would link full/fat lto'd rust code against lto'd c++ code built with CFI (or WPD), those passes would fail during the link step because the participating rust modules are missing module summaries. Rust code does not know at compile-time if it would be participating in some special link which may require module summaries, so this PR ensures module summaries are unconditionally emitted for full/fat lto, just like with thin lto.
The WriteBitcodeToFile function just invokes the normal BitcodeWriterPass under the hood, but doesn't provide a way to set the argument for emitting module summaries. So this patch just adds the pass directly and sets that argument.
This is a rebase of @PiJoules's #158099, which also should fix up the tests with the gcc tools.