From b33ced051af3d09c8efb2de78f169d655f239c3f Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Tue, 10 Oct 2023 14:11:50 +0900 Subject: [PATCH] Enable Flow Sensitive AutoFDO FSAFDO (Flow Sensitive AutoFDO) is an improvement over AutoFDO. It attempts to capture and represent the flow-sensitive profile in LLVM optimization passes with the mechanism to expose and iteratively reload/match the profile with better precision. Enable this for all AFDO projects so that we can capture data from the field, and then evaluate the performance gain. Test: presubmit Bug: 304282732 Change-Id: I0de6b4071e4f0a75500f3ffd5171a7be5117ec86 --- cc/afdo.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cc/afdo.go b/cc/afdo.go index 23d196dba..5c587c0b0 100644 --- a/cc/afdo.go +++ b/cc/afdo.go @@ -84,6 +84,7 @@ func (afdo *afdo) flags(ctx ModuleContext, flags Flags) Flags { // 3. Make the profile searchable by the build system. So it's used the next time the binary // is built. flags.Local.CFlags = append([]string{"-funique-internal-linkage-names"}, flags.Local.CFlags...) + flags.Local.CFlags = append([]string{"-mllvm", "-enable-fs-discriminator=true"}, flags.Local.CFlags...) } if path := afdo.Properties.FdoProfilePath; path != nil { // The flags are prepended to allow overriding.