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

Public Member Functions

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

Detailed Description

For each statement determines the outermost loop in that it is invariant,

  • statements on whose motion it depends and the cost of the computation.
  • This information is stored to the LIM_DATA structure associated with
  • each statement.

Constructor & Destructor Documentation

invariantness_dom_walker::invariantness_dom_walker ( cdi_direction  direction)
inline

References NULL.


Member Function Documentation

virtual void dom_walker::after_dom_children ( basic_block  )
inlinevirtualinherited
void invariantness_dom_walker::before_dom_children ( basic_block  bb)
virtual

Determine the outermost loops in that statements in basic block BB are invariant, and record them to the LIM_DATA associated with the statements. Callback for dom_walker.

 Look at PHI nodes, but only if there is at most two.
 ???  We could relax this further by post-processing the inserted
 code and transforming adjacent cond-exprs with the same predicate
 to control flow again.   
         Make sure to note always_executed_in for stores to make
         store-motion work.   
         If divisor is invariant, convert a/b to a*(1/b), allowing reciprocal
         to be hoisted out of loop, saving expensive divide.   
         If the shift count is invariant, convert (A >> B) & 1 to
         A & (1 << B) allowing the bit mask to be hoisted out of the loop
         saving an expensive shift.   

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: