Provide an environment variable to disable mlgo
Helps iterate on compiler that was build without mlgo. Building with mlgo requires a docker image Change-Id: Ie2988ecaf15031cdb14411abf7b99530e3860cce
This commit is contained in:
10
cc/lto.go
10
cc/lto.go
@@ -147,10 +147,12 @@ func (lto *lto) flags(ctx BaseModuleContext, flags Flags) Flags {
|
||||
}
|
||||
}
|
||||
|
||||
// Register allocation MLGO flags for ARM64.
|
||||
if ctx.Arch().ArchType == android.Arm64 {
|
||||
ltoCFlags = append(ltoCFlags, "-mllvm -regalloc-enable-advisor=release")
|
||||
ltoLdFlags = append(ltoLdFlags, "-Wl,-mllvm,-regalloc-enable-advisor=release")
|
||||
if !ctx.Config().IsEnvFalse("THINLTO_USE_MLGO") {
|
||||
// Register allocation MLGO flags for ARM64.
|
||||
if ctx.Arch().ArchType == android.Arm64 {
|
||||
ltoCFlags = append(ltoCFlags, "-mllvm -regalloc-enable-advisor=release")
|
||||
ltoLdFlags = append(ltoLdFlags, "-Wl,-mllvm,-regalloc-enable-advisor=release")
|
||||
}
|
||||
// Flags for training MLGO model.
|
||||
if ctx.Config().IsEnvTrue("THINLTO_EMIT_INDEXES_AND_IMPORTS") {
|
||||
ltoLdFlags = append(ltoLdFlags, "-Wl,--save-temps=import")
|
||||
|
Reference in New Issue
Block a user