Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
dominators_example.cc File Reference

Demonstrates dominator tree and dominance frontier computation for SSA construction in a compiler pipeline. More...

#include <iostream>
#include <string>
#include <Dominators.H>
#include <tpl_graph.H>
Include dependency graph for dominators_example.cc:

Go to the source code of this file.

Functions

int main ()
 Demonstrates construction of a control-flow graph and performs dominance analyses.
 

Detailed Description

Demonstrates dominator tree and dominance frontier computation for SSA construction in a compiler pipeline.

Builds a control-flow graph (CFG) with if-else and loop structures, computes the dominator tree using the Lengauer-Tarjan algorithm, and shows where phi-functions would be placed for SSA form.

Definition in file dominators_example.cc.

Function Documentation

◆ main()

int main ( )

Demonstrates construction of a control-flow graph and performs dominance analyses.

Builds a sample CFG with if-else and loop structure, computes immediate dominators and post-dominators using the Lengauer–Tarjan algorithms, constructs dominator and post-dominator trees, computes dominance and post-dominance frontiers (for SSA phi-placement and CDG construction), reports blocks that need phi-functions, and runs example dominance/post-dominance queries while printing results to stdout.

Returns
int Exit status: 0 on success.

Definition at line 90 of file dominators_example.cc.

References Aleph::Lengauer_Tarjan_Dominators< GT, SA >::build_tree(), Aleph::Lengauer_Tarjan_Dominators< GT, SA >::compute_idom(), Aleph::Lengauer_Tarjan_Post_Dominators< GT, SA >::compute_ipdom(), Aleph::df(), Aleph::divide_and_conquer_partition_dp(), Aleph::Lengauer_Tarjan_Dominators< GT, SA >::dominance_frontiers(), Aleph::Lengauer_Tarjan_Dominators< GT, SA >::dominates(), and Aleph::join().