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:
12
cc/cc.go
12
cc/cc.go
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user