Skip to content

Commit

Permalink
Auto merge of #47548 - alexcrichton:beta-default-fat, r=michaelwoerister
Browse files Browse the repository at this point in the history
[beta] Turn back on "fat" LTO by default

This commit reverts a small portion of the switch to ThinLTO by default which
changed the meaning of `-C lto` from "put the whole crate graph into one codegen
unit" to "perform ThinLTO over the whole crate graph". This backport has no
corresponding commit on master as #47521 is making the same change but in a
slightly different manner. This commit is intended to be a surgical change with
low impact on beta.

Closes #47409
  • Loading branch information
bors committed Jan 21, 2018
2 parents 1262787 + c4771ec commit c7037ff
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,9 +814,15 @@ impl Session {
return enabled
}

// If there's only one codegen unit and LTO isn't enabled then there's
// no need for ThinLTO so just return false.
if self.codegen_units() == 1 && !self.lto() {
// If LTO is enabled we right now unconditionally disable ThinLTO.
// This'll come at a later date! (full crate graph ThinLTO)
if self.lto() {
return false
}

// If there's only one codegen unit or then there's no need for ThinLTO
// so just return false.
if self.codegen_units() == 1 {
return false
}

Expand Down

0 comments on commit c7037ff

Please sign in to comment.