Enable MLGO inliner optimization for optimize_for_size cases

This helps reduce binary size for these projects by ~3%.

Test: presubmit
Bug: 342090838
Change-Id: Ie1e0586ddf5f40aa1e81fc2628a6499093de9699
This commit is contained in:
Yi Kong
2024-06-06 03:05:04 +09:00
parent 5786f5cf1d
commit 2cd77d671c
2 changed files with 2 additions and 1 deletions

View File

@@ -695,6 +695,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
if ctx.optimizeForSize() {
flags.Local.CFlags = append(flags.Local.CFlags, "-Oz")
flags.Local.LdFlags = append(flags.Local.LdFlags, "-Wl,-mllvm,-enable-ml-inliner=release")
}
// Exclude directories from manual binder interface allowed list.