GCC Middle and Back End API Reference
bitmap.c File Reference

Data Structures

struct  bitmap_descriptor_d
struct  loc
struct  bitmap_desc_hasher
struct  output_info

Typedefs

typedef struct
bitmap_descriptor_d
bitmap_descriptor
typedef struct
bitmap_descriptor_d
const_bitmap_descriptor

Functions

static bitmap_descriptor get_bitmap_descriptor ()
void bitmap_register ()
static void register_overhead ()
static void bitmap_elem_to_freelist (bitmap, bitmap_element *)
static void bitmap_element_free (bitmap, bitmap_element *)
static bitmap_elementbitmap_element_allocate (bitmap)
static int bitmap_element_zerop (const bitmap_element *)
static void bitmap_element_link (bitmap, bitmap_element *)
static bitmap_elementbitmap_elt_insert_after (bitmap, bitmap_element *, unsigned int)
static void bitmap_elt_clear_from (bitmap, bitmap_element *)
static bitmap_elementbitmap_find_bit (bitmap, unsigned int)
static void bitmap_elem_to_freelist ()
static void bitmap_element_free ()
static bitmap_elementbitmap_element_allocate ()
void bitmap_elt_clear_from ()
void bitmap_clear ()
void bitmap_obstack_initialize ()
void bitmap_obstack_release ()
bitmap bitmap_obstack_alloc_stat ()
bitmap bitmap_gc_alloc_stat ()
void bitmap_obstack_free ()
static int bitmap_element_zerop ()
static void bitmap_element_link ()
static bitmap_elementbitmap_elt_insert_after ()
void bitmap_copy ()
static bitmap_elementbitmap_find_bit ()
bool bitmap_clear_bit ()
bool bitmap_set_bit ()
int bitmap_bit_p ()
static unsigned long bitmap_popcount ()
unsigned long bitmap_count_bits ()
bool bitmap_single_bit_set_p ()
unsigned bitmap_first_set_bit ()
unsigned bitmap_last_set_bit ()
void bitmap_and ()
bool bitmap_and_into ()
static bool bitmap_elt_copy (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev, const bitmap_element *src_elt, bool changed)
bool bitmap_and_compl ()
bool bitmap_and_compl_into ()
void bitmap_set_range ()
void bitmap_clear_range ()
void bitmap_compl_and_into ()
static bool bitmap_elt_ior (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev, const bitmap_element *a_elt, const bitmap_element *b_elt, bool changed)
bool bitmap_ior ()
bool bitmap_ior_into ()
void bitmap_xor ()
void bitmap_xor_into ()
bool bitmap_equal_p ()
bool bitmap_intersect_p ()
bool bitmap_intersect_compl_p ()
bool bitmap_ior_and_compl ()
bool bitmap_ior_and_compl_into ()
bool bitmap_ior_and_into ()
hashval_t bitmap_hash ()
DEBUG_FUNCTION void debug_bitmap_file ()
DEBUG_FUNCTION void debug_bitmap ()
DEBUG_FUNCTION void bitmap_print (FILE *file, const_bitmap head, const char *prefix, const char *suffix)
int print_statistics ()
void dump_bitmap_statistics ()
DEBUG_FUNCTION void debug ()

Variables

static int next_bitmap_desc_id = 0
static vec< bitmap_descriptorbitmap_descriptors
static hash_table
< bitmap_desc_hasher
bitmap_desc_hash
bitmap_element bitmap_zero_bits
bitmap_obstack bitmap_default_obstack
static int bitmap_default_obstack_depth
static bitmap_elementbitmap_ggc_free
static const unsigned char popcount_table []

Typedef Documentation


Function Documentation

void bitmap_and ( )
bool bitmap_and_compl ( )
   DST = A & ~B  
             Matching elts, generate A & ~B.  
     Ensure that dst->current is valid.  

Referenced by add_backarc_to_ddg(), calculate_order_params(), compute_out(), and verify_partial_schedule().

bool bitmap_and_compl_into ( )
   A &= ~B. Returns true if A changes 
             Matching elts, generate A &= ~B.  

References bitmap_element_allocate(), bitmap_element_link(), and bitmap_element_def::indx.

Referenced by df_simulate_one_insn_forwards(), dse_step2_init(), dse_step2_nospill(), ref_indep_loop_p_2(), and same_succ_flush_bb().

bool bitmap_and_into ( )
   A &= B.  Return true if A changed.  
             Matching elts, generate A &= B.  

References bitmap_elt_insert_after(), bitmap_element_def::bits, changed, bitmap_element_def::indx, and memcpy().

Referenced by get_stored_val(), and union_static_var_sets().

int bitmap_bit_p ( )
   Return whether a bit is set within a bitmap.  

References bitmap_popcount(), bitmap_element_def::bits, count, bitmap_head_def::first, and bitmap_element_def::next.

Referenced by add_label_notes(), add_mem_for_addr(), add_new_name_mapping(), bitmap_insert_into_set_1(), bitmap_set_and(), bucket_allocno_compare_func(), cfg_blocks_empty_p(), check_va_list_escapes(), child_would_conflict_in_lacc(), compute_builtin_object_size(), cond_expr_object_size(), dead_debug_add(), dead_debug_global_insert(), delete_allocno_from_bucket(), determine_common_wider_type(), df_create_unused_note(), df_live_verify_solution_end(), df_rd_bb_local_compute_process_def(), df_remove_dead_eq_notes(), df_set_bb_dirty(), df_word_lr_add_problem(), do_coloring(), dse_step3(), dump_live_info(), dump_split_point(), dump_tm_memopt_sets(), dup_block_and_redirect(), elim_unvisited_predecessor(), eliminate_build(), find_identical_invariants(), find_if_case_2(), find_matching_predicate_in_rest_chains(), find_nodes_on_paths(), find_replaceable_in_bb(), find_src_set_src(), find_va_list_reference(), foll_in_subgraph(), gather_region_statistics(), get_constant_value_id(), get_local_debug_decl(), get_rtx_for_ssa_name(), implicit_set_cond_p(), initialize_root_vars_lm(), insert_store(), invalidate_insn_data_regno_info(), ipa_tm_create_version(), ipa_tm_scan_calls_transaction(), ipa_tm_scan_irr_block(), ipa_uninstrument_transaction(), link_roots(), live_track_remove_partition(), lower_omp_target(), lra_push_insn_and_update_insn_regno_info(), lra_push_insn_by_uid(), make_pass_build_ssa(), make_pass_df_finish(), mark_ref_regs(), mark_regno_birth_or_death(), mark_use_interesting(), move_op_on_enter(), non_rewritable_mem_ref_base(), one_pre_gcse_pass(), phi_translate(), pre_and_rev_post_order_compute(), predict_paths_for_bb(), print_partial_schedule(), record_uses(), reg_classes_intersect_p(), register_edge_assert_for_1(), remap_decl_1(), remove_eh_landing_pad(), remove_pseudos(), reorder_loops(), reset_debug_uses(), resolve_reg_notes(), setup_reg_equiv(), split_function(), stmt_kills_ref_p_1(), substitute_pseudo(), thread_prologue_and_epilogue_insns(), tm_memopt_accumulate_memops(), try_replace_reg(), unchecked_make_edge(), undo_transformations(), unite_pointer_equivalences(), update_call_expr(), and vect_supported_load_permutation_p().

void bitmap_clear_range ( )
   Clear COUNT bits from START in HEAD.  
     If bitmap_find_bit returns zero, the current is the closest block
     to the result.  If the current is less than first index, find the
     next one.  Otherwise, just set elt to be current.  
           Get rid of the entire elt and go to the next one.  
             Going to have to knock out some bits in this elt.  
                 The first bit to turn off is somewhere inside this
                 elt.  
                 This mask should have 1s in all bits >= start position. 
                 The first bit to turn off is below this start of this elt.  
                 The last bit to turn off is beyond this elt.  
                 The last bit to turn off is inside to this elt.  
                 The last mask should have 1s below the end bit.  
             Check to see if there are any bits left.  

Referenced by df_rd_bb_local_compute_process_def(), and pt_solution_set_var().

void bitmap_compl_and_into ( )
   A = ~A & B. 
             A is before B.  Remove A 
             B is before A.  Copy B. 
             Matching elts, generate A = ~A & B.  

References bitmap_element_def::bits.

unsigned long bitmap_count_bits ( )
   Count the number of bits set in the bitmap, and return it.  
             Note that popcountl matches BITMAP_WORD in type, so the actual size
         of BITMAP_WORD is not material.  
static void bitmap_elem_to_freelist ( bitmap  ,
bitmap_element  
)
static
static void bitmap_elem_to_freelist ( )
inlinestatic
   Add ELEM to the appropriate freelist.  

References bitmap_ggc_free, and bitmap_element_def::prev.

static bitmap_element* bitmap_element_allocate ( bitmap  )
static
static bitmap_element* bitmap_element_allocate ( )
inlinestatic
   Allocate a bitmap element.  The bits are cleared, but nothing else is.  
           Use up the inner list first before looking at the next
           element of the outer list.  
              Inner list was just a singleton.  
           Use up the inner list first before looking at the next
           element of the outer list.  
              Inner list was just a singleton.  
static void bitmap_element_free ( bitmap  ,
bitmap_element  
)
static

Referenced by bitmap_and().

static void bitmap_element_free ( )
inlinestatic
   Free a bitmap element.  Since these are allocated off the
   bitmap_obstack, "free" actually means "put onto the freelist".  
     Since the first thing we try is to insert before current,
     make current the next entry in preference to the previous.  

References bitmap_head_def::current, bitmap_element_def::indx, and bitmap_head_def::indx.

static void bitmap_element_link ( bitmap  ,
bitmap_element  
)
static

Referenced by bitmap_and_compl_into().

static void bitmap_element_link ( )
inlinestatic
   Link the bitmap element into the current bitmap linked list.  
     If this is the first and only element, set it in.  
     If this index is less than that of the current element, it goes someplace
     before the current element.  
     Otherwise, it must go someplace after the current element.  
     Set up so this is the first element searched.  
static int bitmap_element_zerop ( const bitmap_element )
static
static int bitmap_element_zerop ( )
inlinestatic
   Return nonzero if all bits in an element are zero.  
static void bitmap_elt_clear_from ( bitmap  ,
bitmap_element  
)
static

Referenced by bitmap_and().

void bitmap_elt_clear_from ( )
   Remove ELT and all following elements from bitmap HEAD.  
     Put the entire list onto the free list in one operation. 

References bitmap_head_def::current, bitmap_element_def::indx, and bitmap_head_def::indx.

static bool bitmap_elt_copy ( bitmap  dst,
bitmap_element dst_elt,
bitmap_element dst_prev,
const bitmap_element src_elt,
bool  changed 
)
inlinestatic
   Insert an element equal to SRC_ELT after DST_PREV, overwriting DST_ELT
   if non-NULL.  CHANGED is true if the destination bitmap had already been
   changed; the new value of CHANGED is returned.  

References bitmap_elt_insert_after(), bitmap_element_def::bits, and bitmap_element_def::indx.

static bitmap_element* bitmap_elt_insert_after ( bitmap  ,
bitmap_element ,
unsigned  int 
)
static

Referenced by bitmap_and_into(), and bitmap_elt_copy().

static bitmap_element* bitmap_elt_insert_after ( )
static
   Insert a new uninitialized element into bitmap HEAD after element
   ELT.  If ELT is NULL, insert the element at the start.  Return the
   new element.  

References bitmap_clear(), bitmap_element_allocate(), bitmap_element_def::bits, bitmap_head_def::current, bitmap_head_def::first, bitmap_element_def::indx, bitmap_head_def::indx, memcpy(), bitmap_element_def::next, and bitmap_element_def::prev.

static bool bitmap_elt_ior ( bitmap  dst,
bitmap_element dst_elt,
bitmap_element dst_prev,
const bitmap_element a_elt,
const bitmap_element b_elt,
bool  changed 
)
inlinestatic
   Insert an element corresponding to A_ELT | B_ELT after DST_PREV,
   overwriting DST_ELT if non-NULL.  CHANGED is true if the destination bitmap
   had already been changed; the new value of CHANGED is returned.  
         Matching elts, generate A | B.  
         Copy a single element.  

Referenced by bitmap_intersect_p().

bool bitmap_equal_p ( )
   Return true if two bitmaps are identical.
   We do not bother with a check for pointer equality, as that never
   occurs in practice.  

References bitmap_element_def::bits, bitmap_element_def::indx, and bitmap_element_def::next.

Referenced by calculate_order_params(), df_get_eh_block_artificial_uses(), df_live_free(), df_live_verify_solution_end(), df_record_entry_block_defs(), and union_static_var_sets().

static bitmap_element* bitmap_find_bit ( bitmap  ,
unsigned  int 
)
static
static bitmap_element* bitmap_find_bit ( )
inlinestatic
   Find a bitmap element that would hold a bitmap's bit.
   Update the `current' field even if we can't find an element that
   would hold the bitmap's bit to make eventual allocation
   faster.  
     This bitmap has more than one element, and we're going to look
     through the elements list.  Count that as a search.  
       INDX is beyond head->indx.  Search from head->current
       forward.  
       INDX is less than head->indx and closer to head->indx than to
       0.  Search from head->current backward.  
       INDX is less than head->indx and closer to 0 than to
       head->indx.  Search from head->first forward.  
     `element' is the nearest to the one we want.  If it's not the one we
     want, the one we want doesn't exist.  
unsigned bitmap_first_set_bit ( )
   Return the bit number of the first set bit in the bitmap.  The
   bitmap must be non-empty.  
     Binary search for the first set bit.  

Referenced by build_and_add_sum(), build_succ_graph(), prepare_block_for_update(), and update_dep_bb().

bitmap bitmap_gc_alloc_stat ( )
   Create a new GCd bitmap.  
hashval_t bitmap_hash ( )
   Compute hash of bitmap (for purposes of hashing).  

Referenced by do_complex_constraint(), and update_dep_bb().

bool bitmap_intersect_compl_p ( )
   Return true if A AND NOT B is not empty.  
bool bitmap_intersect_p ( )
   Return true if A AND B is not empty.  

References bitmap_elt_ior(), bitmap_element_def::indx, and bitmap_element_def::next.

Referenced by df_simulate_one_insn_forwards().

bool bitmap_ior ( )
bool bitmap_ior_and_compl ( )
   DST = A | (FROM1 & ~FROM2).  Return true if DST changes.  
     Special cases.  We don't bother checking for bitmap_equal_p (b, kill).  

Referenced by compute_available(), and compute_kill().

bool bitmap_ior_and_compl_into ( )
   A |= (FROM1 & ~FROM2).  Return true if A changes.  

References bitmap_head_def::current, bitmap_head_def::first, bitmap_head_def::indx, and bitmap_element_def::next.

bool bitmap_ior_and_into ( )
   A |= (B & C).  Return true if A changes.  
         Find a common item of B and C.  
         Now find a place to insert AND_ELT.  
             If A lagged behind B/C, we advanced it so loop once more.  
unsigned bitmap_last_set_bit ( )
   Return the bit number of the first set bit in the bitmap.  The
   bitmap must be non-empty.  
     Hopefully this is a twos-complement host...  
bitmap bitmap_obstack_alloc_stat ( )
   Create a new bitmap on an obstack.  If BIT_OBSTACK is NULL, create
   it on the default bitmap obstack.  
void bitmap_obstack_free ( )
   Release an obstack allocated bitmap.  
void bitmap_obstack_initialize ( )
   Initialize a bitmap obstack.  If BIT_OBSTACK is NULL, initialize
   the default bitmap obstack.  

References bitmap_default_obstack, bitmap_obstack::elements, bitmap_obstack::heads, and bitmap_obstack::obstack.

Referenced by df_rd_alloc(), find_uses_to_rename(), mark_artificial_uses(), split_live_ranges_for_shrink_wrap(), and update_lives().

void bitmap_obstack_release ( )
   Release the memory from a bitmap obstack.  If BIT_OBSTACK is NULL,
   release the default bitmap obstack.  

Referenced by tm_region_init_1().

static unsigned long bitmap_popcount ( )
static
     Just do this the table way for now  

References bitmap_element_def::bits.

Referenced by bitmap_bit_p().

DEBUG_FUNCTION void bitmap_print ( FILE *  file,
const_bitmap  head,
const char *  prefix,
const char *  suffix 
)
   Function to print out the contents of a bitmap.  Unlike debug_bitmap_file,
   it does not print anything but the bits.  

Referenced by df_clear_flags(), and dse_step3().

bool bitmap_set_bit ( )
   Set a single bit in a bitmap.  Return true if the bit changed.  

Referenced by add_exit_phis(), add_forwarder_blocks(), add_stack_var_conflict(), alloc_cprop_mem(), ask_dependency_caches(), build_access_from_expr_1(), build_and_add_sum(), build_succ_graph(), calculate_order_params(), check_forbidden_calls(), coalesce_partitions(), coalesced_pseudo_reg_slot_compare(), code_motion_path_driver_cleanup(), compute_always_reached(), compute_builtin_object_size(), compute_code_hoist_vbeinout(), compute_out(), compute_partial_antic_aux(), cond_expr_object_size(), constraint_expr_less(), create_component_ref_by_pieces(), create_outofssa_var_map(), debug_candidates(), delete_dead_store_insn(), determine_common_wider_type(), df_chain_remove_problem(), df_get_bb_info(), df_get_regular_block_artificial_uses(), df_live_alloc(), df_live_verify_solution_end(), df_live_verify_solution_start(), df_mark_reg(), df_note_add_problem(), df_rd_bb_local_compute_process_def(), df_set_bb_dirty(), df_set_dead_notes_for_mw(), df_simulate_find_defs(), dfs_enumerate_from(), dfs_find_deadend(), disqualify_ops_if_throwing_stmt(), do_goto_redirection(), do_sd_constraint(), dse_optimize_stmt(), dump_split_point(), dump_update_ssa(), dup_block_and_redirect(), eliminate_build(), emit_return_into_block(), eq_rename_map_elts(), fill_sons_in_loop(), find_arc(), find_decomposable_subregs(), find_exits(), find_identical_invariants(), find_matching_predicate_in_rest_chains(), find_nodes_on_paths(), find_predecessors(), find_refs_for_sm(), find_same_succ(), find_src_set_src(), finish_states(), free_chain_data(), free_code_hoist_mem(), free_cprop_mem(), free_ddg_all_sccs(), free_gcse_mem(), free_scc_info(), free_topo_info(), get_common_info(), get_continuation_for_phi(), get_free_alt_state(), inhibit_phi_insertion(), initialize_flags_in_bb(), insert_move_for_subreg(), insert_store(), invalidate_insn_data_regno_info(), ipa_reference_get_not_written_global(), ipa_tm_create_version(), ipa_tm_scan_calls_transaction(), ipa_uninstrument_transaction(), ira_create_object(), kill_expr(), loe_visit_block(), lra_setup_reg_renumber(), make_dependent_on_partition(), make_edges(), maybe_optimize_var(), merge_identical_invariants(), merge_node_constraints(), merge_pseudos(), move_op_on_enter(), new_live_track(), non_rewritable_mem_ref_base(), optimize_stmt(), partition_view_bitmap(), print_exprs(), print_insn_chains(), print_loop(), print_worklist(), propagate_rhs_into_lhs(), ref_indep_loop_p_1(), register_edge_assert_for(), register_edge_assert_for_1(), regstat_get_setjmp_crosses(), remove_pseudos(), remove_stmt_or_phi(), remove_uneccesary_loop_nodes_from_loop_tree(), rewrite_use_nonlinear_expr(), rtx_moveable_p(), same_phi_alternatives_1(), set_livein_block(), set_var_live_on_entry(), setup_reg_equiv(), setup_try_hard_regno_pseudos(), split_function(), ssa_conflicts_add_one(), stmt_kills_ref_p_1(), strlen_optimize_stmt(), thread_through_normal_block(), unchecked_make_edge(), update_lives(), update_profiling_info(), valid_in_sets(), vect_supported_load_permutation_p(), version_to_be_replaced_p(), vop_phi(), and vrp_operand_equal_p().

void bitmap_set_range ( )
   Set COUNT bits from START in HEAD.  
     If bitmap_find_bit returns zero, the current is the closest block
     to the result.  Otherwise, just use bitmap_element_allocate to
     ensure ELT is set; in the loop below, ELT == NULL means "insert
     at the end of the bitmap".  
             The first bit to turn on is somewhere inside this
             elt.  
             This mask should have 1s in all bits >= start position. 
             The first bit to turn on is below this start of this elt.  
             The last bit to turn on is beyond this elt.  
             The last bit to turn on is inside to this elt.  
             The last mask should have 1s below the end bit.  

Referenced by debug_candidates(), df_rd_bb_local_compute_process_def(), dump_insn_info(), and insert_save().

bool bitmap_single_bit_set_p ( )
   Return true if the bitmap has a single bit set.  Otherwise return
   false.  
     As there are no completely empty bitmap elements, a second one
     means we have more than one bit set.  
         Note that popcountl matches BITMAP_WORD in type, so the actual size
         of BITMAP_WORD is not material.  
void bitmap_xor ( )
   DST = A ^ B  
             Matching elts, generate A ^ B.  
             Copy a single element.  
     Ensure that dst->current is valid.  
void bitmap_xor_into ( )
   A ^= B 
             Copy b_elt.  
             Matching elts, generate A ^= B.  
DEBUG_FUNCTION void debug ( )
DEBUG_FUNCTION void debug_bitmap ( )
   Function to be called from the debugger to print the contents
   of a bitmap.  
DEBUG_FUNCTION void debug_bitmap_file ( )
   Debugging function to print out the contents of a bitmap.  
void dump_bitmap_statistics ( void  )
   Output per-bitmap memory usage statistics.  
static bitmap_descriptor get_bitmap_descriptor ( )
static
   For given file and line, return descriptor, create new if needed.  
int print_statistics ( )
   Called via hash_table::traverse.  Output bitmap descriptor pointed out by
   SLOT and update statistics.  
static void register_overhead ( )
static
   Account the overhead.  

Variable Documentation

int bitmap_default_obstack_depth
static
hash_table<bitmap_desc_hasher> bitmap_desc_hash
static
   Hashtable mapping bitmap names to descriptors.  
vec<bitmap_descriptor> bitmap_descriptors
static
   Vector mapping descriptor ids to descriptors.  
bitmap_element* bitmap_ggc_free
static

Referenced by bitmap_elem_to_freelist().

bitmap_element bitmap_zero_bits
   Global data 
int next_bitmap_desc_id = 0
static
   Next available unique id number for bitmap desciptors.  
const unsigned char popcount_table[]
static
Initial value:
{
0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8,
}
   Table of number of set bits in a character, indexed by value of char.