From 67a2dee8c59a7aa4d97e5c0cac307215e461dd26 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Fri, 1 Sep 2023 21:52:36 +0900 Subject: [PATCH] Enable MLGO for register allocation This enables Machine Learning Guided Optimizations (MLGO) for register allocation. App launch performance on oriole-userdebug is improved by 0.53%, and binary size is very slightly reduced (e.g. 64 bytes for libart.so). https://dashboards.corp.google.com/_0e1b06dd_a79e_4433_b625_b62e5cac004b?p=BootImageProfileId:36265 Test: presubmit Bug: 229056536 Change-Id: I0e5d40bb90a1555a1343f114ebffffca281f20b2 --- cc/config/global.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cc/config/global.go b/cc/config/global.go index 472ce4095..3ee3fa2bb 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -140,6 +140,9 @@ 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", } @@ -167,6 +170,8 @@ 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(deviceGlobalLdflags, commonGlobalLldflags...)