I’ve a number of questions relating to Profile-Guided Optimization (PGO) on Apple platforms (macOS and iOS).

Is there a method to sampling PGO (https://clang.llvm.org/docs/UsersManual.html#using-sampling-profilers) on Apple platforms? Official Clang implementation expects Linux perf profiles. macOS and iOS don’t help Linux perf so how can I exploit sampling PGO on these platforms? Is there one thing prepared to make use of in Xcode Devices for that? Perhaps some converter from Xcode profiler format into Linux perf format (that then will be consumed by https://github.com/google/autofdo).

After studying the Xcode PGO documentation (https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/xcode_profile_guided_optimization/pgo-tasks/pgo-tasks.html) it is unclear what PGO method it makes use of. Is it FrontEnd PGO (-fprofile-instr-generate in Clang), IR PGO (-fprofile-generate), CSIR PGO (-fcs-profile-generate) or any mixture of all these PGO varieties? What goal platform are supported for PGO optimization? macOS, iOS, tvOS – what precisely?

Are there any variations in PGO implementation between Clang and Apple Clang?

Thanks upfront.

zamazan4ik is a brand new contributor to this website. Take care in asking for clarification, commenting, and answering.
Try our Code of Conduct.

1