summaryrefslogtreecommitdiff
path: root/cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc')
-rw-r--r--cc/afdo.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cc/afdo.go b/cc/afdo.go
index 8d8341eb4..9be39185c 100644
--- a/cc/afdo.go
+++ b/cc/afdo.go
@@ -105,6 +105,11 @@ func (afdo *afdo) flags(ctx ModuleContext, flags Flags) Flags {
// The flags are prepended to allow overriding.
profileUseFlag := fmt.Sprintf(afdoFlagsFormat, fdoProfilePath)
flags.Local.CFlags = append([]string{profileUseFlag}, flags.Local.CFlags...)
+ // Salvage stale profile by fuzzy matching and use the remapped location for sample profile query.
+ flags.Local.CFlags = append([]string{"-mllvm", "--salvage-stale-profile=true"}, flags.Local.CFlags...)
+ flags.Local.CFlags = append([]string{"-mllvm", "--salvage-stale-profile-max-callsites=2000"}, flags.Local.CFlags...)
+ // Salvage stale profile by fuzzy matching renamed functions.
+ flags.Local.CFlags = append([]string{"-mllvm", "--salvage-unused-profile=true"}, flags.Local.CFlags...)
flags.Local.LdFlags = append([]string{profileUseFlag, "-Wl,-mllvm,-no-warn-sample-unused=true"}, flags.Local.LdFlags...)
// Update CFlagsDeps and LdFlagsDeps so the module is rebuilt