aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/flowgraph.c
AgeCommit message (Collapse)AuthorFilesLines
2020-01-29domtree: domtree_build() creates extraneous bb->doms entriesXan Phung1-0/+4
Each time domtree_build gets called, extraneous/duplicated child nodes get left in the bb->doms ptrlist. This is because the existing children are not cleared from bb->doms before rebuilding it. In addition to consuming memory, the extraneous child nodes result in a malformed dominance tree. The following 3 line patch fixes this problem by freeing the dominator tree before rebuilding it. Signed-off-by: Xan Phung <xan.phung@gmail.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-07-01dom: add support for dominance queriesLuc Van Oostenryck1-0/+24
The dominance tree is useless as such, what's matter is to be able to make queries, to ask if such BB dominates this other BB. This patch add an API (domtree_dominates()) to do this. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-07-01dom: add some debugging for the dominance treeLuc Van Oostenryck1-0/+14
So, it's possible to use the flag '-vdomtree' to dump the domonance tree. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-07-01dom: calculate the dominance treeLuc Van Oostenryck1-0/+103
Build the CFG's dominance tree and for each BB record: - the immediate dominator as bb->idom (is null for entry BB). - the list of immediately dominated BB as bb->doms. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-07-01graph: add debugging for (reverse) postorder traversalLuc Van Oostenryck1-0/+13
Just use the flag '-vpostorder' to dump the links once calculated. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-07-01graph: build the CFG reverse postorder traversalLuc Van Oostenryck1-0/+65
Do a DFS on the CFG and record the (reverse) postorder. Use this order for the normal BB traversal (ep->bbs). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>