-
-
Notifications
You must be signed in to change notification settings - Fork 814
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds two additional optimization passes to the Venom pipeline, `mem2var` and `Sparse Conditional Constant Propagation`. The `mem2var` pass has the purpose of promoting some of the memory accesses that the frontend emits to Venom variables, optimizing out memory reads and writes. It is analogous to the `mem2reg` pass in LLVM. Right now it only applies promotions conservatively, but is the basis for more advanced memory optimizations in the future. To facilitate the implementation of `mem2var` this commit additionally modifies the original IR emitter to emit "abstract" memory locations (i.e. "allocas") instead of hard-coded pointers if the venom pipeline is enabled. A small amount of refactoring was done to the memory allocator to enable this switch to be implemented cleanly. The `sccp` pass is responsible for evaluating and propagating constants in the code, eliminating conditional branches and performing dead code elimination in the process. It is a linear `O(2n)` pass, based on the classical algorithm by Wegman and Zadeck. References: https://dl.acm.org/doi/pdf/10.1145/103135.103136 --------- Co-authored-by: Charles Cooper <[email protected]>
- Loading branch information
1 parent
1592ea1
commit 7d28a50
Showing
31 changed files
with
1,051 additions
and
206 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
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.