Skip to content
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

Merged
merged 2 commits into from
Jan 10, 2023

Conversation

redbopo
Copy link
Contributor

@redbopo redbopo commented Aug 31, 2022

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.

@@ -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");
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@czgdp1807
Copy link
Collaborator

Rest this is a good PR. @redbopo Would you like to complete it so that we can merge?

@redbopo
Copy link
Contributor Author

redbopo commented Sep 2, 2022

Thanks for reviews, @czgdp1807 , I'll add it soon.

}
}
_parse_pass_arg(arg_pass, _user_defined_passes);
_parse_pass_arg(skip_pass, _skip_passes);
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍🏻.

@redbopo
Copy link
Contributor Author

redbopo commented Sep 5, 2022

Thanks for reviews @czgdp1807 , is it okay to merge it now?

Copy link
Collaborator

@czgdp1807 czgdp1807 left a 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?

Copy link
Contributor

@certik certik left a 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.

Copy link
Collaborator

@czgdp1807 czgdp1807 left a 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.

@czgdp1807
Copy link
Collaborator

@Smit-create Please rebase on top of latest main and get this in. Thanks.

redbopo and others added 2 commits January 10, 2023 10:39
   Also change option to --skip-pass, format like other options.
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.

4 participants