Previoulsy debug-info-for-profiling and pseudo-probe-for-profiling are mutual exclusive because they compete the dwarf discrimnator for callsites on the IR. This changes allows to use the two switches together. The side effect is that callsite discriminators will be taken by pseudo probe, while discriminators for other instructions are still available for AutoFDO use. This is less than ideal, however, it still allows us a chance to smoothly transition from AutoFDO to CSSPGO, by collecting both profiles from a CSSPGO binary.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
3896 | Would a warning be useful to catch accidental misuse? |
Could you remind me the discriminator difference between debug info based AFDO and pseudo probe based AFDO? I forgot it. I am sure it is described in some patch but I havn't found it. Give me a pointer is good enough.
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
3896 | I was thinking about that. It may be useful, but downstream may have to suppress that warning to be treated as error for a clean build. What do you think? |
In short, unlike block pseudo probe, a callsite probe relies on the calliste discriminator to be tracked. This has a couple usage: 1. to track direct call and indirect callsite 2. to model inline contexts with a list of callsite probes.
A probe discriminator is treated as empty or null for AutoFDO since it has lowest three bits as "111".
lgtm, thanks.
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
3896 | Fair point. We could add warning after transition. |
Would a warning be useful to catch accidental misuse?