Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 690b7c89 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Only enable MLGO for ARM64 ThinLTO targets" into main am: 6a8eb37d...

Merge "Only enable MLGO for ARM64 ThinLTO targets" into main am: 6a8eb37d am: 9865ce41 am: 7875d975

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2817703



Change-Id: I969cbb827f82aea8c3bd8d0d760ea3a0864ecc35
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f6bd625f 7875d975
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -174,9 +174,6 @@ var (
		"-Werror=format-security",
		"-nostdlibinc",

		// Enable MLGO for register allocation.
		"-mllvm -regalloc-enable-advisor=release",

		// Emit additional debug info for AutoFDO
		"-fdebug-info-for-profiling",
	}
@@ -205,8 +202,6 @@ var (
		"-Wl,--exclude-libs,libgcc_stripped.a",
		"-Wl,--exclude-libs,libunwind_llvm.a",
		"-Wl,--exclude-libs,libunwind.a",
		// Enable MLGO for register allocation.
		"-Wl,-mllvm,-regalloc-enable-advisor=release",
	}

	deviceGlobalLldflags = append(append(deviceGlobalLdflags, commonGlobalLldflags...),
+9 −4
Original line number Diff line number Diff line
@@ -147,11 +147,16 @@ func (lto *lto) flags(ctx BaseModuleContext, flags Flags) Flags {
			}
		}

		// For ML training
		// 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")
				ltoLdFlags = append(ltoLdFlags, "-Wl,--thinlto-emit-index-files")
			}
		}

		flags.Local.CFlags = append(flags.Local.CFlags, ltoCFlags...)
		flags.Local.AsFlags = append(flags.Local.AsFlags, ltoCFlags...)