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
diff --git a/cc/config/global.go b/cc/config/global.go
index 472ce40..3ee3fa2 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -140,6 +140,9 @@
"-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 @@
"-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...)