From bc2d02aa6a2a29c457016eebe872a7883ddd69a9 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Mon, 16 Oct 2023 16:57:53 +0900 Subject: [PATCH] Add additional flag required for Flow Sensitive AFDO It can be removed in the future once it becomes default. Test: presubmit Bug: 304282732 Change-Id: Ia7729593eff13ba5cc69fdb54519305295313b4d --- cc/afdo.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cc/afdo.go b/cc/afdo.go index 5c587c0b0..ac210d44a 100644 --- a/cc/afdo.go +++ b/cc/afdo.go @@ -84,7 +84,10 @@ 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 for Flow Sensitive AutoFDO flags.Local.CFlags = append([]string{"-mllvm", "-enable-fs-discriminator=true"}, flags.Local.CFlags...) + // TODO(b/266595187): Remove the following feature once it is enabled in LLVM by default. + flags.Local.CFlags = append([]string{"-mllvm", "-improved-fs-discriminator=true"}, flags.Local.CFlags...) } if path := afdo.Properties.FdoProfilePath; path != nil { // The flags are prepended to allow overriding.