forked from vyperlang/vyper
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat[venom]: add binop optimizations (vyperlang#4281)
this commit adds additional binop optimizations to venom. these are the analog of `optimize_binop` in the legacy optimizer and take us one step closer to being able to bypass the legacy optimizer in the venom pipeline. the rules have been added to the algebraic optimizations pass. adding them to the SCCP pass was considered, but to keep the rules all in one place and to keep each pass more self-contained, they were added to the algebraic optimizations pass, with additional SCCP passes performed for branch/cfg reduction. some additional machinery has been added, including `lit_eq` which compares two IRLiterals in modular arithmetic, and InstructionUpdator, which updates instructions while also updating the DFG in-place. this should be useful to use for other passes in the future (although out of scope for this PR). additional passes have been added since they were found to improve codesize. in particular, running AlgebraicOptimization multiple times, and running SCCP after LoadElimination, seem to have some additional benefits. --------- Co-authored-by: Charles Cooper <[email protected]>
- Loading branch information
1 parent
7136eab
commit 9a2cb2e
Showing
16 changed files
with
1,084 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.