It inherits from the LEDA class GRAPH<INFO_NODE, INFO_EDGE>. The attributes of the nodes are of type INFO_NODE, and the attributes of edges are of type INFO_EDGE. It models cyclic data dependence graphs. The implemented LOOP model is described in Loop Model.
All LEDA access, creation and update methods can be used on a LOOP object.
Definition at line 71 of file loop.h.
Public Member Functions | |
Creation | |
LOOP () | |
Default constructor. | |
void | clear () |
Empty the DAG. | |
LOOP (ARCHITECTURE isa) | |
Constructs an empty LOOP object encapsulating a user-defined generic description of the architecture (ISA). | |
~LOOP () | |
Access Operations | |
int | MaxLambda () const |
Returns the maximal iteration edge distance in the loop. Formally equal to ![]() | |
int | MinLambda () const |
Returns the minimal iteration edge distance in the loop. Formally equal to ![]() | |
LEDA::set< edge > | flow_from_to (node u, node v) const |
Returns the set of all flow edges (not necessarily through registers) from the source node ![]() ![]() ![]() | |
LEDA::set< edge > | flow_from_to (int id_u, int id_v) const |
Returns the set of all flow edges (not necessarily through registers) from the source node to the destination node. Formally equal to ![]() | |
LEDA::set< edge > | flow_reg_from_to (node u, node v) const |
Returns the set of all flow edges through registers from the source node ![]() ![]() ![]() | |
LEDA::set< edge > | flow_reg_from_to (int id_u, int id_v) const |
Returns the set of all flow edges through registers from the source node to the destination node. Formally equal to ![]() | |
LEDA::set< edge > | flow_reg_from_to (node u, node v, int t) const |
Returns the set of all flow edges of type ![]() ![]() ![]() ![]() | |
LEDA::set< edge > | flow_reg_from_to (int id_u, int id_v, int t) const |
Returns the set of all flow edges through registers from the source node to the destination node. Formally equal to ![]() | |
int | max_dist (node u, node v) const |
Returns the maximal distance between two nodes (in terms of number of iterations). Formally equal to ![]() | |
int | max_dist (int id_u, int id_v) const |
Returns the maximal iteration distance between two nodes. Formally equal to ![]() | |
int | max_flow_dist (node u, node v) const |
Returns the maximal iteration flow distance (not necessarily through registers) between two nodes. Formally equal to ![]() | |
int | max_flow_dist (int id_u, int id_v) const |
Returns the maximal iteration flow distance (not necessarily through registers) between two nodes. Formally equal to ![]() | |
int | max_flow_reg_dist (node u, node v) const |
Returns the maximal iteration flow distance through registers between two nodes. Formally equal to ![]() | |
int | max_flow_reg_dist (int id_u, int id_v) const |
Returns the maximal iteration flow distance through registers between two nodes. Formally equal to ![]() | |
int | max_flow_reg_dist (node u, node v, int t) const |
Returns the maximal iteration flow distance through registers of type t between two nodes. Formally equal to ![]() | |
int | max_flow_reg_dist (int id_u, int id_v, int t) const |
Returns the maximal iteration flow distance through registers between two nodes. Formally equal to ![]() | |
int | min_dist (node u, node v) const |
Returns the minimal iteration distance between two nodes. Formally equal to ![]() | |
int | min_dist (int id_u, int id_v) const |
Returns the minimal iteration distance between two nodes. Formally equal to ![]() | |
int | min_flow_dist (node u, node v) const |
Returns the minimal iteration flow distance (not necessarily through registers) between two nodes. Formally equal to ![]() | |
int | min_flow_dist (int id_u, int id_v) const |
Returns the minimal iteration flow distance (not necessarily through registers) between two nodes. Formally equal to ![]() | |
int | min_flow_reg_dist (node u, node v) const |
Returns the minimial iteration flow distance through registers between two nodes. Formally equal to ![]() | |
int | min_flow_reg_dist (int id_u, int id_v) const |
Returns the minimal iteration flow distance through registers between two nodes. Formally equal to ![]() | |
int | min_flow_reg_dist (node u, node v, int t) const |
Returns the minimial iteration flow distance through registers of type t between two nodes. Formally equal to ![]() | |
int | min_flow_reg_dist (int id_u, int id_v, int t) const |
Returns the minimal iteration flow distance through registers of type t between two nodes. Formally equal to ![]() | |
LEDA::rational | CRITICAL_CYCLE () const |
Returns the ratio of the critical cycle of the loop. | |
LEDA::rational | CRITICAL_CYCLE (LEDA::list< edge > &el) const |
int | lambda (edge e) const |
Returns the distance ![]() ![]() | |
Update Operations | |
void | copy (const LOOP &G2) |
Duplicates a LOOP. | |
void | copy (const LOOP &G2, node_map< node > &mn, edge_map< edge > &me) |
Duplicates a LOOP. | |
void | build_internal_structures () |
Build internal data structures for the LOOP object. | |
void | set_lambda (edge e, int l) |
Sets a distance ![]() ![]() | |
void | write_to_vcg (const char *filename) const |
Exports the LOOP DDG to a vcg file in order to be visualized with the xvcg tool. For more information about xvcg, see http://rw4.cs.uni-sb.de/users/sander/html/gsvcg1.html The user can navigate using vcg on all DDG attrbutes (types of edges, opcodes, etc.). | |
void | write_to_vcg (const char *filename, int t) const |
Exports the LOOP DDG to a vcg file in order to be visualized with the xvcg tool. This function considers one register type. | |
void | write_to_gl (const char *filename) const |
Exports the LOOP to a gl file. If multiple registers types exist, they are all considered as the same type. | |
void | write_to_gl (const char *filename, int regtype_id) const |
Exports the LOOP to a gl file considering one register type. | |
bool | read_from_gl (const char *filename, int regtype_id) |
Imports a DDG loop from a gl file. In case of multiple registers types, this function allows to considere one of them. | |
bool | read_from_gl (const char *filename) |
Imports a DDG loop from a gl file. | |
void | write_to_xml (const char *filename) const |
Exports the LOOP to a leda XML format. . | |
bool | read_from_xml (const char *filename) |
Imports the LOOP from an XML file. | |
bool | check () |
A simple check method that returns true if the DAG object seems ok. False otherwise. | |
bool | check (int regtype_id) |
A simple check method that returns true if the DAG object seems ok for the specified register type. False otherwise. | |
Access Operations | |
LEDA::set< edge > | edges_from_to (node u, node v) const |
Returns the set of all edges from the source node ![]() ![]() | |
LEDA::set< edge > | edges_from_to (int id_u, int id_v) const |
Returns the set of all edges from the source node to the destination node. | |
int | LongestPath () const |
Returns the value of the longest path of the DAG. | |
int | LongestPath (LEDA::list< node > &nl) const |
Returns the value of the longest path of the DAG. | |
int | LongestPath (list< edge > &el) const |
Returns the value of the longest path of the DAG. | |
int | CriticalPath () |
This is an alias of the method DAG::LongestPath(). It returns the value of the longest (critical) path. | |
int | CriticalPath (LEDA::list< node > &nl) |
Returns the value of the longest (critical) path. | |
int | CriticalPath (LEDA::list< edge > &el) |
Returns the value of the longest (critical) path. | |
int | LongestPathTo (node) const |
Returns the value of the longest path from the top of the DAG (sources) up to a node given as argument. | |
int | LongestPathFrom (node) const |
Returns the value of the longest path from a node given as argument to the bottom the DAG (sinks). | |
int | ShortestPathTo (node) const |
Returns the value of the shortest path from the top of the DAG (sources) up to a node given as argument. | |
int | ShortestPathFrom (node) const |
Returns the value of the shortest path from a node given as argument to the bottom the DAG (sinks). | |
int | lp (node u, node v) const |
Returns the value of the longest path from a node ![]() ![]() | |
LEDA::set< node > | get_down (node u) const |
Returns the set ![]() | |
LEDA::set< node > | get_up (node u) const |
Returns the set ![]() | |
LEDA::set< node > | get_parents (node u) const |
Returns the set ![]() | |
LEDA::set< node > | get_children (const node u) const |
Returns the set ![]() | |
node | node_with_id (int i) const |
Returns the node with the integer identifier given as argument. | |
node | node_with_name (std::string name) const |
Returns the node with the name given as argument. | |
bool | is_value (node n) const |
Returns true if the node is an instruction writing into a register (i.e. if it belongs to the ![]() | |
bool | is_value (int i, int t) const |
Returns true if the node defined by its indentifier is an instruction writing into a register of type t (i.e. if it belongs to the ![]() | |
bool | is_value (node n, int t) const |
Returns true if the node is an instruction writing into a register of type t (i.e. if it belongs to the ![]() | |
bool | is_value (int i) const |
Returns true if the node defined by its indentifier is an instruction writing into a register (i.e. if it belongs to the ![]() | |
bool | is_flow (edge e) const |
Returns true if the edges is a flow dependence (not necessarily through registers). | |
bool | is_flow_reg (edge e) const |
Returns true if the edges is a flow dependence through a register. This is the case of a flow edge having a source writing into a register. | |
bool | is_flow_reg (edge e, int t) const |
Returns true if the edges is a flow dependence through a register of type t. This is the case of a flow edge having a source writing into a register. | |
int | get_register_type_id (edge e) const |
Returns the register type of a flow edge. | |
DDG::edge_type | etype (edge e) const |
Returns the type of the edge ![]() | |
set< node > | get_V_R () const |
Returns the set ![]() | |
set< node > | get_V_R (int t) const |
Returns the set ![]() | |
LEDA::list < REGISTER_TYPES > | T () const |
LEDA::set< edge > | get_E_R () const |
Returns the set ![]() | |
LEDA::set< edge > | get_E_R (int t) const |
Returns the set ![]() | |
LEDA::set< node > | get_Sources () const |
Returns the set of nodes which are the sources of the DAG. | |
LEDA::set< node > | get_Targets () const |
Returns the set of nodes which are the targetsof (sinks) of the DAG. | |
LEDA::set< node > | get_Cons (node u) const |
Returns the set of consumers of a node. | |
LEDA::set< node > | get_Cons (node u, int id_regtype) const |
Returns the set of consumers of a node writing inside a register of a given type. | |
LEDA::set< int > | get_Sources_id () const |
Returns the set of nodes identifiers which are the sources of the DAG. | |
LEDA::set< int > | get_Targets_id () const |
Returns the set of nodes identifiers which are the targetsof (sinks) the DAG. | |
LEDA::set< int > | all_nodes_id () |
Returns the set of nodes identifiers. | |
int | source_id (edge e) const |
Returns the integer identifier of the edge source. | |
int | target_id (edge e) const |
Returns the integer identifier of the edge target. | |
ARCHITECTURE | get_ISA () const |
Returns the ARCHITECTURE of the DAG. | |
int | delta (edge e) const |
Returns the latency ![]() ![]() | |
int | latency (node n) const |
Returns the latency ![]() ![]() | |
int | delta_r (node n) const |
Returns the reading latency ![]() ![]() | |
int | delta_r (int idn) const |
Returns the reading latency ![]() | |
int | delta_w (node n) const |
Returns the writing latency ![]() ![]() | |
int | delta_w (int idn) const |
Returns the writing latency ![]() | |
int | delta_w (node n, int regtype_id) const |
Returns the writing latency ![]() ![]() | |
int | delta_w (int idn, int regtype_id) const |
Returns the writing latency ![]() | |
int | id (node n) const |
Returns the integer identifier of the node ![]() | |
INSTRUCTIONS_TYPES | instruction_type (node n) const |
Returns an INSTRUCTIONS_TYPES object attached to the node ![]() | |
INSTRUCTIONS_TYPES | instruction_type (int id) const |
Returns an INSTRUCTIONS_TYPES object attached to the node given by its ![]() | |
std::string | get_string_attribute (node n) const |
Returns the textual attribute of the node ![]() | |
const INFO_NODE & | inf (node v) const |
Returns the information of node ![]() | |
const INFO_EDGE & | inf (edge e) const |
Returns the information of node ![]() | |
const INFO_NODE & | operator[] (node v) const |
Returns a reference to the information of ![]() | |
INFO_NODE & | operator[] (node v) |
const INFO_EDGE & | operator[] (edge e) const |
Returns a reference to the information of ![]() | |
INFO_EDGE & | operator[] (edge e) |
int | outdeg (node v) const |
Returns the number of edges leaving to node ![]() | |
int | indeg (node v) const |
Returns the number of edges entering ![]() | |
int | degree (node v) const |
Returns ![]() | |
node | source (edge e) const |
Returns the source node of edge ![]() | |
node | target (edge e) const |
Returns the target node of edge ![]() | |
node | opposite (node v, edge e) const |
Returns ![]() ![]() ![]() | |
node | opposite (edge e, node v) const |
Returns ![]() ![]() ![]() | |
int | number_of_nodes () const |
Returns the number of nodes in the DAG. | |
int | number_of_edges () const |
Returns the number of edges in the DAG. | |
const LEDA::list < node > & | all_nodes () const |
Returns the list of all nodes in the DAG. | |
const LEDA::list < edge > & | all_edges () const |
Returns the list of all edges in the DAG. | |
LEDA::list< edge > | out_edges (node v) const |
Returns the list of edges leaving the node ![]() | |
LEDA::list< edge > | in_edges (node v) const |
Returns the list of edges entering the node ![]() | |
node | first_node () const |
Returns the first node in the DAG. | |
node | last_node () const |
Returns the last node in the DAG. | |
node | choose_node () const |
Returns a random node of the DAG (nil if empty). | |
node | succ_node (node v) const |
Returns the successor of node ![]() | |
node | pred_node (node v) const |
Returns the predecessor of node ![]() | |
edge | first_edge () const |
Returns the first edge in the DAG. | |
edge | last_edge () const |
Returns the last edge in the DAG. | |
edge | choose_edge () const |
Returns a random edge of the DAG (nil if empty). | |
edge | succ_edge (edge e) const |
Returns the successor of edge ![]() | |
edge | pred_edge (edge e) const |
Returns the predecessor of edge ![]() | |
bool | empty () const |
Returns true if the DAG is empty. | |
bool | member (node v) const |
Returns true if the node ![]() | |
bool | member (edge e) const |
Returns true if the edge ![]() | |
bool | is_hidden (edge e) const |
Returns true if ![]() | |
bool | is_hidden (node v) const |
Returns true if ![]() | |
LEDA::list< edge > | hidden_edges () const |
Returns the list of all hidden edges. | |
LEDA::list< node > | hidden_nodes () const |
Returns the list of all hidden nodes. | |
int | max_delta (node u, node v) const |
Returns the maximal edge latency between to nodes, i.e., ![]() | |
int | max_delta (int u, int v) const |
Returns the maximal edge latency between to nodes (given by their ids), i.e., ![]() | |
int | min_delta (node u, node v) const |
Returns the minimal edge latency between to nodes, i.e., ![]() | |
int | min_delta (int u, int v) const |
Returns the minimal edge latency between to nodes (given by their ids), i.e., ![]() | |
INSTRUCTIONS_TYPES | search_instruction_type (const std::string opcode) const |
Looks for the instruction type (inside the DAG ISA) that has the opcode given as argument. If not found, it returns an INSTRUCTIONS_TYPES object with opcode_id equal to -1. | |
INSTRUCTIONS_TYPES | search_instruction_type (int opcode_id) const |
Looks for the instruction type (inside the DAG ISA) that has the opcode id given as argument. Returns NULL if not found. If not found, it returns an INSTRUCTIONS_TYPES object with opcode_id equal to -1. | |
NodeFlag | node_flag (node n) const |
Returns the node flag of n. | |
Update Operations | |
Returns the list of register types of the ISA of the DAG. The ISA object should be attached to the DAG before calling this function. See the DAG construtor method, or the DDG:DAG:set_ISA method. LEDA::list<REGISTER_TYPES> T() const ;
/** | |
int | new_node (int it_id) |
Creates a new node. | |
int | new_node (int it_id, std::string text_inst) |
Creates a new node. | |
int | new_node (int it_id, int n_id) |
Creates a new node. | |
int | new_node (int it_id, int n_id, std::string text_inst) |
Creates a new node. | |
void | del_node (node) |
Deletes the node given as argument. | |
void | del_node (int node_id) |
Deletes the node whose id is given as argument. | |
edge | new_edge (int s, int t, INFO_EDGE ie) |
Creates a new edge. | |
edge | new_edge (node s, node t, INFO_EDGE ie) |
Creates a new edge. | |
void | del_edge (edge e) |
Deletes the edge given as argument. | |
void | copy (const DAG &G2) |
Duplicates a DAG. | |
void | copy (const DAG &G2, node_map< node > &mn, edge_map< edge > &me) |
Duplicates a DAG. | |
void | get_loop_body (const LOOP &G2, node_map< node > &mn, edge_map< edge > &me) |
Retrieves a loop body. | |
void | get_loop_body (const LOOP &G2) |
Retrieves a loop body. | |
void | set_ISA (ARCHITECTURE isa) |
Sets the set of generic instruction types (ISA) encapsulated inside the DAG. | |
void | set_delta (edge e, int l) |
Sets a latency ![]() ![]() | |
void | set_instruction_type (node n, int it_id) |
Sets an INSTRUCTIONS_TYPES object (given by its opcode id) attached to the node ![]() | |
void | set_string_attribute (node u, std::string inst_text) |
Sets a textual attribute to the node ![]() | |
void | set_etype (edge e, DDG::edge_type et) |
Sets an edge type (flow, serial, antidep, etc.). | |
void | hide_edge (edge e) |
Removes temporarily the edge ![]() | |
void | hide_edges (const LEDA::list< edge > &el) |
Hides all edges in the list el. | |
void | restore_edge (edge e) |
Restores the hidden edge ![]() | |
void | restore_edges (const LEDA::list< edge > &el) |
Restores all edges in the list el. | |
void | restore_all_edges () |
Restores all hidden edges. | |
void | hide_node (node v) |
Removes temporarily the node ![]() | |
void | hide_node (node v, LEDA::list< edge > &h_edges) |
Removes temporarily the node ![]() | |
void | hide_nodes (const LEDA::list< node > &nl) |
Hides all nodes in the list nl. | |
void | restore_node (node v) |
Restores the hidden node ![]() | |
void | restore_all_nodes () |
Restores all hidden nodes. Note that no adjacent edges to the hidden nodes are restored by this operation. | |
void | del_all_edges () |
Deletes all edges from the DAG. | |
void | move_edge (edge e, node v, node w) |
Moves the edge ![]() ![]() ![]() | |
void | set_node_flag (node n, const NodeFlag theValue) |
Set the flag of the node n. | |
Import and Export Methods | |
void | write_to_xml (const char *filename) |
Exports the DAG to an XML description. | |
Protected Attributes | |
unsigned int | cpt_nodes |
LEDA::d_array< int, LEDA::set< node > > | V_R |
LEDA::d_array< int, LEDA::set< edge > > | E_R |
ARCHITECTURE | ISA |
node_array< set< node > > | down |
node_array< set< node > > | up |
node_array< int > | longuest_path_from |
node_array< int > | longuest_path_to |
node_matrix< int > | lp_array |
node_array< int > | shortest_path_from |
node_array< int > | shortest_path_to |
set< node > | Sources |
set< node > | Targets |
map2< node, int, set < node > > | Cons |
LEDA::map< int, node > | node_index_table |
LOOP | ( | ARCHITECTURE | isa | ) |
Constructs an empty LOOP object encapsulating a user-defined generic description of the architecture (ISA).
[in] | isa | ISA object, see ISA_xml. |
InvalidISADesc | When the ISA description file is corrupted, and object of class DDG::InvalidISADesc is thrown. |
LEDA::set<edge> flow_from_to | ( | int | id_u, | |
int | id_v | |||
) | const |
Returns the set of all flow
edges (not necessarily through registers) from the source node to the destination node. Formally equal to .
[in] | id_u | The integer identifier of the source node. |
[in] | id_v | The integer identifier of the destination node. |
LEDA::set<edge> flow_reg_from_to | ( | node | u, | |
node | v | |||
) | const |
Returns the set of all flow
edges through registers from the source node to the destination node
. Formally equal to
.
NonUniqueRegisterType |
LEDA::set<edge> flow_reg_from_to | ( | int | id_u, | |
int | id_v | |||
) | const |
Returns the set of all flow
edges through registers from the source node to the destination node. Formally equal to .
[in] | id_u | The integer identifier of the source node. |
[in] | id_v | The integer identifier of the destination node. |
NonUniqueRegisterType |
LEDA::set<edge> flow_reg_from_to | ( | int | id_u, | |
int | id_v, | |||
int | t | |||
) | const |
Returns the set of all flow
edges through registers from the source node to the destination node. Formally equal to .
[in] | id_u | The integer identifier of the source node. |
[in] | id_v | The integer identifier of the destination node. |
[in] | t | considered register type |
int max_dist | ( | node | u, | |
node | v | |||
) | const |
Returns the maximal distance between two nodes (in terms of number of iterations). Formally equal to .
int max_dist | ( | int | id_u, | |
int | id_v | |||
) | const |
Returns the maximal iteration distance between two nodes. Formally equal to .
[in] | id_u | The integer identifier of the source node. |
[in] | id_v | The integer identifier of the destination node. |
int max_flow_dist | ( | node | u, | |
node | v | |||
) | const |
Returns the maximal iteration flow distance (not necessarily through registers) between two nodes. Formally equal to .
int max_flow_dist | ( | int | id_u, | |
int | id_v | |||
) | const |
Returns the maximal iteration flow distance (not necessarily through registers) between two nodes. Formally equal to .
[in] | id_u | The integer identifier of the source node. |
[in] | id_v | The integer identifier of the destination node. |
int max_flow_reg_dist | ( | node | u, | |
node | v | |||
) | const |
Returns the maximal iteration flow distance through registers between two nodes. Formally equal to .
NonUniqueRegisterType |
int max_flow_reg_dist | ( | int | id_u, | |
int | id_v | |||
) | const |
Returns the maximal iteration flow distance through registers between two nodes. Formally equal to .
[in] | id_u | The integer identifier of the source node. |
[in] | id_v | The integer identifier of the destination node. |
NonUniqueRegisterType |
int max_flow_reg_dist | ( | node | u, | |
node | v, | |||
int | t | |||
) | const |
Returns the maximal iteration flow distance through registers of type t between two nodes. Formally equal to .
int max_flow_reg_dist | ( | int | id_u, | |
int | id_v, | |||
int | t | |||
) | const |
Returns the maximal iteration flow distance through registers between two nodes. Formally equal to .
[in] | id_u | The integer identifier of the source node. |
[in] | id_v | The integer identifier of the destination node. |
[in] | t | considered register type |
int min_dist | ( | node | u, | |
node | v | |||
) | const |
Returns the minimal iteration distance between two nodes. Formally equal to .
int min_dist | ( | int | id_u, | |
int | id_v | |||
) | const |
Returns the minimal iteration distance between two nodes. Formally equal to .
[in] | id_u | The integer identifier of the source node. |
[in] | id_v | The integer identifier of the destination node. |
int min_flow_dist | ( | node | u, | |
node | v | |||
) | const |
Returns the minimal iteration flow distance (not necessarily through registers) between two nodes. Formally equal to .
int min_flow_dist | ( | int | id_u, | |
int | id_v | |||
) | const |
Returns the minimal iteration flow distance (not necessarily through registers) between two nodes. Formally equal to .
[in] | id_u | The integer identifier of the source node. |
[in] | id_v | The integer identifier of the destination node. |
int min_flow_reg_dist | ( | node | u, | |
node | v | |||
) | const |
Returns the minimial iteration flow distance through registers between two nodes. Formally equal to .
int min_flow_reg_dist | ( | int | id_u, | |
int | id_v | |||
) | const |
Returns the minimal iteration flow distance through registers between two nodes. Formally equal to .
[in] | id_u | The integer identifier of the source node. |
[in] | id_v | The integer identifier of the destination node. |
int min_flow_reg_dist | ( | node | u, | |
node | v, | |||
int | t | |||
) | const |
Returns the minimial iteration flow distance through registers of type t between two nodes. Formally equal to .
int min_flow_reg_dist | ( | int | id_u, | |
int | id_v, | |||
int | t | |||
) | const |
Returns the minimal iteration flow distance through registers of type t between two nodes. Formally equal to .
[in] | id_u | The integer identifier of the source node. |
[in] | id_v | The integer identifier of the destination node. |
[in] | t | considered register type |
LEDA::rational CRITICAL_CYCLE | ( | ) | const |
Returns the ratio of the critical cycle of the loop.
The critical cycle of a loop is defined by the one maximizing the ratio . Contrary to what it is usually implemented, this method can detect null cycles,
i.e
., cycles such as
and
. This method returns -1 if no cycle exists in the graph.
LEDA::rational CRITICAL_CYCLE | ( | LEDA::list< edge > & | el | ) | const |
Returns the ratio of the critical cycle of the loop and gives its list of edges.
A critical cycle in a loop data dependence graph is defined as the one which maximizes the ratio . Contrary to what it is usually implemented, this method can detect null cycles,
i.e
., cycles such as
and
. This method returns -1 if no cycle exists in the graph.
[out] | el | Contains the list of edges that belongs to the critical cycle. |
void copy | ( | const LOOP & | G2 | ) |
Duplicates a LOOP.
[in] | G2 | The current LOOP object will contain a duplicated copy of G2. |
void copy | ( | const LOOP & | G2, | |
node_map< node > & | mn, | |||
edge_map< edge > & | me | |||
) |
Duplicates a LOOP.
[in] | G2 | The current LOOP object will contain a duplicated copy of G2. |
[out] | mn | mn is a mapping from the set of nodes of G2 to the set of nodes of the current LOOP. ![]() ![]() |
[out] | me | me is a mapping from the set of edges of G2 to the set of edges of the current LOOP. ![]() ![]() |
void build_internal_structures | ( | ) |
Build internal data structures for the LOOP object.
For internal information consistency, this function member should be called after update operations such as LOOP::new_node(INSTRUCTIONS_TYPES it), LOOP::new_edge(INFO_EDGE), etc. This method compute some internal information returned by other methods (the set , the set of consumers per value, etc.). If the LOOP object is not modified after calling build_internal_structures(), all its internal information remain consistent. remarks For efficiency, the user can group series of update operations before ultimately calling build_internal_structures()
Reimplemented from DAG.
void write_to_vcg | ( | const char * | filename | ) | const |
Exports the LOOP DDG to a vcg file in order to be visualized with the xvcg tool. For more information about xvcg, see http://rw4.cs.uni-sb.de/users/sander/html/gsvcg1.html The user can navigate using vcg on all DDG attrbutes (types of edges, opcodes, etc.).
Import and Export Methods
[in] | filename | the file name of the DDG in vcg format |
Reimplemented from DAG.
void write_to_vcg | ( | const char * | filename, | |
int | t | |||
) | const |
Exports the LOOP DDG to a vcg file in order to be visualized with the xvcg tool. This function considers one register type.
[in] | filename | the file name of the DDG in vcg format |
[in] | t | the considered register type For more information about xvcg, see http://rw4.cs.uni-sb.de/users/sander/html/gsvcg1.html The user can navigate using vcg on all DDG attrbutes (types of edges, opcodes, etc.) |
Reimplemented from DAG.
void write_to_gl | ( | const char * | filename | ) | const |
void write_to_gl | ( | const char * | filename, | |
int | regtype_id | |||
) | const |
bool read_from_gl | ( | const char * | filename, | |
int | regtype_id | |||
) |
Imports a DDG loop from a gl file. In case of multiple registers types, this function allows to considere one of them.
[in] | filename | the file name of the DDG in gl format |
[in] | regtype_id | The flow_reg edges in the gl file are considered as flow_reg through this register type. |
BadIODDG | If an IO error occurs (corrupted or non present input files for instance), an exception object of type DDG::BadIODDG is thrown * |
Reimplemented from DAG.
bool read_from_gl | ( | const char * | filename | ) |
Imports a DDG loop from a gl file.
[in] | filename | the file name of the DDG in gl format |
Before reading a LOOP from a gl file, it is assumed that the ISA of the LOOP defines all the opcodes ids of the nodes as present in the gl file. The constructor DDG::LOOP(ARCHITECTURE) defines a LOOP with a user defined ISA, otherwise a default ISA is assumed, see ISA_xml.
BadIODDG | If an IO error occurs (corrupted or non present input files for instance), an exception object of type DDG::BadIODDG is thrown |
Reimplemented from DAG.
bool read_from_xml | ( | const char * | filename | ) |
Imports the LOOP from an XML file.
Reimplemented from DAG.
LEDA::set<edge> edges_from_to | ( | int | id_u, | |
int | id_v | |||
) | const [inherited] |
Returns the set of all edges from the source node to the destination node.
[in] | id_u | The integer identifier of the source node. |
[in] | id_v | The integer identifier of the destination node. |
int LongestPath | ( | LEDA::list< node > & | nl | ) | const [inherited] |
int LongestPath | ( | list< edge > & | el | ) | const [inherited] |
int CriticalPath | ( | LEDA::list< node > & | nl | ) | [inherited] |
Returns the value of the longest (critical) path.
[out] | nl | Contains the list of nodes belonging to the computed longest path. |
int CriticalPath | ( | LEDA::list< edge > & | el | ) | [inherited] |
Returns the value of the longest (critical) path.
[out] | el | Contains the list of edges belonging to the computed longest path. |
int lp | ( | node | u, | |
node | v | |||
) | const [inherited] |
Returns the value of the longest path from a node to a node
given as arguments*.
node node_with_id | ( | int | i | ) | const [inherited] |
Returns the node with the integer identifier given as argument.
IllegalAccessNode | If the node id does not exist, or if the node is hidden, then an exception of type DDG:IllegalAccessNode is thrown. |
Referenced by DAG::max_delta(), and DAG::min_delta().
node node_with_name | ( | std::string | name | ) | const [inherited] |
Returns the node with the name given as argument.
IllegalAccessNode | If the node id does not exist, or if the node is hidden. |
bool is_value | ( | node | n | ) | const [inherited] |
Returns true if the node is an instruction writing into a register (i.e. if it belongs to the set).
NonUniqueRegisterType |
bool is_value | ( | int | i | ) | const [inherited] |
Returns true if the node defined by its indentifier is an instruction writing into a register (i.e. if it belongs to the set).
NonUniqueRegisterType |
bool is_flow_reg | ( | edge | e | ) | const [inline, inherited] |
Returns true if the edges is a flow dependence through a register. This is the case of a flow edge having a source writing into a register.
NonUniqueRegisterType |
Definition at line 383 of file DAG.h.
References ARCHITECTURE::get_the_unique_register_type_id(), DAG::inf(), INFO_EDGE::is_flow_reg(), and DAG::ISA.
int get_register_type_id | ( | edge | e | ) | const [inherited] |
Returns the register type of a flow edge.
set<node> get_V_R | ( | ) | const [inline, inherited] |
Returns the set of instructions (nodes) writing into registers.
NonUniqueRegisterType |
Definition at line 408 of file DAG.h.
References ARCHITECTURE::get_the_unique_register_type_id(), DAG::ISA, and DAG::V_R.
set<node> get_V_R | ( | int | t | ) | const [inline, inherited] |
Returns the set of instructions (nodes) writing into registers of type t (given by its id).
BadRegType |
Definition at line 414 of file DAG.h.
References ARCHITECTURE::exist_register_type_id(), DAG::ISA, and DAG::V_R.
LEDA::set<edge> get_E_R | ( | ) | const [inline, inherited] |
Returns the set of flow dependence edges through registers.
NonUniqueRegisterType |
Definition at line 426 of file DAG.h.
References DAG::E_R, ARCHITECTURE::get_the_unique_register_type_id(), and DAG::ISA.
LEDA::set<edge> get_E_R | ( | int | t | ) | const [inline, inherited] |
Returns the set of flow dependence edges through registers of type t (given by its id).
BadRegType |
Definition at line 432 of file DAG.h.
References DAG::E_R, ARCHITECTURE::exist_register_type_id(), and DAG::ISA.
LEDA::set<node> get_Cons | ( | node | u | ) | const [inline, inherited] |
Returns the set of consumers of a node.
NonUniqueRegisterType |
Definition at line 450 of file DAG.h.
References DAG::Cons, ARCHITECTURE::get_the_unique_register_type_id(), and DAG::ISA.
LEDA::set<node> get_Cons | ( | node | u, | |
int | id_regtype | |||
) | const [inline, inherited] |
Returns the set of consumers of a node writing inside a register of a given type.
BadRegType |
Definition at line 458 of file DAG.h.
References DAG::Cons, ARCHITECTURE::exist_register_type_id(), and DAG::ISA.
int delta_w | ( | node | n | ) | const [inherited] |
Returns the writing latency of the node
.
int delta_w | ( | int | idn | ) | const [inherited] |
Returns the writing latency of the node given by its id.
int new_node | ( | int | it_id | ) | [inherited] |
Creates a new node.
[in] | it_id | The id of the INSTRUCTIONS_TYPES object describing the generic instruction of the node |
int new_node | ( | int | it_id, | |
std::string | text_inst | |||
) | [inherited] |
Creates a new node.
[in] | it_id | The id of the INSTRUCTIONS_TYPES object describing the generic instruction of the node |
[in] | text_inst | A textual attribute of the instruction |
int new_node | ( | int | it_id, | |
int | n_id | |||
) | [inherited] |
Creates a new node.
[in] | it_id | The id of the INSTRUCTIONS_TYPES object describing the generic instruction of the node |
[in] | n_id | A unique id for the node to create |
NonUniqueNodeID | if the input node id already exists |
int new_node | ( | int | it_id, | |
int | n_id, | |||
std::string | text_inst | |||
) | [inherited] |
Creates a new node.
[in] | it_id | The id of the INSTRUCTIONS_TYPES object describing the generic instruction of the node |
[in] | n_id | A unique id for the node to create |
[in] | text_inst | A textual attribute of the instruction |
NonUniqueNodeID | if the input node id already exists |
void del_node | ( | node | ) | [inherited] |
Deletes the node given as argument.
All the edges incident to the deleted node are removed from the DAG too.
void del_node | ( | int | node_id | ) | [inherited] |
Deletes the node whose id is given as argument.
All the edges incident to the deleted node are removed from the DAG too.
See also DAG::build_internal_structures().
edge new_edge | ( | int | s, | |
int | t, | |||
INFO_EDGE | ie | |||
) | [inherited] |
Creates a new edge.
It takes three arguments. If flow dependence, the inserted edge is added to the set .
[in] | s | The integer identifier of the source node. |
[in] | t | The integer identifier of the destination node. |
[in] | ie | The INFO_EDGE object describing the edge attribute. See also DAG::build_internal_structures(). |
edge new_edge | ( | node | s, | |
node | t, | |||
INFO_EDGE | ie | |||
) | [inherited] |
Creates a new edge.
It takes three arguments. If flow dependence, the inserted edge is added to the set .
[in] | s | The source node. |
[in] | t | The destination node. |
[in] | ie | The INFO_EDGE object describing the edge attribute. See also DAG::build_internal_structures(). |
void copy | ( | const DAG & | G2 | ) | [inherited] |
Duplicates a DAG.
[in] | G2 | The current DAG object will contain a duplicated copy of G2. This method will keep the same node ids, same edge and node information, etc. The internal consistency of the duplicated DAG is guaranteed. |
void copy | ( | const DAG & | G2, | |
node_map< node > & | mn, | |||
edge_map< edge > & | me | |||
) | [inherited] |
Duplicates a DAG.
[in] | G2 | The current DAG object will contain a duplicated copy of G2. This method will keep the same node ids, same edge and node information, etc. The internal consistency of the duplicated DAG is guaranteed. |
[out] | mn | mn is a mapping from the set of nodes of G2 to the set of nodes of the current DAG. ![]() ![]() |
[out] | me | me is a mapping from the set of edges of G2 to the set of edges of the current DAG. ![]() ![]() |
void get_loop_body | ( | const LOOP & | G2, | |
node_map< node > & | mn, | |||
edge_map< edge > & | me | |||
) | [inherited] |
Retrieves a loop body.
[in] | G2 | The current DAG object will contain the loop body of G2. This method will keep the same node ids, same edge and node information, etc. The internal consistency of the DAG is guaranteed. |
[out] | mn | mn is a mapping from the set of nodes of G2 to the set of nodes of the current DAG. ![]() ![]() |
[out] | me | me is a mapping from the set of edges of G2 to the set of edges of the current DAG. ![]() ![]() |
void get_loop_body | ( | const LOOP & | G2 | ) | [inherited] |
Retrieves a loop body.
[in] | G2 | The current DAG object will contain the loop body of G2. This method will keep the same node ids, same edge and node information, etc. The internal consistency of the duplicated DAG is guaranteed. |
void set_ISA | ( | ARCHITECTURE | isa | ) | [inline, inherited] |
Sets the set of generic instruction types (ISA) encapsulated inside the DAG.
[in] | isa | An ARCHITECTURE object describing a user-defined ISA. |
void set_string_attribute | ( | node | u, | |
std::string | inst_text | |||
) | [inherited] |
Sets a textual attribute to the node . For instance, this textual attribute can be used to associate the textual code of the instruction.
void hide_edge | ( | edge | e | ) | [inherited] |
Removes temporarily the edge . The edge can be restored by DAG::restore_edge(edge e).
void hide_edges | ( | const LEDA::list< edge > & | el | ) | [inherited] |
Hides all edges in the list el.
void restore_edge | ( | edge | e | ) | [inherited] |
Restores the hidden edge .
void restore_edges | ( | const LEDA::list< edge > & | el | ) | [inherited] |
Restores all edges in the list el.
void restore_all_edges | ( | ) | [inherited] |
Restores all hidden edges.
void hide_node | ( | node | v | ) | [inherited] |
Removes temporarily the node . Leaving and entering edges are also hidden. The node can be restored by DAG::restore_node(node v).
void hide_node | ( | node | v, | |
LEDA::list< edge > & | h_edges | |||
) | [inherited] |
Removes temporarily the node . Leaving and entering edges are also hidden. The node can be restored by DAG::restore_node(node n).
[in] | v | the node to hide. |
[out] | h_edges | the list of leaving and entering edges hidden in consequence of hiding the node ![]() |
void hide_nodes | ( | const LEDA::list< node > & | nl | ) | [inherited] |
Hides all nodes in the list nl.
void del_all_edges | ( | ) | [inherited] |
Deletes all edges from the DAG.
See also DAG::empty();
void write_to_xml | ( | const char * | filename | ) | [inherited] |