Skip to content

BOLT does not work with Stale Profiles even while using YAML profile format #146555

Open
@lsreenivas

Description

@lsreenivas

Please refer to the thread: https://discourse.llvm.org/t/how-to-solve-the-problem-of-stale-profile-data-when-bolt-is-used-with-pgo/78007/12

I tried the following things but still we are not seeing the optimization gains even after we switched to YAML profiles. Please read the details below.

We started to convert our *.fdata profiles to YAML profiles via: llvm-bolt mylib.so -data mylib.fdata -w mylib.yaml

When we use the YAML profile_N to optimize library N ( here N = release number, for example ) then we can see good performance gains. But we want to use YAML for helping us with stale profiling, which is my hard requirement.

When I used the same YAML profile N to inject and optimize the next release library_(N+1), then shockingly we are seeing no gain at all and a poor result.

We are at LLVM 19.1.3 and for the optimization we are exactly using the following command:

llvm-bolt --data=/profile/mylib.yaml --dyno-stats --eliminate-unreachable --icf --icp-eliminate-loads --infer-stale-profile --inline-all --match-profile-with-function-hash --reorder-blocks=ext-tsp --reorder-functions=cdsort --split-all-cold --split-eh --split-functions --update-debug-sections --use-gnu-stack /original/mylib.so -o /optimized/mylib.so -v=1

As you can see, we are already using: --infer-stale-profile and --match-profile-with-function-hash, thinking that these two options will really help us in getting stale profile matching benefit.

However, we still see the same issue even with the YAML profiles, which we observed in fdata profiles. i.e., when we inject profile_N of yaml into release_N+1, it does not work and shows no gains and in fact poor results.

Could you please tell if we are missing something here ? thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions