GCC Middle and Back End API Reference
tm_ipa_cg_data Struct Reference
Collaboration diagram for tm_ipa_cg_data:

Data Fields

struct cgraph_nodeclone
struct tm_regionall_tm_regions
bitmap irrevocable_blocks_normal
bitmap irrevocable_blocks_clone
bitmap transaction_blocks_normal
unsigned tm_callers_normal
unsigned tm_callers_clone
bool is_irrevocable
bool in_callee_queue
bool in_worklist
bool want_irr_scan_normal

Detailed Description


Interprocedual analysis for the creation of transactional clones. The aim of this pass is to find which functions are referenced in a non-irrevocable transaction context, and for those over which we have control (or user directive), create a version of the function which uses only the transactional interface to reference protected memories. This analysis proceeds in several steps:

(1) Collect the set of all possible transactional clones:

(a) For all local public functions marked tm_callable, push it onto the tm_callee queue.

(b) For all local functions, scan for calls in transaction blocks. Push the caller and callee onto the tm_caller and tm_callee queues. Count the number of callers for each callee.

(c) For each local function on the callee list, assume we will create a transactional clone. Push all calls onto the callee queues; count the number of clone callers separately to the number of original callers.

(2) Propagate irrevocable status up the dominator tree:

(a) Any external function on the callee list that is not marked tm_callable is irrevocable. Push all callers of such onto a worklist.

(b) For each function on the worklist, mark each block that contains an irrevocable call. Use the AND operator to propagate that mark up the dominator tree.

(c) If we reach the entry block for a possible transactional clone, then the transactional clone is irrevocable, and we should not create the clone after all. Push all callers onto the worklist.

(d) Place tm_irrevocable calls at the beginning of the relevant blocks. Special case here is the entry block for the entire transaction region; there we mark it GTMA_DOES_GO_IRREVOCABLE for the library to begin the region in serial mode. Decrement the call count for all callees in the irrevocable region.

(3) Create the transactional clones:

Any tm_callee that still has a non-zero call count is cloned.

   This structure is stored in the AUX field of each cgraph_node.  

Field Documentation

struct tm_region* tm_ipa_cg_data::all_tm_regions
     The tm regions in the normal function.  

Referenced by gate_tm_memopt().

struct cgraph_node* tm_ipa_cg_data::clone
     The clone of the function that got created.  
bool tm_ipa_cg_data::in_callee_queue
     Flags indicating the presence of this function in various queues.  
bool tm_ipa_cg_data::in_worklist
bitmap tm_ipa_cg_data::irrevocable_blocks_clone

Referenced by ipa_tm_scan_irr_block().

bitmap tm_ipa_cg_data::irrevocable_blocks_normal
     The blocks of the normal/clone functions that contain irrevocable
     calls, or blocks that are post-dominated by irrevocable calls.  
bool tm_ipa_cg_data::is_irrevocable
     True if all calls to this function's transactional clone
     are irrevocable.  Also automatically true if the function
     has no transactional clone.  
unsigned tm_ipa_cg_data::tm_callers_clone
unsigned tm_ipa_cg_data::tm_callers_normal
     The number of callers to the transactional clone of this function
     from normal and transactional clones respectively.  
bitmap tm_ipa_cg_data::transaction_blocks_normal
     The blocks of the normal function that are involved in transactions.  

Referenced by gate_tm_memopt().

bool tm_ipa_cg_data::want_irr_scan_normal
     Flags indicating the kind of scan desired while in the worklist.  

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