[clang] [hwasan] Don't instrument when PGO profile is collected (PR #86739)

Arthur Eubanks via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 26 14:40:20 PDT 2024


aeubanks wrote:

> > why can't hwasan and PGO instrumentation coexist?
> 
> They can, but binary is like 5x times slower, on top of 10x slowdown of PGO instrumentation. (don't quote me on these numbers, they are from large but single benchmark, still it's very slow)
> 
If it's usable as a configuration, I don't see why we should prevent this. It still may be useful to some people. Seems like this checking should be done at a build system level if you don't want some codebase to compile with this configuration.
> > and this seems like it should be an error at the clang driver level, instead of silently turning off one of the requested features
> 
> 1. We need -fsanitizer=hwaddress, for attributes and profile matching, and some special handling done in earlier passes.

Do you mean that if you want a hwasan/PGO optimized build, you want the corresponding PGO instrumented build to also use hwasan?

Doesn't PGO instrumentation/use happen before the sanitizer passes run?

> 2. We don't wan't users care about profile instrumentation/use difference.


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


More information about the cfe-commits mailing list