-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 function to easily generate preset pass managers #8125
Conversation
This commit adds a new function, generate_preset_pass_managers(), which is used to quickly generate the preset pass manager for manual interaction. Prior to this new function there were lower level functions which are used to generate the individual pass manager objects for each optimization level but they are hidden behind an abstraction object, PassManagerConfig which is the only input. This makes it harder to work with because the user has to manually remember to generate the config object prior to creating the pass manager. Similarly this new function simplifies the creation of preset pass managers by having a single entry point instead of 4 for each optimization level.
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 2429289079
💛 - Coveralls |
If a user manually specifies a Target object to use as the compilation target we still need to generate the old data structures to trigger some passes to run. We also want the properties of the target to supersede those in a specified backend if it's manually specified. This commit corrects the handling of this so the manually specified target is the source of truth when specified.
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.
Overall LGTM! I left some picky comments on the docstring (since we're touching it anyways, why not 😛) and do we want to add tests for target_to_backend_properties
? Maybe that's not necessary since it's implicitly tested in the test_with_no_backend
test 🙂
releasenotes/notes/generate_pass_manager_preset-1e6c9641accd5d60.yaml
Outdated
Show resolved
Hide resolved
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Summary
This commit adds a new function,
generate_preset_pass_managers()
, whichis used to quickly generate the preset pass manager for manual
interaction. Prior to this new function there were lower level functions
which are used to generate the individual pass manager objects for each
optimization level but they are hidden behind an abstraction object,
PassManagerConfig
which is the only input. This makes it harder to workwith because the user has to manually remember to generate the config
object prior to creating the pass manager. Similarly this new function
simplifies the creation of preset pass managers by having a single entry
point instead of 4 for each optimization level.
Details and comments