GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "sbitmap.h"
#include "selftest.h"
Typedefs | |
typedef SBITMAP_ELT_TYPE * | sbitmap_ptr |
typedef const SBITMAP_ELT_TYPE * | const_sbitmap_ptr |
Variables | |
static const unsigned char | popcount_table [] |
typedef const SBITMAP_ELT_TYPE* const_sbitmap_ptr |
typedef SBITMAP_ELT_TYPE* sbitmap_ptr |
Simple bitmaps. Copyright (C) 1999-2024 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
bool bitmap_and | ( | sbitmap | dst, |
const_sbitmap | a, | ||
const_sbitmap | b ) |
Set DST to be (A and B). Return nonzero if any change is made.
References a, ap, b, bitmap_check_sizes(), changed, simple_bitmap_def::elms, i, SBITMAP_ELT_TYPE, and simple_bitmap_def::size.
void bitmap_and_compl | ( | sbitmap | dst, |
const_sbitmap | a, | ||
const_sbitmap | b ) |
Set the bits in DST to be the difference between the bits in A and the bits in B. i.e. dst = a & (~b).
References a, ap, b, bitmap_check_sizes(), simple_bitmap_def::elms, gcc_assert, i, and simple_bitmap_def::size.
bool bitmap_and_or | ( | sbitmap | dst, |
const_sbitmap | a, | ||
const_sbitmap | b, | ||
const_sbitmap | c ) |
Set DST to be (A and (B or C)). Return nonzero if any change is made.
References a, ap, b, bitmap_check_sizes(), changed, simple_bitmap_def::elms, i, SBITMAP_ELT_TYPE, and simple_bitmap_def::size.
Referenced by compute_earliest(), and compute_farthest().
bool bitmap_bit_in_range_p | ( | const_sbitmap | bmap, |
unsigned int | start, | ||
unsigned int | end ) |
Return TRUE if any bit between START and END inclusive is set within the simple bitmap BMAP. Return FALSE otherwise.
References bitmap_check_index(), simple_bitmap_def::elms, end(), gcc_checking_assert, SBITMAP_ELT_BITS, and SBITMAP_ELT_TYPE.
Referenced by live_bytes_read().
void bitmap_clear | ( | sbitmap | bmap | ) |
Zero all elements in a bitmap.
References simple_bitmap_def::elms, and sbitmap_size_bytes().
Referenced by bitmap_vector_clear().
void bitmap_clear_range | ( | sbitmap | bmap, |
unsigned int | start, | ||
unsigned int | count ) |
Clear COUNT bits from START in BMAP.
References bitmap_check_index(), count, simple_bitmap_def::elms, SBITMAP_ELT_BITS, and SBITMAP_ELT_TYPE.
void bitmap_copy | ( | sbitmap | dst, |
const_sbitmap | src ) |
Copy sbitmap SRC to DST.
References simple_bitmap_def::elms, gcc_checking_assert, SBITMAP_ELT_TYPE, and simple_bitmap_def::size.
unsigned int bitmap_count_bits | ( | const_sbitmap | bmap | ) |
Count and return the number of bits set in the bitmap BMAP.
References count, simple_bitmap_def::elms, i, sbitmap_popcount(), and simple_bitmap_def::size.
bool bitmap_empty_p | ( | const_sbitmap | bmap | ) |
Return true if the bitmap is empty.
References simple_bitmap_def::elms, i, and simple_bitmap_def::size.
bool bitmap_equal_p | ( | const_sbitmap | a, |
const_sbitmap | b ) |
Determine if a == b.
References a, b, bitmap_check_sizes(), and SBITMAP_ELT_TYPE.
int bitmap_first_set_bit | ( | const_sbitmap | bmap | ) |
Return number of first bit set in the bitmap, -1 if none.
References EXECUTE_IF_SET_IN_BITMAP.
bool bitmap_intersect_p | ( | const_sbitmap | a, |
const_sbitmap | b ) |
bool bitmap_ior | ( | sbitmap | dst, |
const_sbitmap | a, | ||
const_sbitmap | b ) |
Set DST to be (A or B)). Return nonzero if any change is made.
References a, ap, b, bitmap_check_sizes(), changed, simple_bitmap_def::elms, i, SBITMAP_ELT_TYPE, and simple_bitmap_def::size.
bool bitmap_ior_and_compl | ( | sbitmap | dst, |
const_sbitmap | a, | ||
const_sbitmap | b, | ||
const_sbitmap | c ) |
Set DST to be A union (B - C). DST = A | (B & ~C). Returns true if any change is made.
References a, ap, b, bitmap_check_sizes(), changed, simple_bitmap_def::elms, i, SBITMAP_ELT_TYPE, and simple_bitmap_def::size.
int bitmap_last_set_bit | ( | const_sbitmap | bmap | ) |
Return number of last bit set in the bitmap, -1 if none.
References simple_bitmap_def::elms, i, SBITMAP_ELT_BITS, SBITMAP_ELT_TYPE, and simple_bitmap_def::size.
void bitmap_not | ( | sbitmap | dst, |
const_sbitmap | src ) |
Set bitmap DST to the bitwise negation of the bitmap SRC.
References bitmap_check_sizes(), simple_bitmap_def::elms, i, simple_bitmap_def::n_bits, SBITMAP_ELT_BITS, SBITMAP_ELT_TYPE, and simple_bitmap_def::size.
Referenced by compute_earliest(), compute_farthest(), and compute_pre_data().
void bitmap_ones | ( | sbitmap | bmap | ) |
Set all elements in a bitmap to ones.
References simple_bitmap_def::elms, simple_bitmap_def::n_bits, SBITMAP_ELT_BITS, SBITMAP_ELT_TYPE, sbitmap_size_bytes(), and simple_bitmap_def::size.
Referenced by bitmap_intersection_of_preds(), bitmap_intersection_of_succs(), bitmap_vector_ones(), compute_laterin(), compute_nearerout(), dse_step3(), init_live_subregs(), lra(), reload(), tree_transform_and_unroll_loop(), try_peel_loop(), try_unroll_loop_completely(), undistribute_bitref_for_vector(), unroll_loop_constant_iterations(), and unroll_loop_runtime_iterations().
bool bitmap_or_and | ( | sbitmap | dst, |
const_sbitmap | a, | ||
const_sbitmap | b, | ||
const_sbitmap | c ) |
Set DST to be (A or (B and C)). Return nonzero if any change is made.
References a, ap, b, bitmap_check_sizes(), changed, simple_bitmap_def::elms, i, SBITMAP_ELT_TYPE, and simple_bitmap_def::size.
Referenced by compute_antinout_edge(), and compute_code_hoist_vbeinout().
void bitmap_set_range | ( | sbitmap | bmap, |
unsigned int | start, | ||
unsigned int | count ) |
Set COUNT bits from START in BMAP.
References bitmap_check_index(), count, simple_bitmap_def::elms, SBITMAP_ELT_BITS, and SBITMAP_ELT_TYPE.
bool bitmap_subset_p | ( | const_sbitmap | a, |
const_sbitmap | b ) |
Return nonzero if A is a subset of B.
References a, ap, b, bitmap_check_sizes(), and i.
Referenced by disqualify_problematic_components().
void bitmap_vector_clear | ( | sbitmap * | bmap, |
unsigned int | n_vecs ) |
Zero a vector of N_VECS bitmaps.
References bitmap_clear(), and i.
Referenced by build_store_vectors(), compute_code_hoist_vbeinout(), compute_local_properties(), compute_local_properties(), compute_pre_data(), condcov::condcov(), oacc_do_neutering(), pre_edge_insert(), pre_edge_lcm_avs(), and pre_edge_rev_lcm().
void bitmap_vector_ones | ( | sbitmap * | bmap, |
unsigned int | n_vecs ) |
Set a vector of N_VECS bitmaps to ones.
References bitmap_ones(), and i.
Referenced by compute_antinout_edge(), compute_available(), compute_laterin(), compute_local_properties(), compute_nearerout(), and gcse_after_reload_main().
bool bitmap_xor | ( | sbitmap | dst, |
const_sbitmap | a, | ||
const_sbitmap | b ) |
Set DST to be (A xor B)). Return nonzero if any change is made.
References a, ap, b, bitmap_check_sizes(), changed, simple_bitmap_def::elms, i, SBITMAP_ELT_TYPE, and simple_bitmap_def::size.
DEBUG_FUNCTION void debug | ( | simple_bitmap_def & | ref | ) |
References dump_bitmap_file().
DEBUG_FUNCTION void debug | ( | simple_bitmap_def * | ptr | ) |
References debug.
DEBUG_FUNCTION void debug_bitmap | ( | const_sbitmap | bmap | ) |
References dump_bitmap_file().
DEBUG_FUNCTION void debug_raw | ( | simple_bitmap_def & | ref | ) |
References dump_bitmap().
Referenced by debug_raw().
DEBUG_FUNCTION void debug_raw | ( | simple_bitmap_def * | ptr | ) |
References debug_raw().
void dump_bitmap | ( | FILE * | file, |
const_sbitmap | bmap ) |
References simple_bitmap_def::elms, i, simple_bitmap_def::n_bits, SBITMAP_ELT_BITS, SBITMAP_ELT_TYPE, and simple_bitmap_def::size.
Referenced by debug_raw(), and dump_bitmap_vector().
void dump_bitmap_file | ( | FILE * | file, |
const_sbitmap | bmap ) |
References bitmap_bit_p, i, and simple_bitmap_def::n_bits.
Referenced by compute_code_hoist_vbeinout(), debug(), debug_bitmap(), and remove_unreachable_handlers().
void dump_bitmap_vector | ( | FILE * | file, |
const char * | title, | ||
const char * | subtitle, | ||
sbitmap * | bmaps, | ||
int | n_maps ) |
References dump_bitmap(), and i.
Referenced by build_store_vectors(), pre_edge_lcm_avs(), and pre_edge_rev_lcm().
sbitmap sbitmap_alloc | ( | unsigned int | n_elms | ) |
Bitmap manipulation routines.
Allocate a simple bitmap of N_ELMS bits.
References simple_bitmap_def::n_bits, SBITMAP_ELT_TYPE, SBITMAP_SET_SIZE, and simple_bitmap_def::size.
Referenced by build_pred_graph(), cse_main(), expand_call(), init_alias_analysis(), init_dce(), init_live_subregs(), init_separate_shrink_wrap(), init_update_ssa(), lra(), make_edges(), mark_reachable_handlers(), multiplier_allowed_in_address_p(), perform_tree_ssa_dce(), should_hoist_expr_to_dom(), tail_duplicate(), tree_dce_init(), undistribute_bitref_for_vector(), and vt_find_locations().
|
static |
References a, HOST_BITS_PER_WIDEST_FAST_INT, i, and popcount_table.
Referenced by bitmap_count_bits().
Re-allocate a simple bitmap of N_ELMS bits. New storage is uninitialized.
References simple_bitmap_def::n_bits, SBITMAP_ELT_TYPE, SBITMAP_SET_SIZE, sbitmap_size_bytes(), and simple_bitmap_def::size.
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.
References simple_bitmap_def::elms, simple_bitmap_def::n_bits, SBITMAP_ELT_BITS, SBITMAP_ELT_TYPE, SBITMAP_SET_SIZE, sbitmap_size_bytes(), and simple_bitmap_def::size.
Referenced by add_new_name_mapping(), lra_push_insn_1(), and mark_bb_seen().
|
inlinestatic |
Return the size in bytes of a bitmap MAP.
References map, and SBITMAP_ELT_TYPE.
Referenced by bitmap_clear(), bitmap_ones(), sbitmap_realloc(), and sbitmap_resize().
sbitmap * sbitmap_vector_alloc | ( | unsigned int | n_vecs, |
unsigned int | n_elms ) |
Allocate a vector of N_VECS bitmaps of N_ELMS bits.
References b, i, simple_bitmap_def::n_bits, offset, SBITMAP_ELT_TYPE, SBITMAP_SET_SIZE, simple_bitmap_def::size, and y.
Referenced by alloc_code_hoist_mem(), alloc_cprop_mem(), alloc_pre_mem(), build_store_vectors(), gcse_after_reload_main(), oacc_do_neutering(), pre_edge_insert(), pre_edge_lcm(), pre_edge_lcm_avs(), and pre_edge_rev_lcm().
|
static |
Table of number of set bits in a character, indexed by value of char.
Referenced by sbitmap_popcount().