Revert "Enable full LTO optimization by default"
Revert submission 2988057-default-full-lto Reason for revert: broken test Reverted changes: /q/submissionid:2988057-default-full-lto Bug: 330811070 Change-Id: I46487ad92d25741347c7f30e944a5794941d5d69
This commit is contained in:
committed by
Gerrit Code Review
parent
ce23b9ba16
commit
55019c43f4
11
cc/lto.go
11
cc/lto.go
@@ -54,9 +54,6 @@ type LTOProperties struct {
|
|||||||
|
|
||||||
// Use -fwhole-program-vtables cflag.
|
// Use -fwhole-program-vtables cflag.
|
||||||
Whole_program_vtables *bool
|
Whole_program_vtables *bool
|
||||||
|
|
||||||
// Use --lto-O0 flag.
|
|
||||||
Lto_O0 *bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type lto struct {
|
type lto struct {
|
||||||
@@ -113,8 +110,12 @@ func (lto *lto) flags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
ltoCFlags := []string{"-flto=thin", "-fsplit-lto-unit"}
|
ltoCFlags := []string{"-flto=thin", "-fsplit-lto-unit"}
|
||||||
var ltoLdFlags []string
|
var ltoLdFlags []string
|
||||||
|
|
||||||
// Do not perform costly LTO optimizations for Eng builds.
|
// The module did not explicitly turn on LTO. Only leverage LTO's
|
||||||
if Bool(lto.Properties.Lto_O0) || ctx.Config().Eng() {
|
// better dead code elimination and CFG simplification, but do
|
||||||
|
// not perform costly optimizations for a balance between compile
|
||||||
|
// time, binary size and performance.
|
||||||
|
// Apply the same for Eng builds as well.
|
||||||
|
if !lto.ThinLTO() || ctx.Config().Eng() {
|
||||||
ltoLdFlags = append(ltoLdFlags, "-Wl,--lto-O0")
|
ltoLdFlags = append(ltoLdFlags, "-Wl,--lto-O0")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user