Skip to content

Conversation

@mjulian31
Copy link
Contributor

There are a handful of passes in PassRegistry.def with outdated or missing pass options. These strings describing pass options are used for the printPassNames() function only, which is likely why they have gotten out-of-date without being caught. This MR simply changes the few passes where the option string is out-of-date, fixing the output of -print-passes. This does not affect functionality of the pipeline parser, and is hard to verify in a unit test, so no tests were added.

@mjulian31 mjulian31 requested review from AlexMaclean and Artem-B June 27, 2025 21:43
@mjulian31 mjulian31 self-assigned this Jun 27, 2025
@mjulian31 mjulian31 added code-quality llvm Umbrella label for LLVM issues labels Jun 27, 2025
Copy link
Member

@AlexMaclean AlexMaclean left a comment

Choose a reason for hiding this comment

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

Nice, LGTM. I wonder if it would be possible to write a test to ensure these options remain up-to-date

@AlexMaclean AlexMaclean requested review from arsenm and nikic June 30, 2025 16:08
@nikic
Copy link
Contributor

nikic commented Jun 30, 2025

I think to meaningfully improve it we need a new, more declarative mechanism to declare pass options (at least for the simple cases). The current one is annoyingly ad-hoc.

@mjulian31
Copy link
Contributor Author

Yeah I considered adding a test but wasn't sure how to frame it. The real source of truth for pass options are the parsing functions, and there isn't a great way to extract all possible options from these as they are all structured a little differently. I suppose you could catch old options that don't exist any more by just testing every option, but it wouldn't help with new missing options, which seemed to be the main problem. I agree it would be a bigger change needed to declare them more systematically.

@mjulian31 mjulian31 merged commit 7da8ed8 into llvm:main Jul 1, 2025
10 checks passed
@mjulian31 mjulian31 deleted the dev/pass-registry-fix branch July 1, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality llvm Umbrella label for LLVM issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants