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

Public Member Functions

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

Constructor & Destructor Documentation

eliminate_dom_walker::eliminate_dom_walker ( cdi_direction  direction)
inline

Member Function Documentation

void eliminate_dom_walker::after_dom_children ( basic_block  )
virtual

Make no longer available leaders no longer available.

Reimplemented from dom_walker.

void eliminate_dom_walker::before_dom_children ( basic_block  b)
virtual

Perform elimination for the basic-block B during the domwalk.

 Mark new bb.   
     We want to perform redundant PHI elimination.  Do so by
     replacing the PHI with a single copy if possible.
     Do not touch inserted, single-argument or virtual PHIs.   
     Queue the copy for eventual removal.   
     If we inserted this PHI node ourself, it's not an elimination.   
     Lookup the RHS of the expression, see if we have an
     available computation for it.  If so, replace the RHS with
     the available computation.   
         If there is no usable leader mark lhs as leader for its value.   
         See PR43491.  Do not replace a global register variable when
         it is a the RHS of an assignment.  Do replace local register
         variables since gcc does not guarantee a local variable will
         be allocated in register.
         Do not perform copy propagation or undo constant propagation.   
             If there is no existing usable leader but SCCVN thinks
             it has an expression it wants to use as replacement,
             insert that.   
             If there is no existing leader but SCCVN knows this
             value is constant, use that constant.   
             If we removed EH side-effects from the statement, clean
             its EH information.   
             We need to make sure the new and old types actually match,
             which may require adding a simple cast, which fold_convert
             will do for us.   
             If we removed EH side-effects from the statement, clean
             its EH information.   
             Likewise for AB side-effects.   
     If the statement is a scalar store, see if the expression
     has the same value number as its rhs.  If so, the store is
     dead.   
             Queue stmt for removal.   
     Visit COND_EXPRs and fold the comparison with the
     available value-numbers.   
     Visit indirect calls and turn them into direct calls if
     possible.   
             When changing a call into a noreturn call, cfg cleanup
             is needed to fix up the noreturn call.   
             If we removed EH side-effects from the statement, clean
             its EH information.   
             Likewise for AB side-effects.   
             Changing an indirect call to a direct call may
             have exposed different semantics.  This may
             require an SSA update.   

Reimplemented from dom_walker.

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.


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