Disable inlining and loop unrolling in LTO without PGO profile

Such optimisations may significantly increase the binary size when
compiler heuristics are off. Disabling these helps cut down the
binary sizes with negligible decrease in performance, but allows us to
be more comfortable enabling LTO across various projects.

Test: m
Test: dex2oat, hwui, skia benchmark
Bug: 62839002
Change-Id: Id63e8dd295df2972f76ae4e29ee367080fff8429
This commit is contained in:
Yi Kong
2018-02-14 18:16:12 +08:00
parent 51be632b95
commit 7e53c57ed6
3 changed files with 28 additions and 2 deletions

View File

@@ -211,6 +211,7 @@ type ModuleContextIntf interface {
selectedStl() string
baseModuleName() string
getVndkExtendsModuleName() string
isPgoCompile() bool
}
type ModuleContext interface {
@@ -408,6 +409,13 @@ func (c *Module) isVndk() bool {
return false
}
func (c *Module) isPgoCompile() bool {
if pgo := c.pgo; pgo != nil {
return pgo.Properties.PgoCompile
}
return false
}
func (c *Module) isVndkSp() bool {
if vndkdep := c.vndkdep; vndkdep != nil {
return vndkdep.isVndkSp()
@@ -507,6 +515,10 @@ func (ctx *moduleContextImpl) isVndk() bool {
return ctx.mod.isVndk()
}
func (ctx *moduleContextImpl) isPgoCompile() bool {
return ctx.mod.isPgoCompile()
}
func (ctx *moduleContextImpl) isVndkSp() bool {
return ctx.mod.isVndkSp()
}