PandA-2024.02
Public Member Functions
BBGraph Struct Reference

Class used to describe a particular graph with basic blocks as nodes. More...

#include <basic_block.hpp>

Inheritance diagram for BBGraph:
Inheritance graph
[legend]
Collaboration diagram for BBGraph:
Collaboration graph
[legend]

Public Member Functions

 BBGraph (const BBGraphsCollectionRef _g, int selector)
 Standard constructor. More...
 
 BBGraph (const BBGraphsCollectionRef _g, int selector, CustomUnorderedSet< vertex > &sub)
 Sub-graph constructor. More...
 
 ~BBGraph () override=default
 Destructor. More...
 
void WriteDot (const std::string &file_name, const int detail_level=0) const
 Writes this graph in dot format. More...
 
void WriteDot (const std::string &file_name, const CustomUnorderedSet< vertex > &annotated, const int detail_level=0) const
 Write this graph in dot format with some basic blocks highlightened. More...
 
size_t num_bblocks () const
 Returns the number of basic blocks contained into the graph. More...
 
BBNodeInfoRef GetBBNodeInfo (const vertex node)
 Return the info associated with a basic block. More...
 
const BBNodeInfoConstRef CGetBBNodeInfo (const vertex node) const
 Return the info associated with a basic block. More...
 
BBEdgeInfoRef GetBBEdgeInfo (const EdgeDescriptor e)
 Returns the info associated with an edge. More...
 
const BBEdgeInfoConstRef CGetBBEdgeInfo (const EdgeDescriptor e) const
 Returns the info associated with an edge. More...
 
BBGraphInfoRef GetBBGraphInfo ()
 Returns the property associated with the graph. More...
 
const BBGraphInfoConstRef CGetBBGraphInfo () const
 Returns the property associated with the graph. More...
 
- Public Member Functions inherited from graph
virtual ~graph ()=default
 Destructor. More...
 
bool is_in_subset (const boost::graph_traits< graph >::vertex_descriptor v) const
 return true in case the vertex is a vertex of the subgraph. More...
 
int GetSelector () const
 Return the selector of this graph. More...
 
int GetSelector (const edge_descriptor e) const
 Return the selectors associated with an edge. More...
 
int GetSelector (const boost::graph_traits< graphs_collection >::vertex_descriptor source, const boost::graph_traits< graphs_collection >::vertex_descriptor target) const
 Return the selectors associated with an edge. More...
 
void GetStronglyConnectedComponents (std::map< size_t, UnorderedSetStdStable< boost::graph_traits< graphs_collection >::vertex_descriptor >> &strongly_connected_components) const
 Compute the strongly connected components of the graph. More...
 
void BreadthFirstSearch (const boost::graph_traits< graphs_collection >::vertex_descriptor node, boost::bfs_visitor<> *vis) const
 Compute the breadth first search. More...
 
void ReverseTopologicalSort (std::deque< boost::graph_traits< graphs_collection >::vertex_descriptor > &sorted_vertices) const
 Compute the reverse topological order of the graph. More...
 
void TopologicalSort (std::list< boost::graph_traits< graphs_collection >::vertex_descriptor > &sorted_vertices) const
 Compute the topological order of the graph. More...
 
bool IsReachable (const boost::graph_traits< graphs_collection >::vertex_descriptor x, const boost::graph_traits< graphs_collection >::vertex_descriptor y) const
 Compute if vertex y is reachable from x. More...
 
NodeInfoRef GetNodeInfo (typename boost::graph_traits< graphs_collection >::vertex_descriptor node)
 FIXME: this method should become protected and called by equivalent method in subclasses Get the node property. More...
 
GraphInfoRef GetGraphInfo ()
 FIXME: this method should become protected and called by equivalent method in subclasses Get the graph property. More...
 
const GraphInfoConstRef CGetGraphInfo () const
 FIXME: this method should become protected and called by equivalent method in subclasses Get the graph property. More...
 
template<typename VertexWriterTemplate , typename EdgeWriterTemplate >
void InternalWriteDot (const std::string &file_name, const VertexWriterConstRef vertex_writer, const EdgeWriterConstRef edge_writer) const
 Print the graph in dot format FIXME: this method should become protected and called by WriteDot. More...
 
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. More...
 
boost::graph_traits< graphs_collection >::edge_descriptor CGetEdge (const boost::graph_traits< graphs_collection >::vertex_descriptor source, const boost::graph_traits< graphs_collection >::vertex_descriptor target) const
 Returns the edge connecting two vertices; throw error if it does not exist. More...
 
 graph (graphs_collection *g, const int _selector)
 Standard constructor. More...
 
 graph (graphs_collection *g, const int _selector, const CustomUnorderedSet< boost::graph_traits< graphs_collection >::vertex_descriptor > &vertices)
 Sub-graph constructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from graph
const NodeInfoConstRef CGetNodeInfo (typename boost::graph_traits< graphs_collection >::vertex_descriptor node) const
 Get the node property. More...
 
EdgeInfoRef GetEdgeInfo (typename boost::graph_traits< graphs_collection >::vertex_descriptor source, typename boost::graph_traits< graphs_collection >::vertex_descriptor target)
 Get the edge property. More...
 
const EdgeInfoConstRef CGetEdgeInfo (typename boost::graph_traits< graphs_collection >::vertex_descriptor source, typename boost::graph_traits< graphs_collection >::vertex_descriptor target) const
 Get the edge property. More...
 
EdgeInfoRef GetEdgeInfo (typename boost::graph_traits< graphs_collection >::edge_descriptor edge) const
 Get the edge property. More...
 
EdgeInfoConstRef CGetEdgeInfo (typename boost::graph_traits< graphs_collection >::edge_descriptor edge) const
 Get the edge property. More...
 
template<typename VertexWriterTemplate , typename EdgeWriterTemplate , typename GraphWriterTemplate >
void InternalWriteDot (const std::string &file_name, const VertexWriterConstRef vertex_writer, const EdgeWriterConstRef edge_writer, const GraphWriterConstRef graph_writer) const
 Print the graph in dot format. More...
 
- Protected Attributes inherited from graph
graphs_collectioncollection
 The graph collection. More...
 
const int selector
 selector More...
 

Detailed Description

Class used to describe a particular graph with basic blocks as nodes.

Definition at line 324 of file basic_block.hpp.

Constructor & Destructor Documentation

◆ BBGraph() [1/2]

BBGraph::BBGraph ( const BBGraphsCollectionRef  _g,
int  selector 
)

Standard constructor.

Parameters
BBGraphsCollectionis the bulk graph.
selectoris the selector used to filter the bulk graph.

Definition at line 144 of file basic_block.cpp.

◆ BBGraph() [2/2]

BBGraph::BBGraph ( const BBGraphsCollectionRef  _g,
int  selector,
CustomUnorderedSet< vertex > &  sub 
)

Sub-graph constructor.

Parameters
bb_graphs_collectionis the bulk graph.
selectoris the selector used to filter the bulk graph.
subis the set of vertices on which the graph is filtered.

Definition at line 148 of file basic_block.cpp.

◆ ~BBGraph()

BBGraph::~BBGraph ( )
overridedefault

Destructor.

Member Function Documentation

◆ CGetBBEdgeInfo()

const BBEdgeInfoConstRef BBGraph::CGetBBEdgeInfo ( const EdgeDescriptor  e) const
inline

Returns the info associated with an edge.

Definition at line 399 of file basic_block.hpp.

References graph::CGetEdgeInfo().

Referenced by BBCdgComputation::InternalExec(), EdgeCWriter::writeRoutineInstructions_rec(), and CWriter::writeRoutineInstructions_rec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CGetBBGraphInfo()

const BBGraphInfoConstRef BBGraph::CGetBBGraphInfo ( ) const
inline

◆ CGetBBNodeInfo()

const BBNodeInfoConstRef BBGraph::CGetBBNodeInfo ( const vertex  node) const
inline

Return the info associated with a basic block.

Parameters
nodeis the basic block vertex to be considered
Returns
the info associated with a basic block

Definition at line 383 of file basic_block.hpp.

References graph::CGetNodeInfo().

Referenced by SDCScheduling::AddDelayConstraints(), pragma_manager::CheckOmpFor(), Vectorize::ClassifyTreeNode(), FunctionCallOpt::detect_loops(), Loops::DetectIrreducibleLoop(), Loops::DetectLoops(), DataDependenceComputation::do_dependence_reduction(), Loop::GetRecursivelyOps(), SDCScheduling::Initialize(), Bit_Value::Initialize(), FSM_NI_SSA_liveness::InternalExec(), AddArtificialCallFlowEdges::InternalExec(), BBReachabilityComputation::InternalExec(), bb_feedback_edges_computation::InternalExec(), op_feedback_edges_computation::InternalExec(), AddBbEcfgEdges::InternalExec(), AddOpLoopFlowEdges::InternalExec(), eSSA::InternalExec(), CSE::InternalExec(), multi_way_if::InternalExec(), operations_cfg_computation::InternalExec(), Vectorize::InternalExec(), SDCScheduling::InternalExec(), parametric_list_based::InternalExec(), Loop::Loop(), liveness::non_in_parallel(), BBVertexSorter::operator()(), BasicBlocksProfilingCWriter::print_edge(), CWriter::schedule_copies(), SDCSorter::SDCSorter(), Loops::tarjan_scc(), Vectorize::Transform(), Loops::WriteDot(), EdgeCWriter::writeRoutineInstructions(), EdgeCWriter::writeRoutineInstructions_rec(), CWriter::writeRoutineInstructions_rec(), and ProfilingInformation::WriteToXml().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBBEdgeInfo()

BBEdgeInfoRef BBGraph::GetBBEdgeInfo ( const EdgeDescriptor  e)
inline

Returns the info associated with an edge.

Definition at line 391 of file basic_block.hpp.

References graph::GetEdgeInfo().

Here is the call graph for this function:

◆ GetBBGraphInfo()

BBGraphInfoRef BBGraph::GetBBGraphInfo ( )
inline

Returns the property associated with the graph.

Returns
the property associated with the graph

Definition at line 408 of file basic_block.hpp.

References graph::GetGraphInfo().

Referenced by Bit_Value::Initialize(), and eSSA::InternalExec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBBNodeInfo()

BBNodeInfoRef BBGraph::GetBBNodeInfo ( const vertex  node)
inline

Return the info associated with a basic block.

Parameters
nodeis the basic block vertex to be considered
Returns
the info associated with a basic block

Definition at line 373 of file basic_block.hpp.

References graph::GetNodeInfo().

Referenced by operations_cfg_computation::Initialize(), BBCdgComputation::InternalExec(), loops_computation::InternalExec(), and Vectorize::Transform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ num_bblocks()

size_t BBGraph::num_bblocks ( ) const

Returns the number of basic blocks contained into the graph.

Definition at line 177 of file basic_block.cpp.

Referenced by eSSA::InternalExec().

Here is the caller graph for this function:

◆ WriteDot() [1/2]

void BBGraph::WriteDot ( const std::string &  file_name,
const int  detail_level = 0 
) const

Writes this graph in dot format.

Parameters
file_nameis the file where the graph has to be printed
detail_levelis the detail level of the printed graph

Definition at line 153 of file basic_block.cpp.

Referenced by Loops::DetectLoops(), simple_code_motion::InternalExec(), and FunctionFrontendFlowStep::WriteBBGraphDot().

Here is the caller graph for this function:

◆ WriteDot() [2/2]

void BBGraph::WriteDot ( const std::string &  file_name,
const CustomUnorderedSet< vertex > &  annotated,
const int  detail_level = 0 
) const

Write this graph in dot format with some basic blocks highlightened.

Parameters
file_nameis the name of the file
detail_levelis the detail level of the printed graph
annotatedis the set of the vertices to be annotated

Definition at line 159 of file basic_block.cpp.

References CGetBBGraphInfo(), graph::collection, test_panda::full_name, and graphs_collection::parameters.

Here is the call graph for this function:

The documentation for this struct was generated from the following files:

Generated on Mon Feb 12 2024 13:03:44 for PandA-2024.02 by doxygen 1.8.13