-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
I'm trying to use IR+CS-IR PGO to optimize the SVT-AV1-PSY encoder psy-ex/svt-av1-psy#69 (reply in thread)
A binary compiled with -fcs-profile-generate -fprofile-use= silently fails to generate any profiles if (thin or full) LTO is enabled. This happens on LLVM 17 (Visual Stdío built-in) and LLVM 19 (last official binary available).
This seems to be a problem with other source code, too https://www.reddit.com/r/LLVM/comments/182psjg/comment/lrdktnd/?context=3
This could be a bug or "works as designed" because LTO defers performing optimization until link time https://llvm.org/docs/LinkTimeOptimization.html - but context sensitive PGO performs a post-inline late instrumentation https://clang.llvm.org/docs/UsersManual.html
If whis is "wad" please a) add the information about incompatibility with -fcs-profile-generate and -flto to the documentation, b) add a clang error/warning if this combination is used or c) warn and auto-disable -flto if -fcs-profile-generate is used.