Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several questions regarding Profile-Guided Optimization (PGO) and LLVM BOLT #69227

Closed
zamazan4ik opened this issue Oct 17, 2023 · 3 comments
Closed
Labels
question Resolution: A on-topic question that we prefer asked via the Swift forums

Comments

@zamazan4ik
Copy link

Hi!

Right now I am testing Profile-Guided Optimization (PGO) and LLVM BOLT effects in multiple software domains - all current results are available here. During the research, I have met multiple questions about PGO status in Swift that I want to discuss here.

  1. Does Switft support building Swift programs with PGO? I am trying to find something similar to the Clang docs about PGO but for Swift - didn't find any on the Internet. If you have such a link - could you please share it with me? The only link that I found is the source code with some PGO-related flag in the compiler: GitHub. Would be nice to have a dedicated manual for PGO (as it's done in other compilers like Clang, GCC, Rustc).
  2. If Swift supports PGO, what kind of PGO is it? Instrumentation, Sampling, or something else? Is it possible to use the AutoFDO project with Swift?
  3. As far as I see in the closed PRs, Swift compiler already supports building with PGO for both parts (Swift compiler itself and LLVM part). Does it support optimizing the compiler with LLVM BOLT? E.g. Clang and Rustc compilers already support optimizing with LLVM BOLT.
  4. Do you optimize prebuilt Swift compiler binaries with PGO? If yes, could you please share somewhere performance results after enabling PGO? It helps a lot to the maintainers of the custom Swift compiler builds with estimation - do they need to build Swift compiler with PGO/BOLT or not.
  5. How do you collect the PGO profile for the Swift compiler? Is there any committed profile or it's regenerated on each build? If there are some ready-to-use scripts for it - would be awesome if you could show them.
  6. Do you use PGO for optimizing other Swift-related tooling (like the code-formatters)? It could be an interesting topic since according to my tests on LLVM tooling - helps a lot for different kinds of LLVM-based software (code formatting, language server, static analysis).

Thanks in advance!

@AnthonyLatsis
Copy link
Collaborator

@eeckstein Who's the best person to address this to?

@AnthonyLatsis AnthonyLatsis added the question Resolution: A on-topic question that we prefer asked via the Swift forums label Oct 20, 2023
@eeckstein
Copy link
Contributor

There is some very basic, experimental - and probably outdated - infrastructure in the SIL (profile counters). Beside that, AFAIK, there is no activity on pgo.
I think you should ask those questions in the swift forums.

@zamazan4ik
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Resolution: A on-topic question that we prefer asked via the Swift forums
Projects
None yet
Development

No branches or pull requests

3 participants