Skip to content
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
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

VedantParanjape
Copy link
Contributor

@VedantParanjape VedantParanjape commented May 15, 2023

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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant