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

Typedefs

typedef SBITMAP_ELT_TYPE * sbitmap_ptr
typedef const SBITMAP_ELT_TYPE * const_sbitmap_ptr

Functions

static unsigned long sbitmap_elt_popcount (SBITMAP_ELT_TYPE)
static unsigned int sbitmap_size_bytes (const_sbitmap map)
static void sbitmap_verify_popcount ()
sbitmap sbitmap_alloc ()
sbitmap sbitmap_alloc_with_popcount ()
sbitmap sbitmap_resize ()
sbitmap sbitmap_realloc ()
sbitmapsbitmap_vector_alloc ()
void bitmap_copy ()
int bitmap_equal_p ()
bool bitmap_empty_p ()
void bitmap_clear ()
void bitmap_ones ()
void bitmap_vector_clear ()
void bitmap_vector_ones ()
bool bitmap_ior_and_compl ()
void bitmap_not ()
void bitmap_and_compl ()
bool bitmap_intersect_p ()
bool bitmap_and ()
bool bitmap_xor ()
bool bitmap_ior ()
bool bitmap_subset_p ()
bool bitmap_or_and ()
bool bitmap_and_or ()
int bitmap_first_set_bit ()
int bitmap_last_set_bit ()
void dump_bitmap ()
DEBUG_FUNCTION void debug_raw ()
void dump_bitmap_file ()
DEBUG_FUNCTION void debug_bitmap ()
DEBUG_FUNCTION void debug ()
void dump_bitmap_vector (FILE *file, const char *title, const char *subtitle, sbitmap *bmaps, int n_maps)
static unsigned long sbitmap_elt_popcount ()

Variables

static const unsigned char popcount_table []

Typedef Documentation

typedef const SBITMAP_ELT_TYPE* const_sbitmap_ptr
typedef SBITMAP_ELT_TYPE* sbitmap_ptr

Function Documentation

bool bitmap_and ( )
   Set DST to be (A and B).
   Return nonzero if any change is made.  

References simple_bitmap_def::elms, simple_bitmap_def::popcount, sbitmap_verify_popcount(), and simple_bitmap_def::size.

void bitmap_and_compl ( )
   Set the bits in DST to be the difference between the bits
   in A and the bits in B. i.e. dst = a & (~b).  
     A should be at least as large as DEST, to have a defined source.  
     If minuend is smaller, we simply pretend it to be zero bits, i.e.
     only copy the subtrahend into dest.  
     Now fill the rest of dest from A, if B was too short.
     This makes sense only when destination and A differ.  

References simple_bitmap_def::elms, and simple_bitmap_def::size.

bool bitmap_and_or ( )
   Set DST to be (A and (B or C)).
   Return nonzero if any change is made.  

References simple_bitmap_def::elms.

void bitmap_clear ( )
   Zero all elements in a bitmap.  
void bitmap_copy ( )
   Copy sbitmap SRC to DST.  

References simple_bitmap_def::elms, and simple_bitmap_def::size.

bool bitmap_empty_p ( )
int bitmap_equal_p ( )
int bitmap_first_set_bit ( )
   Return number of first bit set in the bitmap, -1 if none.  
bool bitmap_intersect_p ( )
   Return true if there are any bits set in A are also set in B.
   Return false otherwise.  
bool bitmap_ior ( )
   Set DST to be (A or B)).
   Return nonzero if any change is made.  
bool bitmap_ior_and_compl ( )
   Set DST to be A union (B - C).
   DST = A | (B & ~C).
   Returns true if any change is made.  

References simple_bitmap_def::elms, simple_bitmap_def::n_bits, simple_bitmap_def::popcount, and simple_bitmap_def::size.

int bitmap_last_set_bit ( )
   Return number of last bit set in the bitmap, -1 if none.  
void bitmap_not ( )
   Set bitmap DST to the bitwise negation of the bitmap SRC.  
     Zero all bits past n_bits, by ANDing dst with bitmap_ones.  

Referenced by prune_expressions().

void bitmap_ones ( )
   Set all elements in a bitmap to ones.  

References bitmap_clear().

Referenced by compute_dominance_frontiers_1(), and too_large().

bool bitmap_or_and ( )
   Set DST to be (A or (B and C)).
   Return nonzero if any change is made.  
bool bitmap_subset_p ( )
   Return nonzero if A is a subset of B.  

References simple_bitmap_def::elms, simple_bitmap_def::popcount, and simple_bitmap_def::size.

void bitmap_vector_clear ( )
   Zero a vector of N_VECS bitmaps.  

References changed, simple_bitmap_def::elms, simple_bitmap_def::popcount, and simple_bitmap_def::size.

Referenced by alloc_gcse_mem().

void bitmap_vector_ones ( )
   Set a vector of N_VECS bitmaps to ones.  

Referenced by alloc_gcse_mem().

bool bitmap_xor ( )
   Set DST to be (A xor B)).
   Return nonzero if any change is made.  

References simple_bitmap_def::elms, simple_bitmap_def::popcount, sbitmap_verify_popcount(), and simple_bitmap_def::size.

DEBUG_FUNCTION void debug ( )
DEBUG_FUNCTION void debug_bitmap ( )
DEBUG_FUNCTION void debug_raw ( )
void dump_bitmap ( )
void dump_bitmap_file ( )
void dump_bitmap_vector ( FILE *  file,
const char *  title,
const char *  subtitle,
sbitmap bmaps,
int  n_maps 
)

Referenced by compute_insert_delete().

sbitmap sbitmap_alloc_with_popcount ( )
   Allocate a simple bitmap of N_ELMS bits, and a popcount array.  

References sbitmap_size_bytes(), and simple_bitmap_def::size.

static unsigned long sbitmap_elt_popcount ( SBITMAP_ELT_TYPE  )
static
static unsigned long sbitmap_elt_popcount ( )
static
   Count the bits in an SBITMAP element A.  
     Just do this the table way for now  
sbitmap sbitmap_realloc ( )
   Re-allocate a simple bitmap of N_ELMS bits. New storage is uninitialized.  
sbitmap sbitmap_resize ( )
   Resize a simple bitmap BMAP to N_ELMS bits.  If increasing the
   size of BMAP, clear the new bits to zero if the DEF argument
   is zero, and set them to one otherwise.  
             Set the new bits if the original last element.  
             Clear the unused bit in the new last element.  
         Clear the surplus bits in the last word.  

Referenced by invalidate_insn_data_regno_info().

static unsigned int sbitmap_size_bytes ( const_sbitmap  map)
inlinestatic
   Return the size in bytes of a bitmap MAP.  

Referenced by bitmap_empty_p(), bitmap_equal_p(), and sbitmap_alloc_with_popcount().

sbitmap* sbitmap_vector_alloc ( )
   Allocate a vector of N_VECS bitmaps of N_ELMS bits.  
     Round up `vector_bytes' to account for the alignment requirements
     of an sbitmap.  One could allocate the vector-table and set of sbitmaps
     separately, but that requires maintaining two pointers or creating
     a cover struct to hold both pointers (so our result is still just
     one pointer).  Neither is a bad idea, but this is simpler for now.  
       Based on DEFAULT_ALIGNMENT computation in obstack.c.  

Referenced by compute_insert_delete(), free_modify_mem_tables(), lookup_set(), and pre_delete().

static void sbitmap_verify_popcount ( )
static
   This macro controls debugging that is as expensive as the
   operations it verifies.  
   #define BITMAP_DEBUGGING  
   Verify the population count of sbitmap A matches the cached value,
   if there is a cached value. 

Referenced by bitmap_and(), and bitmap_xor().


Variable Documentation

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.