[clang] [llvm] [PseudoProbe] Mix and reorder block and call probe ID in lexical order (PR #75092)

Lei Wang via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 10 11:34:29 PST 2024


wlei-llvm wrote:

> > Agreed with this concern. To do this, we probably also need a flag in the binary, because otherwise if we use the new toolchain for prof-gen but the binary built on the old toolchain, we then would generate a profile with this flag on but the order is the old one. My understanding is the (probe) version of profile should line up with the version of the binary. Maybe make this more general, we can introduce a "pseudo_probe_version" thing, similar to instrPGO https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/ProfileData/InstrProf.h#L996 . It can be useful if we want to update other pseudo probe formats in future.
> 
> Versioning is one way to do this. Alternatively, we should be able to detect the case during llvm-profgen time when all call site probe and block probe ids are separated, which can then be used to set flags?

Sounds good. 

Add a new function(`checkProbeIDIsInMixedOrder`) to check the old order in profile generation time.
Always write a SecProfSummaryFlags flag, if the function return true. 

https://github.com/llvm/llvm-project/pull/75092


More information about the cfe-commits mailing list