`-Zprint-llvm-passes` lies on recent rustc
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
-Zprint-llvm-passes, best I can tell, is equivalent to clang -cc1 -mdebug-pass=Structure, which is the wrong way to print out the pass order in the new PM. I found a relevant LLVM bug: https://github.com/llvm/llvm-project/issues/28692.
The best way to actually get which passes ran is -Ztime-llvm-passes, which unfortunately does not provide a pass order.
I don't know how rustc actually actuates LLVM, but it may be worthwhile to figure out a way to get a handle on the PM and print the pass order directly. Ideally, LLVM should have a "what passes and analyses did you actually run" setting, but that will require actually bodging that into the new PM (which the aforementioned issue suggests doing).
I also kind of hate -mdebug-pass=Structure, since it doesn't use the either the opt names or the LLVM type names for the passes, which makes it hard to actually figure out what passes the pass order actually refers to.
cc @workingjubilee
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the discrepancy between rustc's -Zprint-llvm-passes and -Ztime-llvm-passes, then read the linked LLVM issue about reporting new pass-manager activity. Done means rustc can expose the actual LLVM pass order with recognizable pass names rather than the misleading structure output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100