53 #include <boost/tuple/tuple.hpp> 60 if(boost::num_vertices(*
input) == 0)
65 THROW_ASSERT(i2o.size() == o2i.size(),
"Different map sizes");
68 graph::vertex_iterator v, v_end;
69 for(boost::tie(v, v_end) = boost::vertices(*
input); v != v_end; v++)
77 std::list<vertex> levels;
78 boost::topological_sort(*
input, std::front_inserter(levels));
81 for(
auto&
level : levels)
99 while(current_node && current_node != A && current_node != post_dominators.at(A))
101 if(sorted_nodes[current_node] > sorted_nodes[A])
103 add_edge(i2o[A], i2o[current_node], output);
109 current_node = post_dominators.at(current_node);
Dominator o post-dominator data structure.
File containing functions and utilities to support the printing of debug messagges.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
const CustomUnorderedMapStable< Vertex, Vertex > & get_dominator_map() const
Return the dominators tree as a map between Vertex and its immediate dominator.
void calculate_weak_dominance_info(graphs_collection *output, CustomUnorderedMap< vertex, vertex > &i2o, CustomUnorderedMap< vertex, vertex > &o2i)
Compute weak dominance info.
const int debug_level
the debug level
void add_edge(vertex source, vertex target, graphs_collection *output)
Add a weak dominance edge between two nodes.
boost::graph_traits< graph >::in_edge_iterator InEdgeIterator
in_edge_iterator definition.
exceptions managed by PandA
vertex end
the exit vertex
const ParameterConstRef param
The set of input parameters.
volatile int output[DIM_Y][DIM_X]
Auxiliary methods for manipulating string.
vertex start
the entry vertex
boost::graph_traits< graph >::edge_iterator EdgeIterator
edge_iterator definition.
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
refcount< EdgeInfo > EdgeInfoRef
RefCount type definition of the edge_info class structure.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
General class used to describe a graph in PandA.
void calculate_dominance_info(enum dominance::cdi_direction dir)
The main entry point into this module.
#define DEBUG_LEVEL_NONE
no debugging print is performed.
const int selector
the selector used in output graph
boost::graph_traits< graphs_collection >::edge_descriptor AddSelector(const boost::graph_traits< graphs_collection >::edge_descriptor edge, const int selector)
Add a selector to an existing edge.
refcount< NodeInfo > NodeInfoRef
RefCount type definition of the NodeInfo class structure.
Base class description of data information associated with each edge of a graph.
weak_dominance(const graph *_input, vertex _start, vertex _end, const ParameterConstRef param, int selector=WD_SELECTOR)
Constructor.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
this class is used to manage the command-line or XML options.
unsigned counter[N_THREADS]
boost::graph_traits< graphs_collection >::edge_descriptor InternalAddEdge(boost::graph_traits< graphs_collection >::vertex_descriptor source, boost::graph_traits< graphs_collection >::vertex_descriptor target, const int selector, const EdgeInfoRef info)
Add an edge to this graph FIXME: this should be protected.
const graph * input
the input graph (not const since node info are copied in the new graph
virtual boost::graph_traits< boost_graphs_collection >::vertex_descriptor AddVertex(const NodeInfoRef info)
Add a vertex to this graph with a property.
bool ExistsEdge(const boost::graph_traits< graphs_collection >::vertex_descriptor source, const boost::graph_traits< graphs_collection >::vertex_descriptor target) const
Check if an edge exists.
Class specifying weak dominance calculus.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...