From 71198ac5164cbe9532a648526c67388329a7ca6b Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Thu, 10 Feb 2022 15:08:36 +0800 Subject: [PATCH] Turn on Unique Internal Names for AFDO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AutoFDO uses a function’s symbol name to look up profile data but functions with internal linkages do not have globally unique identifiers. This can lead to name conflicts leading to missing profiles and performance. We are enabling compiler option -funique-internal-linkage-names for AFDO builds that will uniquefy internal linkage symbols making this problem go away. This CL might regress the performance due to mismatched profiles. It will recover once we update the profiles. Test: presubmit Bug: 218448389 Change-Id: I92a2b6f72b52faab79aec9148f1962111bad7232 --- cc/afdo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cc/afdo.go b/cc/afdo.go index d7cce77dd..c88821327 100644 --- a/cc/afdo.go +++ b/cc/afdo.go @@ -32,7 +32,7 @@ var ( var afdoProfileProjectsConfigKey = android.NewOnceKey("AfdoProfileProjects") -const afdoCFlagsFormat = "-fprofile-sample-accurate -fprofile-sample-use=%s" +const afdoCFlagsFormat = "-funique-internal-linkage-names -fprofile-sample-accurate -fprofile-sample-use=%s" func getAfdoProfileProjects(config android.DeviceConfig) []string { return config.OnceStringSlice(afdoProfileProjectsConfigKey, func() []string {