Enable full LTO optimization by default

We set the default optimization mode to --lto-O0 for LTO enabled
projects, in order to save build time. This is missing some performance
optimizations, esp. related to vectorization. Now that we suggest eng
build for developers, we can enable full optimization by default.

When we introduced --lto-O0, we achieved a 4.2% saving in
system-processes-memory-direct. Enabling full LTO optimization will
trade some of the memory / binary size savings for better code
performance. For system-processes-memory-direct, it is 2.0% increase
compared to --lto-O0, or a net 2.2% saving compared to baseline.

Test: presubmit
Bug: 328163089
Change-Id: Ia4d0f74e668ed057d6d9d6fc6c60196c2e355fb9
diff --git a/cc/lto.go b/cc/lto.go
index 05fa8ee..e2d99eb 100644
--- a/cc/lto.go
+++ b/cc/lto.go
@@ -54,6 +54,9 @@
 
 	// Use -fwhole-program-vtables cflag.
 	Whole_program_vtables *bool
+
+	// Use --lto-O0 flag.
+	Lto_O0 *bool
 }
 
 type lto struct {
@@ -110,12 +113,8 @@
 		ltoCFlags := []string{"-flto=thin", "-fsplit-lto-unit"}
 		var ltoLdFlags []string
 
-		// The module did not explicitly turn on LTO. Only leverage LTO's
-		// 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() {
+		// Do not perform costly LTO optimizations for Eng builds.
+		if Bool(lto.Properties.Lto_O0) || ctx.Config().Eng() {
 			ltoLdFlags = append(ltoLdFlags, "-Wl,--lto-O0")
 		}