-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Create an IR optimisation pass manager. #2399
Labels
compiler: optimization
IR Optimization Passes
Comments
I put something into the |
More TODOs:
|
Design discussion: #3596 (since GH hasn't added an auto-link). |
Merged
vaivaswatha
added a commit
that referenced
this issue
Feb 7, 2023
The new pass manager replaces the existing one, and also is now used in the main `forc build` pipeline (the old pass manager was restricted to the `opt` executable). It doesn't fully achieve #2399 and #3596 yet. i.e., it doesn't do automatic dependence resolution and handle categories of passes. --------- Co-authored-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>
vaivaswatha
added a commit
that referenced
this issue
Feb 13, 2023
This PR allows passes to specify dependences on other (analysis) passes. The pass manager then ensures that any analysis that a pass depends on is available before that pass executes. Tracking issue: #2399. Design discussion: #3596. In the next PR under this work, I will introduce pass groups, allowing easy specification of optimization levels etc.
7 tasks
vaivaswatha
added a commit
that referenced
this issue
Feb 14, 2023
This PR allows passes to specify dependences on other (analysis) passes. The pass manager then ensures that any analysis that a pass depends on is available before that pass executes. Tracking issue: #2399. Design discussion: #3596. In the next PR under this work, I will introduce pass groups, allowing easy specification of optimization levels etc. Testing: I ensured that the bytecode hashes for all "to pass" tests in our testsuite remained same with and without this PR.
vaivaswatha
added a commit
that referenced
this issue
Feb 16, 2023
## Description Introduce `PassGroup` as a construct to organize passes. Also have module passes for verifier and printer. For example, we can now do `opt module_printer dce module_printer < dce1.ir` that prints the module before and after DCE. No extra command line flags have been added to `forc`, yet. #3596, #2399 Testing: All "should_pass" tests have the same bytecode hash before and after this change. ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers.
7 tasks
vaivaswatha
added a commit
that referenced
this issue
Feb 20, 2023
## Description This doesn't add any new option for `forc`. At the moment we have just `-O1` and I believe that can stay as the default without additional flags. We have the infrastructure now to add more optimization levels and options with the new pass manager, and hence add the actual `forc` options when necessary. Closes #2399 ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As we add new optimisation passes we need a structured way to call them.
Some potential features:
-O0
,-Os
,-O3
, etc.But initially we just need a nice way to say 'optimise this IR at this level' from Sway core.
The text was updated successfully, but these errors were encountered: