GCC Middle and Back End API Reference
dom_opt_dom_walker Class Reference
Inheritance diagram for dom_opt_dom_walker:
Collaboration diagram for dom_opt_dom_walker:

Public Member Functions

 dom_opt_dom_walker (cdi_direction direction)
virtual void before_dom_children (basic_block)
virtual void after_dom_children (basic_block)
void walk (basic_block)

Private Member Functions

void thread_across_edge (edge)

Private Attributes

gimple m_dummy_cond

Constructor & Destructor Documentation

dom_opt_dom_walker::dom_opt_dom_walker ( cdi_direction  direction)
inline

Member Function Documentation

void dom_opt_dom_walker::after_dom_children ( basic_block  bb)
virtual

We have finished processing the dominator children of BB, perform any finalization actions in preparation for leaving this node in the dominator tree.

 If we have an outgoing edge to a block with multiple incoming and
 outgoing edges, then we may be able to thread the edge, i.e., we
 may be able to statically determine which of the outgoing edges
 will be traversed when the incoming edge from BB is traversed.   
     Only try to thread the edge if it reaches a target block with
     more than one predecessor and more than one successor.   
     Similarly for the ELSE arm.   
 These remove expressions local to BB from the tables.   

Reimplemented from dom_walker.

References dump_file, dump_flags, print_generic_expr(), and print_gimple_expr().

void dom_opt_dom_walker::before_dom_children ( basic_block  )
virtual

Function to call before the recursive walk of the dominator children.

 Push a marker on the stacks of local information so that we know how
 far to unwind when we finalize this block.   
 PHI nodes can create equivalences too.   
 Create equivalences from redundant PHIs.  PHIs are only truly
 redundant when they exist in the same block, so push another
 marker and unwind right afterwards.   
 Now prepare to process dominated blocks.   

Reimplemented from dom_walker.

void dom_opt_dom_walker::thread_across_edge ( edge  e)
private

Wrapper for common code to attempt to thread an edge. For example, it handles lazily building the dummy condition and the bookkeeping when jump threading is successful.

 Push a marker on both stacks so we can unwind the tables back to their
 current state.   
 Traversing E may result in equivalences we can utilize.   
 With all the edge equivalences in the tables, go ahead and attempt
 to thread through E->dest.   
 And restore the various tables to their state before
 we threaded this edge. 

 XXX The code in tree-ssa-threadedge.c will restore the state of
 the const_and_copies table.  We we just have to restore the expression
 table.   

Referenced by restore_vars_to_original_value().

void dom_walker::walk ( basic_block  bb)
inherited

Walk the dominator tree.

Recursively walk the dominator tree. BB is the basic block we are currently visiting.

     Don't worry about unreachable blocks.   
         Callback for subclasses to do custom things before we have walked
         the dominator children, but before we walk statements.   
         Mark the current BB to be popped out of the recursion stack
         once children are processed.   
     NULL is used to mark pop operations in the recursion stack.   
         Callback allowing subclasses to do custom things after we have
         walked dominator children, but before we walk statements.   

References bb_postorder, inverted_post_order_compute(), last_basic_block, n_basic_blocks, and postorder_num.


Field Documentation

gimple dom_opt_dom_walker::m_dummy_cond
private

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