Skip to content

Store a PathBuf rather than SerializedModule for cached modules#155036

Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
bjorn3:lto_refactors16
Apr 21, 2026
Merged

Store a PathBuf rather than SerializedModule for cached modules#155036
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
bjorn3:lto_refactors16

Conversation

@bjorn3
Copy link
Copy Markdown
Member

@bjorn3 bjorn3 commented Apr 9, 2026

In cg_gcc ModuleBuffer already only contains a path anyway. And for moving LTO into -Zlink-only we will need to serialize MaybeLtoModules. By storing a path cached modules we avoid writing them to the disk a second time during serialization of MaybeLtoModules.

Some further improvements will require changes to cg_gcc that I would prefer landing in the cg_gcc repo to actually test the LTO changes in CI.

Part of rust-lang/compiler-team#908

bjorn3 added 2 commits April 9, 2026 10:57
In cg_gcc ModuleBuffer already only contains a path anyway. And for
moving LTO into -Zlink-only we will need to serialize MaybeLtoModules.
By storing a path cached modules we avoid writing them to the disk a
second time during serialization of MaybeLtoModules.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 9, 2026

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 9, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 9, 2026

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: codegen, compiler
  • codegen, compiler expanded to 69 candidates
  • Random selection from 12 candidates

@TaKO8Ki
Copy link
Copy Markdown
Member

TaKO8Ki commented Apr 21, 2026

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 21, 2026

📌 Commit 9e4bb84 has been approved by TaKO8Ki

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 21, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 21, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #152611 (Modify error message of importing inherent associated items when `#[feature(import_trait_associated_functions)]` is enabled)
 - #155359 (Improperctypes refactor2.2)
 - #155036 (Store a PathBuf rather than SerializedModule for cached modules)
 - #155554 (add warning message when using x fix)
@rust-bors rust-bors Bot merged commit 8ffe107 into rust-lang:main Apr 21, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 21, 2026
rust-timer added a commit that referenced this pull request Apr 21, 2026
Rollup merge of #155036 - bjorn3:lto_refactors16, r=TaKO8Ki

Store a PathBuf rather than SerializedModule for cached modules

In cg_gcc `ModuleBuffer` already only contains a path anyway. And for moving LTO into `-Zlink-only` we will need to serialize `MaybeLtoModules`. By storing a path cached modules we avoid writing them to the disk a second time during serialization of `MaybeLtoModules`.

Some further improvements will require changes to cg_gcc that I would prefer landing in the cg_gcc repo to actually test the LTO changes in CI.

Part of rust-lang/compiler-team#908
@bjorn3 bjorn3 deleted the lto_refactors16 branch April 21, 2026 20:05
rust-bors Bot pushed a commit that referenced this pull request Apr 30, 2026
Store a PathBuf rather than SerializedModule for cached modules

In cg_gcc `ModuleBuffer` already only contains a path anyway. And for moving LTO into `-Zlink-only` we will need to serialize `MaybeLtoModules`. By storing a path cached modules we avoid writing them to the disk a second time during serialization of `MaybeLtoModules`.

Some further improvements will require changes to cg_gcc that I would prefer landing in the cg_gcc repo to actually test the LTO changes in CI.

Part of rust-lang/compiler-team#908
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants