Re: [PATCH] kbuild: AutoFDO: Enable -salvage-stale-profile
From: Doug Anderson
Date: Thu Nov 05 2026 - 16:42:15 EST
Hi,
On Thu, Nov 5, 2026 at 11:47 AM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Thu, Nov 5, 2026 at 2:46 AM Douglas Anderson <dianders@xxxxxxxxxxxx> wrote:
> >
> > Enable LLVM stale profile salvaging (-salvage-stale-profile, supported
> > since LLVM 17) for C, Rust, and ThinLTO builds when
>
> > + RUSTFLAGS_AUTOFDO_CLANG += -Cllvm-args=-salvage-stale-profile
>
> I double-checked that the flag was introduced in LLVM 17 as the cover
> letter mentions, and so it is likely fine given the Rust 1.85.0
> compiler (i.e. our minimum) supports LLVM 18 as the minimum major
> version, but if the patch goes ahead in the end, then we should make
> sure it works well with that one (or probably you already did, in
> which case, please ignore this!).
I haven't extensively tested the behavior across many versions of
rust. If you are worried, I guess we could remove the rustflags part
of the change? ...or, of course, we could just fully drop this patch
(and maybe add `-fno-sample-profile-use-profi` instead) ?
-Doug