-
Notifications
You must be signed in to change notification settings - Fork 159
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
Add an option to skip pass in default pipeline #1069
Conversation
src/bin/lpython.cpp
Outdated
@@ -902,6 +903,7 @@ int main(int argc, char *argv[]) | |||
app.add_flag("--indent", compiler_options.indent, "Indented print ASR/AST"); | |||
app.add_flag("--tree", compiler_options.tree, "Tree structure print ASR/AST"); | |||
app.add_option("--pass", arg_pass, "Apply the ASR pass and show ASR (implies --show-asr)"); | |||
app.add_option("--skip_pass", skip_pass, "Skip an ASR pass in default pipeline"); |
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 if I want to skip multiple passes? Like loop unrolling and function inlining? I think we should treat skip_pass
and pass
command line arguments in the same fashion while parsing them but just ignore the pass which is present skip_pass
vector.
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.
Yes, I consider it will be like the way in parse_pass_arg().
although in the issue mentioned just said Add an option to skip/ignore a pass in the default pipeline
So I left it here.
Rest this is a good PR. @redbopo Would you like to complete it so that we can merge? |
Thanks for reviews, @czgdp1807 , I'll add it soon. |
} | ||
} | ||
_parse_pass_arg(arg_pass, _user_defined_passes); | ||
_parse_pass_arg(skip_pass, _skip_passes); |
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.
👍🏻.
Thanks for reviews @czgdp1807 , is it okay to merge it now? |
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.
Fine by me. We just need to update it with main
and then get it in. @certik Any ideas for testing this other than manual verification?
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.
I think this is fine for now. I think we have to ultimately rework how passes are managed and make this more general. Until then I think this works.
a9807b0
to
47794b8
Compare
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.
LGTM. But merge after #1411 is complete. In fact once #1411 is complete, @Smit-create would you be able to add this same feature to LFortran as well. We will merge both this PR and the one you will create for LFortran together. This is a good feature so I guess shouldn't wait for next libasr sync.
@Smit-create Please rebase on top of latest |
Also change option to --skip-pass, format like other options.
47794b8
to
6525a76
Compare
Add an option to skip/ignore a pass in the default pipeline in issue_943
Although there will be conflict with print asr pass PR
I think it's okay to just start.