Skip to content

Issue #32 solution #144834

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

ishangtxl
Copy link

This commit introduces a new debugging flag, -debug-pass-list, to provide a simple, user-friendly way to view the sequence of passes being run by the New Pass Manager for a given optimization level.

This feature is implemented for the New Pass Manager by:

  • Adding a new boolean cl::opt named DebugPassList.
  • Hooking into StandardInstrumentations::registerCallbacks to register a BeforeNonSkippedPassCallback.
  • When -debug-pass-list is active, the callback gets the name of each pass and prints it.
  • Filtering logic has been included to exclude "Adaptor" and "Wrapper" passes to keep the list focused on the core transformations.

First, create a test file

echo 'int main() { return 0; }' > test.c

Run with the new flag at different optimization levels

./bin/clang --sysroot $(xcrun --show-sdk-path) -O2 -mllvm -debug-pass-list test.c -S -o /dev/null
./bin/clang --sysroot $(xcrun --show-sdk-path) -O3 -mllvm -debug-pass-list test.c -S -o /dev/null

Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@@ -1,44 +1,117 @@
# The LLVM Compiler Infrastructure
# LLVM Project
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this file should be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants