[clang] [lld] [llvm] [Windows] Add support for emitting PGO/LTO magic strings in the Windows PE debug directory (PR #114260)

Mikołaj Piróg via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 2 07:13:21 PST 2024


mikolaj-pirog wrote:

> As I'm not a Windows developer, I defer to other reviewers' expertise on MSVC's PGO/LTO feature.
> 
> However, to be honest, I'm unsure about the value of porting the strings given the large feature differences between Clang and MSVC on PGO and LTO. `clang -flto -c` output is LLVM bitcode files, which are distinguishable on their own. With LLVM LTO, you can have 1 bitcode file and 99 object files, or 99 bitcode files and 1 object file. I am not sure identifying that LTO happens is very useful.
> 
> There are many PGO flavors. If we add this, there could be some inconsistency everytime someone adds a new flavor of PGO and does not port this piece of code.

I agree that it's a little awkward to port this behavior to clang, since msvc does pgo/lto differently; the lto is enabled by default; it's impossible to do pgo without lto. The value of this patch, as I have seen when creating it, is the feature parity with msvc, accepting the awkwardness.




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


More information about the cfe-commits mailing list