-
Notifications
You must be signed in to change notification settings - Fork 53
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
Improve cmd options #2392
base: main
Are you sure you want to change the base?
Improve cmd options #2392
Conversation
The |
After implementing the feature, I noticed this was possible. The documentation only implies that it runs a pass and does not mention ordering. However, the order in which each |
I'm not sure I follow. Command-line order is exactly the pass order. |
Not all programs necessarily take argument order, parse, and store it in input order. And I also think that |
the problem is that now the two styles can be combined and you can write: -p "p1;p2" -p "p3;p4". i would rather there be one uniform way of doing things. most compiler drivers (llvm-opt, mlir-opt) do actually take passes like this in command-line order. |
I would also suggest renaming the |
@@ -162,7 +165,7 @@ impl PassManager { | |||
}); | |||
|
|||
// Push all aliases | |||
let mut aliases = self.aliases.iter().collect::<Vec<_>>(); | |||
let mut aliases = self.aliases_cmd.iter().collect::<Vec<_>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this change help with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It allows printing the alias pass name instead of the fully expanded pass. So the help message at "all" will be "validate,pre-opt..." instead of the long chain of passes.
There is no documentation on the
-i
switch so I have added a bit of doc about it.The
-i
option is a bit clunky, so I have improved the pass option to allow a semi-colon-separated list to specify a pass pipeline.Finally, the help message listing all the passes in one go is difficult to read. So, I have added a new variable to keep track of the original pass, which can better preserve the help message provided.