[clang-tools-extra] [compiler-rt] [clang] [PGO] Reland PGO's Counter Reset and File Dumping APIs #76471 (PR #78285)

Qiongsi Wu via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 09:50:41 PST 2024


qiongsiwu wrote:

> thanks for the fix!
> 
> One test `Clang :: Preprocessor/init.c` failed (https://lab.llvm.org/buildbot/#/builders/74/builds/24843) and the error is due to mismatched macros (if I'm reading correctly wants `__LONG_LONG_MAX__` right after `__LLONG_WIDTH__` but sees `__LLVM_INSTR_PROFILE_GENERATE` in the middle). I'm wondering if the test (and other tests like `Preprocessor/init-aarch64.c`) needs update (or if they should be fixed by [#77546 (comment)](https://github.com/llvm/llvm-project/issues/77546#issuecomment-1887953628))

Thanks for the fast response @minglotus-6 ! The preprocessor `init` tests were failing due to a mis-optimization introduced recently. Due to the misoptimization, `hasProfileInstr()` ([here](https://github.com/llvm/llvm-project/pull/78285/files#diff-3e17619db20856d476f7eee9bd87f730d9594b4aee2b796f6829a55de4c1fbf0R498)) always returned true and hence the `__LLVM_INSTR_PROFILE_GENERATE` macros were always inserted when it should not show up. As noted in the comment, https://github.com/llvm/llvm-project/pull/77831 fixed the mis-optimization. `hasProfileInstr()` is slightly rewritten in this PR as well to avoid triggering the pattern that was mis-optimized. 

That said this PR still has some issues. Four seemingly unrelated tests are failing the pre-commit CI on Linux and I am investigating. I will update this PR once these failures are sorted out! Thanks for your patience! 

```
Failed Tests (4):
  cfi-devirt-lld-thinlto-x86_64 :: cross-dso/icall/dlopen.cpp
  cfi-devirt-lld-x86_64 :: cross-dso/icall/dlopen.cpp
  cfi-standalone-lld-thinlto-x86_64 :: cross-dso/icall/dlopen.cpp
  cfi-standalone-lld-x86_64 :: cross-dso/icall/dlopen.cpp
``` 

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


More information about the cfe-commits mailing list