rust-lang / rust-lang/rust

Include llvm-profgen in llvm-tools component

Open
#155,525 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-llvm-bintools C-feature-request T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Hi!

I want to propose adding a llvm-profgen tool to the llvm-tools component with motivation to simplify Sampling PGO (SPGO) scenarios for the Rust ecosystem. As a part of the https://github.com/rust-lang/rust/issues/117023 issue, I want to make as easy as possible SPGO scenarios for Rust users since SPGO resolves some critical issues with Instrumentation PGO (like runtime overhead) that limits PGO adoption in the ecosystem.

Having this tool as a part of llvm-tools (or llvm-tools-preview - I am not sure about a difference between them) simplifies downloading the tool for Rust users. This tool is pretty small so it will not bloat the component a lot. Alternative approches (from Clang docs) like AutoFDO set of tools are too hard to ship propeply since AutoFDO usually lags behind actual LLVM for several versions, requires applying patches for fixing builds with the latest LLVM, etc. llvm-profgen doesn't have such a limitation and is more LLVM-friendly (since it's in the upstream already). Additional motivation for having it delivered by Rustup and not somehow externally - possible issues with SPGO profile format compatibility between different LLVM versions - by providing the tool with matching to the used by Rustc LLVM version will remove such nasty issues in the future. Since we already have llvm-profdata I think from consistency perspective having llvm-profgen would be a nice addition too.

I tried to follow process about requesting a new tool in a similar way to other requests:

If the issue requires some additional discussions somewhere else or even an RFC (like it's done for clang above) - just let me know, I'll do it.

Thank you.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the related request in rust-lang/rust#55890 and the rust-lang/rfcs#3847 discussion, then determine the process and distinction between the llvm-tools and llvm-tools-preview components. The work is done when llvm-profgen is included in the appropriate component and is delivered with the LLVM version used by rustc.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
release, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.