]> git.lizzy.rs Git - rust.git/commit - compiler/rustc_codegen_cranelift/src/inline_asm.rs
Rollup merge of #103610 - wesleywiser:thinlto_cgu1, r=michaelwoerister
authorMatthias Krüger <matthias.krueger@famsik.de>
Wed, 2 Nov 2022 21:06:26 +0000 (22:06 +0100)
committerGitHub <noreply@github.com>
Wed, 2 Nov 2022 21:06:26 +0000 (22:06 +0100)
commit0f72a6d617ccfb449286ccae136776fef2182224
tree52f96bf1da7749e6b3bd6296b583defdec937eb5
parent214d6b6836413bbfe9132f7aff3d91ae67bc62ba
parent7c6345d175a6976e68d3902240ab6dd8d6b99bc2
Rollup merge of #103610 - wesleywiser:thinlto_cgu1, r=michaelwoerister

Allow use of `-Clto=thin` with `-Ccodegen-units=1` in general

The current logic to ignore ThinLTO when `-Ccodegen-units=1` makes sense for local ThinLTO but even in this scenario, a user may still want (non-local) ThinLTO for the purpose of optimizing dependencies into the final crate which is being compiled with 1 CGU.

The previous behavior was even more confusing because if you were generating a binary (`--emit=link`), then you would get ThinLTO but if you asked for LLVM IR or bytecode, then it would silently change to using regular LTO.

With this change, we only override the defaults for local ThinLTO if you ask for a single output such as LLVM IR or bytecode and in all other cases honor the requested LTO setting.

r? `@michaelwoerister`
compiler/rustc_session/src/config.rs
compiler/rustc_session/src/options.rs
compiler/rustc_session/src/session.rs