[PATCH] D115642: [CSSPGO] Warn instead of error out for modules that are not probed.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 13 10:13:45 PST 2021


hoy added a comment.

In D115642#3189421 <https://reviews.llvm.org/D115642#3189421>, @wenlei wrote:

>> Modules that are not compiled with pseudo probe enabled can reference functions that are probed, cause those functions imported into the non-probed module.
>
> If module is not compiled with probe, we would run into problem even if there's no importing at all, right? The problem seems to be that we're loading csspgo profile (have a valid reader) for that module without probe.

Modules not compiled with probe should not have its functions show up in the profile, thus the profile file will not be loaded and the error should not be triggered. The case I was seeing that triggered the error is due to imported modules and it only failed in thinlto postlink. This can be fixed by always importing probe desc for importing modules. However, we've decided not to do that to favor build time.

> The purpose of the original change it to make sure csspgo is always 100% effective, and if not, we should fix the build. With this change, how do we make sure that is still the case? i.e. we can now pass csspgo profile to a build without adding pseudo-probe flag, and the build will still succeed, right?

Yes, in this case the build will still succeed with the warnings. The build may not be easy to fix when the modules not probes are not compiled with clang, say Rust. If we want the build to be blocked, what we could do is to add a fancy check here against non-imported functions for now. What do you think?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115642/new/

https://reviews.llvm.org/D115642



More information about the llvm-commits mailing list