-
Notifications
You must be signed in to change notification settings - Fork 20
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 support for basic blocks and CFGs #49
Open
VedantParanjape
wants to merge
24
commits into
BuildIt-lang:master
Choose a base branch
from
VedantParanjape:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
VedantParanjape
force-pushed
the
master
branch
from
September 3, 2023 17:00
67ed12f
to
41afb5f
Compare
VedantParanjape
force-pushed
the
master
branch
from
September 30, 2023 14:51
9c8158d
to
2005723
Compare
VedantParanjape
force-pushed
the
master
branch
2 times, most recently
from
November 1, 2023 14:33
f8e342f
to
423d300
Compare
Added class for representing basic blocks, and a helper function to generate basic blocks from AST. For testing, disabled the loop_finder code.
Add support to build a dominator tree for a given CFG, and add APIs to use the dominator tree to find idoms and dominance information.
This commit does the following things: 1) Cleans up the basic_block def by adding a typedef. 2) Adds code to generate a idom map, which makes it easy to iterate over the dominator tree. 3) Implements a skeleton class for loop analysis pass. 4) Adds relevant tests to builder_context.cpp to test the dominator_tree APIs 5) Rename the dominator_tree class to dominator_analysis class.
This commit adds the analysis pass to find natural loops and subloops. It uses the algorithm from LLVM LoopInfo anaylsis pass for the same, heavily uses the dominance tree to find the backedges and loop headers.
…ic block was carved out.
…sis (36/43 tests pass)
…oop simplifications
…tter with lesser LOC)
…headers that are not immediate parent
…rough more than 2 loops
VedantParanjape
force-pushed
the
master
branch
from
January 28, 2024 16:07
423d300
to
863b433
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added class for representing basic blocks, and a helper function to generate basic blocks from AST. For testing, disabled the loop_finder code.
Update v1: Added code to iterate the CFGs and build a dominator tree.
Update v2: Generate idom_map and add loop info pass skeleton
Update v3: Implement the loop info pass and add the run to the builder_context.cpp