GCC Middle and Back End API Reference
tree-ssa-loop-im.c File Reference

Data Structures

struct  lim_aux_data
struct  mem_ref_loc
struct  mem_ref
struct  mem_ref_hasher
struct  fmt_data
struct  rewrite_mem_ref_loc
struct  first_mem_ref_loc_1
struct  prev_flag_edges
struct  sm_set_flag_if_changed
struct  ref_always_accessed

Typedefs

typedef struct mem_ref_locmem_ref_loc_p
typedef struct mem_refmem_ref_p

Functions

static bool ref_indep_loop_p (struct loop *, mem_ref_p)
static struct lim_aux_datainit_lim_data ()
static struct lim_aux_dataget_lim_data ()
static void free_lim_aux_data ()
static void clear_lim_data ()
bool for_each_index (tree *addr_p, bool(*cbck)(tree, tree *, void *), void *data)
enum move_pos movement_possibility ()
static struct loopoutermost_invariant_loop ()
static bool add_dependency (tree def, struct lim_aux_data *data, struct loop *loop, bool add_cost)
static unsigned stmt_cost ()
static struct loopoutermost_indep_loop ()
static treesimple_mem_ref_in_stmt ()
static mem_ref_p mem_ref_in_stmt ()
static bool extract_true_false_args_from_phi (basic_block dom, gimple phi, tree *true_arg_p, tree *false_arg_p)
static bool determine_max_movement ()
static void set_level ()
static void set_profitable_level ()
static bool nonpure_call_p ()
static gimple rewrite_reciprocal ()
static gimple rewrite_bittest ()
static void determine_invariantness_stmt (struct dom_walk_data *dw_data, basic_block bb)
static void determine_invariantness ()
static void move_computations_stmt (struct dom_walk_data *dw_data, basic_block bb)
static unsigned int move_computations ()
static bool may_move_till ()
static void force_move_till_op ()
static bool force_move_till ()
static void memref_free ()
static mem_ref_p mem_ref_alloc ()
static void record_mem_ref_loc ()
static void mark_ref_stored ()
static void gather_mem_refs_stmt ()
static int sort_bbs_in_loop_postorder_cmp ()
static void analyze_memory_references ()
static bool mem_refs_may_alias_p (mem_ref_p mem1, mem_ref_p mem2, struct pointer_map_t **ttae_cache)
template<typename FN >
static bool for_all_locs_in_loop ()
static void rewrite_mem_refs ()
static mem_ref_loc_p first_mem_ref_loc ()
static void lsm_tmp_name_add ()
static void gen_lsm_tmp_name ()
char * get_lsm_tmp_name ()
static void execute_sm_if_changed ()
static tree execute_sm_if_changed_flag_set ()
static void execute_sm ()
static void hoist_memory_references (struct loop *loop, bitmap mem_refs, vec< edge > exits)
static bool ref_always_accessed_p ()
static bool refs_independent_p ()
static void record_dep_loop ()
static bool ref_indep_loop_p_1 ()
static bool ref_indep_loop_p_2 ()
static bool ref_indep_loop_p ()
static bool can_sm_ref_p ()
static void find_refs_for_sm ()
static bool loop_suitable_for_sm (struct loop *loop, vec< edge > exits)
static void store_motion_loop ()
static void store_motion ()
static void fill_always_executed_in_1 ()
static void fill_always_executed_in ()
static void tree_ssa_lim_initialize ()
static void tree_ssa_lim_finalize ()
unsigned int tree_ssa_lim ()

Variables

static struct pointer_map_tlim_aux_data_map
struct {
   hash_table< mem_ref_hasher >   refs
   vec< mem_ref_p >   refs_list
   vec< bitmap_head >   refs_in_loop
   vec< bitmap_head >   refs_stored_in_loop
   vec< bitmap_head >   all_refs_stored_in_loop
   struct pointer_map_t *   ttae_cache
memory_accesses
static bitmap_obstack lim_bitmap_obstack
static unsigned * bb_loop_postorder
static char lsm_tmp_name [MAX_LSM_NAME_LENGTH+1]
static int lsm_tmp_name_length

Typedef Documentation

typedef struct mem_ref_loc * mem_ref_loc_p
Description of a memory reference location.   
typedef struct mem_ref * mem_ref_p
Description of a memory reference.   

Function Documentation

static bool add_dependency ( tree  def,
struct lim_aux_data data,
struct loop loop,
bool  add_cost 
)
static
DATA is a structure containing information associated with a statement
   inside LOOP.  DEF is one of the operands of this statement.

   Find the outermost loop enclosing LOOP in that value of DEF is invariant
   and record this in DATA->max_loop field.  If DEF itself is defined inside
   this loop as well (i.e. we need to hoist it out of the loop if we want
   to hoist the statement represented by DATA), record the statement in that
   DEF is defined to the DATA->depends list.  Additionally if ADD_COST is true,
   add the cost of the computation of DEF to the DATA->cost.

   If DEF is not invariant in LOOP, return false.  Otherwise return TRUE.   

References lim_aux_data::cost, lim_aux_data::depends, flow_loop_nested_p(), get_lim_data(), gimple_bb(), basic_block_def::loop_father, lim_aux_data::max_loop, and outermost_invariant_loop().

Referenced by determine_max_movement().

static bool can_sm_ref_p ( )
static
static void clear_lim_data ( )
static
static void determine_invariantness ( )
static
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.   

References dom_walk_data::before_dom_children, CDI_DOMINATORS, determine_invariantness_stmt(), fini_walk_dominator_tree(), init_walk_dominator_tree(), memset(), and walk_dominator_tree().

Referenced by tree_ssa_lim().

static bool determine_max_movement ( )
static
Determine the outermost loop to that it is possible to hoist a statement
   STMT and store it to LIM_DATA (STMT)->max_loop.  To do this we determine
   the outermost loop in that the value computed by STMT is invariant.
   If MUST_PRESERVE_EXEC is true, additionally choose such a loop that
   we preserve the fact whether STMT is executed.  It also fills other related
   information to LIM_DATA (STMT).

   The function returns false if STMT cannot be hoisted outside of the loop it
   is defined in, and true otherwise.   

References add_dependency(), CDI_DOMINATORS, lim_aux_data::cost, dom, extract_true_false_args_from_phi(), get_immediate_dominator(), get_lim_data(), gimple_bb(), gimple_phi_num_args(), gimple_vuse(), gsi_end_p(), gsi_last_bb(), gsi_stmt(), basic_block_def::loop_father, lim_aux_data::max_loop, mem_ref_in_stmt(), outermost_indep_loop(), stmt_cost(), and superloop_at_depth().

Referenced by determine_invariantness_stmt().

static void execute_sm ( )
static
Executes store motion of memory reference REF from LOOP.
   Exits from the LOOP are stored in EXITS.  The initialization of the
   temporary variable is put to the preheader of the loop, and assignments
   to the reference from the temporary variable are emitted to exits.   

References block_in_transaction(), create_tmp_reg(), dump_file, dump_flags, execute_sm_if_changed(), execute_sm_if_changed_flag_set(), first_mem_ref_loc(), for_each_index(), force_move_till(), get_lsm_tmp_name(), gsi_for_stmt(), gsi_insert_before(), gsi_insert_on_edge(), GSI_SAME_STMT, init_lim_data(), fmt_data::loop, loop_preheader_edge(), lim_aux_data::max_loop, mem_ref::mem, loop::num, fmt_data::orig_loop, print_generic_expr(), ao_ref_s::ref, rewrite_mem_refs(), lim_aux_data::tgt_loop, and unshare_expr().

Referenced by hoist_memory_references().

static void execute_sm_if_changed ( )
static
Helper function for execute_sm.  Emit code to store TMP_VAR into
   MEM along edge EX.

   The store is only done if MEM has changed.  We do this so no
   changes to MEM occur on code paths that did not originally store
   into it.

   The common case for execute_sm will transform:

     for (...) {
       if (foo)
         stuff;
       else
         MEM = TMP_VAR;
     }

   into:

     lsm = MEM;
     for (...) {
       if (foo)
         stuff;
       else
         lsm = TMP_VAR;
     }
     MEM = lsm;

  This function will generate:

     lsm = MEM;

     lsm_flag = false;
     ...
     for (...) {
       if (foo)
         stuff;
       else {
         lsm = TMP_VAR;
         lsm_flag = true;
       }
     }
     if (lsm_flag)      <--
       MEM = lsm;       <--

References add_bb_to_loop(), add_phi_arg(), alloc_aux_for_edge(), prev_flag_edges::append_cond_position, edge_def::aux, CDI_DOMINATORS, create_empty_bb(), edge_def::dest, find_edge(), gimple_build_cond(), gimple_phi_arg_def(), gimple_phi_arg_edge(), gimple_phi_num_args(), GSI_CONTINUE_LINKING, gsi_end_p(), gsi_insert_after(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), prev_flag_edges::last_cond_fallthru, basic_block_def::loop_father, make_edge(), recompute_dominator(), redirect_edge_succ(), set_immediate_dominator(), single_pred_p(), split_block_after_labels(), split_edge(), edge_def::src, unshare_expr(), and update_stmt().

Referenced by execute_sm().

static tree execute_sm_if_changed_flag_set ( )
static
Helper function for execute_sm.  On every location where REF is
   set, set an appropriate flag indicating the store.   

References create_tmp_reg(), for_all_locs_in_loop(), get_lsm_tmp_name(), lsm_tmp_name_add(), mem_ref::mem, and ao_ref_s::ref.

Referenced by execute_sm().

static bool extract_true_false_args_from_phi ( basic_block  dom,
gimple  phi,
tree true_arg_p,
tree false_arg_p 
)
static
From a controlling predicate in DOM determine the arguments from
   the PHI node PHI that are chosen if the predicate evaluates to
   true and false and store them to *TRUE_ARG_P and *FALSE_ARG_P if
   they are non-NULL.  Returns true if the arguments can be determined,
   else return false.   

References CDI_DOMINATORS, edge_def::dest, edge_def::dest_idx, dominated_by_p(), extract_true_false_edges_from_block(), gimple_bb(), single_pred_p(), and edge_def::src.

Referenced by determine_max_movement(), and move_computations_stmt().

static void fill_always_executed_in ( )
static
Fills ALWAYS_EXECUTED_IN information for basic blocks, i.e.
   for each such basic block bb records the outermost loop for that execution
   of its header implies execution of bb.   

References bitmap_clear(), bitmap_set_bit(), fill_always_executed_in_1(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), basic_block_def::index, loop::inner, loop::next, nonpure_call_p(), sbitmap_alloc(), and sbitmap_free().

Referenced by tree_ssa_lim().

static void fill_always_executed_in_1 ( )
static
Fills ALWAYS_EXECUTED_IN information for basic blocks of LOOP, i.e.
   for each such basic block bb records the outermost loop for that execution
   of its header implies execution of bb.  CONTAINS_CALL is the bitmap of
   blocks that contain a nonpure call.   

References bitmap_bit_p(), CDI_DOMINATORS, edge_def::dest, dominated_by_p(), basic_block_def::flags, flow_bb_inside_loop_p(), free(), get_immediate_dominator(), get_loop_body_in_dom_order(), loop::header, basic_block_def::index, loop::inner, last, loop::latch, basic_block_def::loop_father, loop::next, loop::num_nodes, and basic_block_def::succs.

Referenced by fill_always_executed_in().

static void find_refs_for_sm ( )
static
Marks the references in LOOP for that store motion should be performed
   in REFS_TO_SM.  SM_EXECUTED is the set of references for that store
   motion was performed in one of the outer loops.   

References bitmap_set_bit(), can_sm_ref_p(), memory_accesses, loop::num, and refs.

Referenced by store_motion_loop().

static mem_ref_loc_p first_mem_ref_loc ( )
static
Returns the first reference location to REF in LOOP.   

References for_all_locs_in_loop().

Referenced by execute_sm().

template<typename FN >
static bool for_all_locs_in_loop ( )
static
Iterates over all locations of REF in LOOP and its subloops calling
   fn.operator() with the location as argument.  When that operator
   returns true the iteration is stopped and true is returned.
   Otherwise false is returned.   

References mem_ref::accesses_in_loop, loop::inner, loop::next, and loop::num.

Referenced by execute_sm_if_changed_flag_set(), first_mem_ref_loc(), ref_always_accessed_p(), and rewrite_mem_refs().

bool for_each_index ( tree addr_p,
bool(*)(tree, tree *, void *)  cbck,
void *  data 
)
Calls CBCK for each index in memory reference ADDR_P.  There are two
   kinds situations handled; in each of these cases, the memory reference
   and DATA are passed to the callback:

   Access to an array: ARRAY_{RANGE_}REF (base, index).  In this case we also
   pass the pointer to the index to the callback.

   Pointer dereference: INDIRECT_REF (addr).  In this case we also pass the
   pointer to addr to the callback.

   If the callback returns false, the whole search stops and false is returned.
   Otherwise the function returns true after traversing through the whole
   reference *ADDR_P.   

References is_gimple_min_invariant().

Referenced by analyze_ref(), can_sm_ref_p(), close_phi_written_to_memory(), contains_abnormal_ssa_name_p(), execute_sm(), find_interesting_uses_address(), and infer_loop_bounds_from_ref().

static bool force_move_till ( )
static
static void force_move_till_op ( )
static
If OP is SSA NAME, force the statement that defines it to be
   moved out of the LOOP.  ORIG_LOOP is the loop in that EXPR is used.   

References gimple_nop_p(), is_gimple_min_invariant(), and set_level().

Referenced by force_move_till().

static void free_lim_aux_data ( )
static
Releases the memory occupied by DATA.   

References lim_aux_data::depends, and free().

Referenced by clear_lim_data().

static void gather_mem_refs_stmt ( )
static
Gathers memory references in statement STMT in LOOP, storing the
   information about them in the memory_accesses structure.  Marks
   the vops accessed through unrecognized statements there as
   well.   

References bitmap_set_bit(), dump_file, dump_flags, gimple_vdef(), gimple_vuse(), mem_ref::id, iterative_hash_expr(), mark_ref_stored(), mem_ref::mem, mem_ref_alloc(), memory_accesses, loop::num, print_generic_expr(), print_gimple_stmt(), record_mem_ref_loc(), ao_ref_s::ref, and simple_mem_ref_in_stmt().

Referenced by analyze_memory_references().

static void gen_lsm_tmp_name ( )
static
Stores the name for temporary variable that replaces REF to
   lsm_tmp_name.   

References get_name(), and lsm_tmp_name_add().

Referenced by get_lsm_tmp_name().

char* get_lsm_tmp_name ( )
Determines name for temporary variable that replaces REF.
   The name is accumulated into the lsm_tmp_name variable.
   N is added to the name of the temporary.   

References gen_lsm_tmp_name(), lsm_tmp_name, and lsm_tmp_name_add().

static void hoist_memory_references ( struct loop loop,
bitmap  mem_refs,
vec< edge exits 
)
static
Hoists memory references MEM_REFS out of LOOP.  EXITS is the list of exit
   edges of the LOOP.   

References execute_sm(), and memory_accesses.

Referenced by store_motion_loop().

static struct lim_aux_data* init_lim_data ( )
staticread
static bool loop_suitable_for_sm ( struct loop loop,
vec< edge exits 
)
static
Checks whether LOOP (with exits stored in EXITS array) is suitable
   for a store motion optimization (i.e. whether we can insert statement
   on its exits).   

References edge_def::flags.

Referenced by store_motion_loop().

static void lsm_tmp_name_add ( )
static
Adds S to lsm_tmp_name.   

References lsm_tmp_name_length, and strlen().

Referenced by execute_sm_if_changed_flag_set(), gen_lsm_tmp_name(), and get_lsm_tmp_name().

static void mark_ref_stored ( )
static
Marks reference REF as stored in LOOP.   

References bitmap_set_bit(), loop_outer(), loop::num, and mem_ref::stored.

Referenced by gather_mem_refs_stmt().

static bool may_move_till ( )
static
Checks whether the statement defining variable *INDEX can be hoisted
   out of the loop passed in DATA.  Callback for for_each_index.   

References outermost_invariant_loop().

Referenced by can_sm_ref_p().

static mem_ref_p mem_ref_alloc ( )
static
Allocates and returns a memory reference description for MEM whose hash
   value is HASH and id is ID.   

References mem_ref::accesses_in_loop, ao_ref_init(), mem_ref::dep_loop, mem_ref::hash, mem_ref::id, mem_ref::indep_loop, mem_ref::mem, and mem_ref::stored.

Referenced by gather_mem_refs_stmt(), and tree_ssa_lim_initialize().

static mem_ref_p mem_ref_in_stmt ( )
static
Returns the memory reference contained in STMT.   

References iterative_hash_expr(), memory_accesses, and simple_mem_ref_in_stmt().

Referenced by determine_max_movement().

static bool mem_refs_may_alias_p ( mem_ref_p  mem1,
mem_ref_p  mem2,
struct pointer_map_t **  ttae_cache 
)
static
Returns true if MEM1 and MEM2 may alias.  TTAE_CACHE is used as a cache in
   tree_to_aff_combination_expand.   

References aff_comb_cannot_overlap_p(), aff_combination_add(), aff_combination_expand(), aff_combination_scale(), get_inner_reference_aff(), mem_ref::mem, ao_ref_s::ref, and refs_may_alias_p_1().

Referenced by refs_independent_p().

static void memref_free ( )
static
A function to free the mem_ref object OBJ.   

References mem_ref::accesses_in_loop, and free().

Referenced by tree_ssa_lim_finalize().

static unsigned int move_computations ( )
static
enum move_pos movement_possibility ( )
If it is possible to hoist the statement STMT unconditionally,
   returns MOVE_POSSIBLE.
   If it is possible to hoist the statement STMT, but we must avoid making
   it executed if it would not be executed in the original program (e.g.
   because it may trap), return MOVE_PRESERVE_EXECUTION.
   Otherwise return MOVE_IMPOSSIBLE.   

References dump_file, gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_single_p(), gimple_call_lhs(), gimple_could_trap_p(), gimple_get_lhs(), gimple_has_side_effects(), gimple_has_volatile_ops(), gimple_in_transaction(), gimple_phi_num_args(), gimple_phi_result(), gimple_vdef(), is_gimple_assign(), is_gimple_call(), is_global_var(), MOVE_IMPOSSIBLE, MOVE_POSSIBLE, MOVE_PRESERVE_EXECUTION, print_generic_expr(), stmt_could_throw_p(), stmt_ends_bb_p(), and virtual_operand_p().

static bool nonpure_call_p ( )
static
Returns true if STMT is a call that has side effects.   

References gimple_has_side_effects().

Referenced by determine_invariantness_stmt(), and fill_always_executed_in().

static struct loop* outermost_indep_loop ( )
staticread
Finds the outermost loop between OUTER and LOOP in that the memory reference
   REF is independent.  If REF is not independent in LOOP, NULL is returned
   instead.   

References bitmap_bit_p(), loop_depth(), loop::num, ref_indep_loop_p(), mem_ref::stored, and superloop_at_depth().

Referenced by determine_max_movement().

static struct loop* outermost_invariant_loop ( )
staticread
Suppose that operand DEF is used inside the LOOP.  Returns the outermost
   loop to that we could move the expression using DEF if it did not have
   other operands, i.e. the outermost loop enclosing LOOP in that the value
   of DEF is invariant.   

References find_common_loop(), get_lim_data(), gimple_bb(), is_gimple_min_invariant(), loop_depth(), basic_block_def::loop_father, loop_outer(), lim_aux_data::max_loop, and superloop_at_depth().

Referenced by add_dependency(), determine_invariantness_stmt(), may_move_till(), and rewrite_bittest().

static void record_dep_loop ( )
static
Mark REF dependent on stores or loads (according to STORED_P) in LOOP
   and its super-loops.   

References bitmap_set_bit(), mem_ref::dep_loop, loop_outer(), and loop::num.

Referenced by ref_indep_loop_p_2().

static void record_mem_ref_loc ( )
static
Records memory reference location *LOC in LOOP to the memory reference
   description REF.  The reference occurs in statement STMT.   

References mem_ref::accesses_in_loop, loop::num, mem_ref_loc::ref, and mem_ref_loc::stmt.

Referenced by gather_mem_refs_stmt().

static bool ref_always_accessed_p ( )
static
Returns true if REF is always accessed in LOOP.  If STORED_P is true
   make sure REF is always stored to in LOOP.   

References ao_ref_base(), for_all_locs_in_loop(), and mem_ref::mem.

Referenced by can_sm_ref_p().

static bool ref_indep_loop_p ( struct loop ,
mem_ref_p   
)
static
static bool ref_indep_loop_p ( )
static
Returns true if REF is independent on all other memory references in
   LOOP.   

References ref_indep_loop_p_2().

static bool ref_indep_loop_p_1 ( )
static
Returns true if REF is independent on all other memory references in
   LOOP.   

References bitmap_bit_p(), memory_accesses, loop::num, and refs_independent_p().

Referenced by ref_indep_loop_p_2().

static bool ref_indep_loop_p_2 ( )
static
Returns true if REF is independent on all other memory references in
   LOOP.  Wrapper over ref_indep_loop_p_1, caching its results.   

References bitmap_bit_p(), bitmap_set_bit(), mem_ref::dep_loop, dump_file, dump_flags, mem_ref::id, mem_ref::indep_loop, loop::inner, loop::next, loop::num, record_dep_loop(), ref_indep_loop_p_1(), and mem_ref::stored.

Referenced by ref_indep_loop_p().

static bool refs_independent_p ( )
static
Returns true if REF1 and REF2 are independent.   

References dump_file, dump_flags, mem_ref::id, mem_refs_may_alias_p(), and memory_accesses.

Referenced by ref_indep_loop_p_1().

static void rewrite_mem_refs ( )
static
Rewrites all references to REF in LOOP by variable TMP_VAR.   

References for_all_locs_in_loop().

Referenced by execute_sm().

static gimple rewrite_reciprocal ( )
static
static void set_level ( )
static
Suppose that some statement in ORIG_LOOP is hoisted to the loop LEVEL,
   and that one of the operands of this statement is computed by STMT.
   Ensure that STMT (together with all the statements that define its
   operands) is hoisted at least out of the loop LEVEL.   

References lim_aux_data::depends, find_common_loop(), flow_loop_nested_p(), get_lim_data(), gimple_bb(), basic_block_def::loop_father, loop_outer(), lim_aux_data::max_loop, and lim_aux_data::tgt_loop.

Referenced by force_move_till_op(), and set_profitable_level().

static void set_profitable_level ( )
static
Determines an outermost loop from that we want to hoist the statement STMT.
   For now we chose the outermost possible loop.  TODO -- use profiling
   information to set it more sanely.   

References get_lim_data(), lim_aux_data::max_loop, and set_level().

Referenced by determine_invariantness_stmt().

static tree* simple_mem_ref_in_stmt ( )
static
If there is a simple load or store to a memory reference in STMT, returns
   the location of the memory reference, and sets IS_STORE according to whether
   it is a store or load.  Otherwise, returns NULL.   

References gimple_assign_lhs_ptr(), gimple_assign_rhs1_ptr(), gimple_assign_single_p(), gimple_vdef(), gimple_vuse(), and is_gimple_min_invariant().

Referenced by gather_mem_refs_stmt(), and mem_ref_in_stmt().

static int sort_bbs_in_loop_postorder_cmp ( )
static
qsort sort function to sort blocks after their loop fathers postorder.   

References basic_block_def::loop_father, and loop::num.

Referenced by analyze_memory_references().

static unsigned stmt_cost ( )
static
Returns an estimate for a cost of statement STMT.  The values here
   are just ad-hoc constants, similar to costs for inlining.   

References BUILT_IN_NORMAL, gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_call_fndecl(), gimple_references_memory_p(), and is_gimple_call().

Referenced by determine_max_movement().

static void store_motion ( )
static
Try to perform store motion for all memory references modified inside
   loops.   

References gsi_commit_edge_inserts(), loop::inner, loop::next, and store_motion_loop().

Referenced by gate_rtl_store_motion(), and tree_ssa_lim().

static void store_motion_loop ( )
static
Try to perform store motion for all memory references modified inside
   LOOP.  SM_EXECUTED is the bitmap of the memory references for that
   store motion was executed in one of the outer loops.   

References bitmap_and_compl_into(), bitmap_ior_into(), loop::exits, find_refs_for_sm(), get_loop_exit_edges(), hoist_memory_references(), loop::inner, loop_suitable_for_sm(), and loop::next.

Referenced by store_motion().

unsigned int tree_ssa_lim ( void  )
Moves invariants from loops.  Only "expensive" invariants are moved out --
   i.e. those that are likely to be win regardless of the register pressure.   

References analyze_memory_references(), determine_invariantness(), fill_always_executed_in(), move_computations(), store_motion(), tree_ssa_lim_finalize(), and tree_ssa_lim_initialize().

Referenced by tree_ssa_loop_im().

static void tree_ssa_lim_finalize ( )
static
static void tree_ssa_lim_initialize ( )
static
Compute the global information needed by the loop invariant motion pass.   

References alloc_aux_for_edges(), bitmap_obstack_initialize(), cfun, compute_transaction_bits(), mem_ref_alloc(), memory_accesses, number_of_loops(), and pointer_map_create().

Referenced by tree_ssa_lim().


Variable Documentation

vec<bitmap_head> all_refs_stored_in_loop
unsigned* bb_loop_postorder
static
struct pointer_map_t* lim_aux_data_map
static
Maps statements to their lim_aux_data.   
bitmap_obstack lim_bitmap_obstack
static
Obstack for the bitmaps in the above data structures.   
char lsm_tmp_name[MAX_LSM_NAME_LENGTH+1]
static

Referenced by get_lsm_tmp_name().

int lsm_tmp_name_length
static

Referenced by lsm_tmp_name_add().

vec<bitmap_head> refs_in_loop
vec<mem_ref_p> refs_list
vec<bitmap_head> refs_stored_in_loop
struct pointer_map_t* ttae_cache