Skip to content

Various LTO cleanups#153440

Open
bjorn3 wants to merge 5 commits intorust-lang:mainfrom
bjorn3:lto_refactors13
Open

Various LTO cleanups#153440
bjorn3 wants to merge 5 commits intorust-lang:mainfrom
bjorn3:lto_refactors13

Conversation

@bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Mar 5, 2026

  • Move some special casing of thin local LTO into a single location.
  • Move lto_import_only_modules handling for fat LTO earlier. There is no reason to keep it separate until right before pass the LTO modules to the codegen backend. For thin LTO this introduces ThinLtoInput to correctly handle incr comp caching.
  • Remove the Linker type from cg_llvm. It previously helped deduplicate code for -Zcombine-cgus, but that flag no longer exists.

Part of rust-lang/compiler-team#908

bjorn3 added 5 commits March 5, 2026 11:51
By not pushing any crates to each_linked_rlib_for_lto when no
cross-crate LTO is used, we can avoid special cases elsewhere.
It is still not entirely correct I think, but much
closer to the current way things are done.
@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 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 Mar 5, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 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: compiler
  • compiler expanded to 69 candidates
  • Random selection from 16 candidates

@antoyo
Copy link
Contributor

antoyo commented Mar 5, 2026

Before we introduce more LTO changes, would it be possible to fix this issue introduced by your previous LTO change please?

It would be nice to also add a test for this specific scenario in the Rust CI.

@bjorn3
Copy link
Member Author

bjorn3 commented Mar 5, 2026

I missed that comment. Will take a look.

@bjorn3
Copy link
Member Author

bjorn3 commented Mar 5, 2026

@rustbot block until cg_gcc is unblocked

@bjorn3
Copy link
Member Author

bjorn3 commented Mar 5, 2026

@rustbot blocked

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 5, 2026
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-blocked Status: Blocked on something else such as an RFC or other implementation work. 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.

4 participants