Skip to content

Comments

Simplify ThinLTO handling#152670

Merged
rust-bors[bot] merged 6 commits intorust-lang:mainfrom
bjorn3:lto_refactors12
Feb 24, 2026
Merged

Simplify ThinLTO handling#152670
rust-bors[bot] merged 6 commits intorust-lang:mainfrom
bjorn3:lto_refactors12

Conversation

@bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Feb 15, 2026

This reduces the amount of complexity around ThinLTO module buffers. It removes duplication between ModuleBuffer and ThinBuffer (the latter was also used for fat LTO in some cases), clarifies when and where the ThinLTO summary is used (only for --emit thin-link-bitcode, ThinLTO performed by rustc rebuilds the summary every time). This also enables a follow up cleanup to reduce code duplication between red, green and imported codegen units.

Part of rust-lang/compiler-team#908

@bjorn3 bjorn3 added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Feb 15, 2026
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 15, 2026
@petrochenkov petrochenkov self-assigned this Feb 15, 2026
@petrochenkov
Copy link
Contributor

Blocked on #152566 and #152527.
@rustbot blocked

@petrochenkov petrochenkov removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 15, 2026
@bjorn3 bjorn3 force-pushed the lto_refactors12 branch 3 times, most recently from df90c7e to ecd2f10 Compare February 20, 2026 12:27
@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Feb 20, 2026
@bjorn3 bjorn3 marked this pull request as ready for review February 21, 2026 11:48
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 21, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 21, 2026

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@bjorn3
Copy link
Member Author

bjorn3 commented Feb 21, 2026

@rustbot ready

#152527 has been merged.

@petrochenkov petrochenkov removed the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Feb 22, 2026
@petrochenkov
Copy link
Contributor

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 23, 2026

📌 Commit 3decb52 has been approved by petrochenkov

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 Feb 23, 2026
@Kobzol
Copy link
Member

Kobzol commented Feb 23, 2026

We can perf. in the meantime, just in case.

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 23, 2026
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 23, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 23, 2026

☀️ Try build successful (CI)
Build commit: a4404b1 (a4404b1cf3490a3641bdc8adabd6eb7271f1dba8, parent: eeb94be79adc9df7a09ad0b2421f16e60e6d932c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a4404b1): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 3.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.8% [3.8%, 3.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.8% [3.8%, 3.8%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 481.498s -> 479.564s (-0.40%)
Artifact size: 395.88 MiB -> 395.87 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 23, 2026
rust-bors bot pushed a commit that referenced this pull request Feb 23, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #153007 (`rust-analyzer` subtree update)
 - #152670 (Simplify ThinLTO handling)
 - #152768 (Enable autodiff in ci for all major os)
 - #152908 (Enable rust.remap-debuginfo in the dist profile)
 - #152999 (Check importing `crate`/`$crate`/`super` after handling `self`)
 - #152003 (Reflection TypeId::trait_info_of)
 - #152976 (Revert relative paths for std links in rustc-docs)
 - #152985 (Port `#[feature]` to the new attribute system)
 - #152989 (Port `#[rustc_inherit_overflow_checks]` to the new attribute parsers)
 - #152991 (fix interpreter tracing output)
 - #153004 (Superficial tweaks to the query modifier docs in `rustc_middle::query::modifiers`)
 - #153008 (bootstrap.compiler.toml: update name of primary branch)
 - #153016 (Migration of `LintDiagnostic` - part 2)
 - #153020 (rustdoc: Improve sentence for documented empty impl blocks)

Failed merges:

 - #152988 (Port `#[register_tool]` to the new attribute system)
@JonathanBrouwer
Copy link
Contributor

@bors p=2
Scheduling this before the subtree update in case the rollup fails

@JonathanBrouwer
Copy link
Contributor

Actually this doesn't need to be rollup=never imo
@bors p=0
@bors rollup=iffy

rust-bors bot pushed a commit that referenced this pull request Feb 24, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #153007 (`rust-analyzer` subtree update)
 - #152670 (Simplify ThinLTO handling)
 - #152768 (Enable autodiff in ci for all major os)
 - #152908 (Enable rust.remap-debuginfo in the dist profile)
 - #152999 (Check importing `crate`/`$crate`/`super` after handling `self`)
 - #152003 (Reflection TypeId::trait_info_of)
 - #152976 (Revert relative paths for std links in rustc-docs)
 - #152985 (Port `#[feature]` to the new attribute system)
 - #152989 (Port `#[rustc_inherit_overflow_checks]` to the new attribute parsers)
 - #152991 (fix interpreter tracing output)
 - #153004 (Superficial tweaks to the query modifier docs in `rustc_middle::query::modifiers`)
 - #153008 (bootstrap.compiler.toml: update name of primary branch)
 - #153016 (Migration of `LintDiagnostic` - part 2)
 - #153020 (rustdoc: Improve sentence for documented empty impl blocks)

Failed merges:

 - #152988 (Port `#[register_tool]` to the new attribute system)
@rust-bors rust-bors bot merged commit 1894a0e into rust-lang:main Feb 24, 2026
12 checks passed
rust-timer added a commit that referenced this pull request Feb 24, 2026
Rollup merge of #152670 - bjorn3:lto_refactors12, r=petrochenkov

Simplify ThinLTO handling

This reduces the amount of complexity around ThinLTO module buffers. It removes duplication between `ModuleBuffer` and `ThinBuffer` (the latter was also used for fat LTO in some cases), clarifies when and where the ThinLTO summary is used (only for `--emit thin-link-bitcode`, ThinLTO performed by rustc rebuilds the summary every time). This also enables a follow up cleanup to reduce code duplication between red, green and imported codegen units.

Part of rust-lang/compiler-team#908
@bjorn3 bjorn3 deleted the lto_refactors12 branch February 24, 2026 09:26
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. A-run-make Area: port run-make Makefiles to rmake.rs A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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.

6 participants