DCFG
Dynamic Control Flow Graph
 All Classes Functions
Public Member Functions | List of all members
dcfg_api::DCFG_LOOP Class Referenceabstract

Interface to information about a loop. More...

#include <dcfg_api.H>

Inheritance diagram for dcfg_api::DCFG_LOOP:
dcfg_api::DCFG_GRAPH_BASE

Public Member Functions

virtual DCFG_ID get_process_id () const =0
 Get the process ID.
 
virtual DCFG_ID get_image_id () const =0
 Get the image ID.
 
virtual DCFG_ID get_routine_id () const =0
 Get routine ID.
 
virtual DCFG_ID get_loop_id () const =0
 Get loop ID, which equals the basic-block ID of the head node.
 
virtual UINT32 get_entry_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0
 Get set of IDs of the entry edges.
 
virtual UINT32 get_exit_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0
 Get set of IDs of the exit edges.
 
virtual UINT32 get_back_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0
 Get set of IDs of the back-edges.
 
virtual DCFG_ID get_parent_loop_id () const =0
 Get head node ID of most immediate containing loop, if any.
 
virtual UINT64 get_iteration_count () const =0
 Get dynamic iteration count.
 
virtual UINT64 get_iteration_count_for_thread (UINT32 thread_id) const =0
 Get dynamic execution count per thread.
 
- Public Member Functions inherited from dcfg_api::DCFG_GRAPH_BASE
virtual UINT32 get_basic_block_ids (DCFG_ID_CONTAINER &node_ids) const =0
 Get IDs of all basic blocks in the structure.
 
virtual UINT32 get_internal_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0
 Get list of internal edge IDs.
 
virtual UINT32 get_inbound_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0
 Get list of in-bound edge IDs.
 
virtual UINT32 get_outbound_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0
 Get list of out-bound edge IDs.
 
virtual UINT64 get_instr_count () const =0
 Get the total dynamic instruction count.
 
virtual UINT64 get_instr_count_for_thread (UINT32 thread_id) const =0
 Get per-thread dynamic instruction count.
 

Detailed Description

Interface to information about a loop.

Member Function Documentation

virtual UINT32 dcfg_api::DCFG_LOOP::get_back_edge_ids ( DCFG_ID_CONTAINER edge_ids) const
pure virtual

Get set of IDs of the back-edges.

These are the edges that are traversed when a loop is repeated following an entry. The target node of each back edge will be the head node of the loop by definition. By definition, an edge n->h is a back edge if h dominates n, where h is the head node.

Returns
Number of IDs that were added to edge_ids.
Parameters
[out]edge_idsContainer to which edge IDs are added. Previous contents of the container are not emptied by this call, so it should be emptied by the programmer before the call if desired. The programmer can use any implementation of DCFG_ID_CONTAINER: DCFG_ID_VECTOR, DCFG_ID_SET, etc.
virtual UINT32 dcfg_api::DCFG_LOOP::get_entry_edge_ids ( DCFG_ID_CONTAINER edge_ids) const
pure virtual

Get set of IDs of the entry edges.

These are the edges that are traversed when a loop is entered from somewhere outside the loop. This set does not include back edges.

Returns
Number of IDs that were added to edge_ids.
Parameters
[out]edge_idsContainer to which edge IDs are added. Previous contents of the container are not emptied by this call, so it should be emptied by the programmer before the call if desired. The programmer can use any implementation of DCFG_ID_CONTAINER: DCFG_ID_VECTOR, DCFG_ID_SET, etc.
virtual UINT32 dcfg_api::DCFG_LOOP::get_exit_edge_ids ( DCFG_ID_CONTAINER edge_ids) const
pure virtual

Get set of IDs of the exit edges.

These are the edges that are traversed when a loop is exited. This set does not include call edges from the loop. If you also want call edges, use DCFG_GRAPH_BASE::get_outbound_edge_ids(). Note that any given edge may exit more than one loop when loops are nested.

Returns
Number of IDs that were added to edge_ids.
Parameters
[out]edge_idsContainer to which edge IDs are added. Previous contents of the container are not emptied by this call, so it should be emptied by the programmer before the call if desired. The programmer can use any implementation of DCFG_ID_CONTAINER: DCFG_ID_VECTOR, DCFG_ID_SET, etc.
virtual DCFG_ID dcfg_api::DCFG_LOOP::get_image_id ( ) const
pure virtual

Get the image ID.

Returns
Image ID of this loop.
virtual UINT64 dcfg_api::DCFG_LOOP::get_iteration_count ( ) const
pure virtual

Get dynamic iteration count.

This is the number of times the loop was executed, including entry from outside the loop and via its back edges. By definition, a loop can only be entered at its head node.

Returns
Number of times loop was execcuted, summed across all threads.
virtual UINT64 dcfg_api::DCFG_LOOP::get_iteration_count_for_thread ( UINT32  thread_id) const
pure virtual

Get dynamic execution count per thread.

See DCFG_LOOP::get_iteration_count() for iteration-count definition.

Returns
Number of times loop was executed in given thread.
Parameters
[in]thread_idThread number. Typically, threads are consecutively numbered from zero to DCFG_PROCESS::get_highest_thread_id().
virtual DCFG_ID dcfg_api::DCFG_LOOP::get_loop_id ( ) const
pure virtual

Get loop ID, which equals the basic-block ID of the head node.

The head node is the common target of all the back edges in the loop.

Returns
ID number of head node.
virtual DCFG_ID dcfg_api::DCFG_LOOP::get_parent_loop_id ( ) const
pure virtual

Get head node ID of most immediate containing loop, if any.

This indicates loop nesting.

Returns
ID number of head node of parent loop or zero (0) if there is no parent loop.
virtual DCFG_ID dcfg_api::DCFG_LOOP::get_process_id ( ) const
pure virtual

Get the process ID.

Returns
Process ID of this loop.
virtual DCFG_ID dcfg_api::DCFG_LOOP::get_routine_id ( ) const
pure virtual

Get routine ID.

Returns
routine ID number of this loop.

The documentation for this class was generated from the following file: