20#ifndef TREE_SWITCH_CONVERSION_H
21#define TREE_SWITCH_CONVERSION_H
34#define PRINT_CASE(f,c) print_generic_expr (f, c)
90 return w.to_uhwi () + 1;
297 static inline unsigned int case_values_threshold (
void);
300 static inline bool is_enabled (
void);
415 static bool is_beneficial (
unsigned count,
unsigned uniq);
453 static const int m_max_case_bit_tests = 3;
487 return m_left !=
NULL || m_right !=
NULL;
529#ifndef ASM_OUTPUT_ADDR_DIFF_ELT
557 static int cmp (
const void *
p1,
const void *
p2);
#define FOR_EACH_EDGE(EDGE, ITER, EDGE_VEC)
Definition basic-block.h:487
static bbro_basic_block_data * bbd
Definition bb-reorder.cc:177
Definition alloc-pool.h:482
Definition profile-count.h:147
Definition tree-switch-conversion.h:365
bool m_handles_entire_switch
Definition tree-switch-conversion.h:449
static bool is_enabled(void)
Definition tree-switch-conversion.h:443
bit_test_cluster(vec< cluster * > &clusters, unsigned start, unsigned end, bool handles_entire_switch)
Definition tree-switch-conversion.h:368
cluster_type get_type() final override
Definition tree-switch-conversion.h:375
static bool can_be_handled(unsigned HOST_WIDE_INT range, unsigned uniq)
Definition tree-switch-conversion.h:547
wide_int mask
Definition tree-switch-conversion.h:549
basic_block target_bb
Definition tree-switch-conversion.h:550
tree label
Definition tree-switch-conversion.h:551
int bits
Definition tree-switch-conversion.h:552
profile_probability prob
Definition tree-switch-conversion.h:553
static int cmp(const void *p1, const void *p2)
Definition tree-switch-conversion.cc:1571
Definition tree-switch-conversion.h:479
case_tree_node * m_right
Definition tree-switch-conversion.h:494
case_tree_node * m_parent
Definition tree-switch-conversion.h:497
bool has_child()
Definition tree-switch-conversion.h:485
case_tree_node * m_left
Definition tree-switch-conversion.h:491
cluster * m_c
Definition tree-switch-conversion.h:500
case_tree_node()
Definition tree-switch-conversion.h:504
Definition tree-switch-conversion.h:48
profile_probability m_default_prob
Definition tree-switch-conversion.h:107
virtual void dump(FILE *f, bool details=false)=0
static unsigned HOST_WIDE_INT get_range(tree low, tree high)
Definition tree-switch-conversion.h:85
virtual void emit(tree, tree, tree, basic_block, location_t)=0
cluster()
Definition tree-switch-conversion.h:111
virtual bool is_single_value_p()
Definition tree-switch-conversion.h:78
virtual tree get_high()=0
profile_probability m_prob
Definition tree-switch-conversion.h:100
tree m_case_label_expr
Definition tree-switch-conversion.h:94
virtual ~cluster()
Definition tree-switch-conversion.h:55
virtual cluster_type get_type()=0
basic_block m_case_bb
Definition tree-switch-conversion.h:97
profile_probability m_subtree_prob
Definition tree-switch-conversion.h:103
Definition tree-switch-conversion.h:223
group_cluster(vec< cluster * > &clusters, unsigned start, unsigned end)
Definition tree-switch-conversion.cc:1101
vec< simple_cluster * > m_cases
Definition tree-switch-conversion.h:252
~group_cluster()
Definition tree-switch-conversion.cc:1117
void debug() final override
Definition tree-switch-conversion.h:244
tree get_high() final override
Definition tree-switch-conversion.h:238
void dump(FILE *f, bool details=false) final override
Definition tree-switch-conversion.cc:1128
tree get_low() final override
Definition tree-switch-conversion.h:232
Definition tree-switch-conversion.h:261
jump_table_cluster(vec< cluster * > &clusters, unsigned start, unsigned end)
Definition tree-switch-conversion.h:264
cluster_type get_type() final override
Definition tree-switch-conversion.h:269
static bool is_enabled(void)
Definition tree-switch-conversion.h:521
static unsigned int case_values_threshold(void)
Definition tree-switch-conversion.h:510
Definition tree-switch-conversion.h:459
min_cluster_item(unsigned count, unsigned start, unsigned non_jt_cases)
Definition tree-switch-conversion.h:462
unsigned m_start
Definition tree-switch-conversion.h:470
unsigned m_count
Definition tree-switch-conversion.h:467
unsigned m_non_jt_cases
Definition tree-switch-conversion.h:473
Definition tree-switch-conversion.h:126
void emit(tree, tree, tree, basic_block, location_t) final override
Definition tree-switch-conversion.h:178
simple_cluster(tree low, tree high, tree case_label_expr, basic_block case_bb, profile_probability prob, bool has_forward_bb=false)
Definition tree-switch-conversion.h:208
~simple_cluster()
Definition tree-switch-conversion.h:134
void debug() final override
Definition tree-switch-conversion.h:161
void set_high(tree high)
Definition tree-switch-conversion.h:155
bool is_single_value_p() final override
Definition tree-switch-conversion.h:183
bool m_range_p
Definition tree-switch-conversion.h:202
tree get_low() final override
Definition tree-switch-conversion.h:144
tree m_low
Definition tree-switch-conversion.h:196
bool m_has_forward_bb
Definition tree-switch-conversion.h:205
tree m_high
Definition tree-switch-conversion.h:199
unsigned get_comparison_count()
Definition tree-switch-conversion.h:190
cluster_type get_type() final override
Definition tree-switch-conversion.h:138
tree get_high() final override
Definition tree-switch-conversion.h:150
void dump(FILE *f, bool details=false) final override
Definition tree-switch-conversion.h:167
Definition tree-switch-conversion.h:728
basic_block m_switch_bb
Definition tree-switch-conversion.h:844
int m_phi_count
Definition tree-switch-conversion.h:857
gimple * m_arr_ref_last
Definition tree-switch-conversion.h:881
unsigned int m_count
Definition tree-switch-conversion.h:899
tree * m_target_outbound_names
Definition tree-switch-conversion.h:871
bool contains_linear_function_p(vec< constructor_elt, va_gc > *vec, wide_int *coeff_a, wide_int *coeff_b)
Definition tree-switch-conversion.cc:478
gimple * m_arr_ref_first
Definition tree-switch-conversion.h:878
gassign * gen_def_assigns(gimple_stmt_iterator *gsi)
Definition tree-switch-conversion.cc:788
tree m_range_min
Definition tree-switch-conversion.h:835
void expand(gswitch *swtch)
Definition tree-switch-conversion.cc:1013
void build_constructors()
Definition tree-switch-conversion.cc:397
tree array_value_type(tree type, int num)
Definition tree-switch-conversion.cc:538
tree m_range_max
Definition tree-switch-conversion.h:836
void create_temp_arrays()
Definition tree-switch-conversion.cc:345
void gather_default_values(tree default_case)
Definition tree-switch-conversion.cc:366
void build_one_array(int num, tree arr_index_type, gphi *phi, tree tidx)
Definition tree-switch-conversion.cc:624
tree m_index_expr
Definition tree-switch-conversion.h:831
tree * m_target_inbound_names
Definition tree-switch-conversion.h:867
bool m_default_case_nonstandard
Definition tree-switch-conversion.h:893
bool check_range()
Definition tree-switch-conversion.cc:210
tree * m_default_values
Definition tree-switch-conversion.h:863
void collect(gswitch *swtch)
Definition tree-switch-conversion.cc:76
basic_block m_final_bb
Definition tree-switch-conversion.h:851
const char * m_reason
Definition tree-switch-conversion.h:885
void fix_phi_nodes(edge e1f, edge e2f, basic_block bbf)
Definition tree-switch-conversion.cc:833
~switch_conversion()
Definition tree-switch-conversion.cc:1093
void build_arrays()
Definition tree-switch-conversion.cc:716
switch_conversion()
Definition tree-switch-conversion.cc:66
basic_block m_default_bb
Definition tree-switch-conversion.h:847
bool check_all_empty_except_final()
Definition tree-switch-conversion.cc:232
tree m_range_size
Definition tree-switch-conversion.h:841
unsigned int m_uniq
Definition tree-switch-conversion.h:896
bool m_contiguous_range
Definition tree-switch-conversion.h:889
bool check_final_bb()
Definition tree-switch-conversion.cc:264
profile_probability m_default_prob
Definition tree-switch-conversion.h:854
void gen_inbound_check()
Definition tree-switch-conversion.cc:861
void prune_bbs(basic_block bbd, basic_block final, basic_block default_bb)
Definition tree-switch-conversion.cc:810
tree m_target_vop
Definition tree-switch-conversion.h:874
bool m_cfg_altered
Definition tree-switch-conversion.h:902
gswitch * m_switch
Definition tree-switch-conversion.h:828
vec< constructor_elt, va_gc > ** m_constructors
Definition tree-switch-conversion.h:860
Definition tree-switch-conversion.h:561
void fix_phi_operands_for_edges()
Definition tree-switch-conversion.cc:2071
static void dump_case_nodes(FILE *f, case_tree_node *root, int indent_step, int indent_level)
Definition tree-switch-conversion.cc:2220
static void emit_jump(basic_block bb, basic_block case_bb)
Definition tree-switch-conversion.cc:2244
static basic_block do_jump_if_equal(basic_block bb, tree op0, tree op1, basic_block label_bb, profile_probability prob, location_t)
Definition tree-switch-conversion.cc:2289
static void balance_case_nodes(case_tree_node **head, case_tree_node *parent)
Definition tree-switch-conversion.cc:2144
static void reset_out_edges_aux(gswitch *swtch)
Definition tree-switch-conversion.h:906
void record_phi_operand_mapping()
Definition tree-switch-conversion.cc:2040
bool try_switch_expansion(vec< cluster * > &clusters)
Definition tree-switch-conversion.cc:1954
hash_map< tree, tree > m_phi_mapping
Definition tree-switch-conversion.h:651
switch_decision_tree(gswitch *swtch)
Definition tree-switch-conversion.h:564
void emit(basic_block bb, tree index_expr, profile_probability default_prob, tree index_type)
Definition tree-switch-conversion.cc:2104
case_tree_node * m_case_list
Definition tree-switch-conversion.h:663
gswitch * m_switch
Definition tree-switch-conversion.h:648
bool analyze_switch_statement()
Definition tree-switch-conversion.cc:1869
object_allocator< case_tree_node > m_case_node_pool
Definition tree-switch-conversion.h:660
basic_block m_default_bb
Definition tree-switch-conversion.h:657
static basic_block emit_cmp_and_jump_insns(basic_block bb, tree op0, tree op1, tree_code comparison, basic_block label_bb, profile_probability prob, location_t)
Definition tree-switch-conversion.cc:2256
void compute_cases_per_edge()
Definition tree-switch-conversion.cc:1854
basic_block emit_case_nodes(basic_block bb, tree index, case_tree_node *node, profile_probability default_prob, tree index_type, location_t)
Definition tree-switch-conversion.cc:2322
auto_vec< basic_block > m_case_bbs
Definition tree-switch-conversion.h:654
class edge_def * edge
Definition coretypes.h:342
union tree_node * tree
Definition coretypes.h:97
static unsigned int count[debug_counter_number_of_counters]
Definition dbgcnt.cc:50
rtx_insn * emit(rtx x, bool allow_barrier_p)
Definition emit-rtl.cc:5604
void final(rtx_insn *first, FILE *file, int optimize_p)
Definition final.cc:2002
tree_code
Definition genmatch.cc:347
T * ggc_alloc(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:184
basic_block gimple_bb(const gimple *g)
Definition gimple.h:1860
Definition tree-switch-conversion.h:23
void release_clusters(vec< cluster * > &clusters)
Definition tree-switch-conversion.h:918
cluster_type
Definition tree-switch-conversion.h:28
@ BIT_TEST
Definition tree-switch-conversion.h:31
@ JUMP_TABLE
Definition tree-switch-conversion.h:30
@ SIMPLE_CASE
Definition tree-switch-conversion.h:29
UNARY_PREDICATE neg_p(const T &, signop=SIGNED)
UNARY_PREDICATE fits_uhwi_p(const T &)
tree_to_wide_ref to_wide(const_tree)
Definition tree.h:6372
i
Definition poly-int.h:772
Definition basic-block.h:117
vec< edge, va_gc > * succs
Definition basic-block.h:120
Definition compare-elim.cc:91
Definition basic-block.h:366
Definition gimple-iterator.h:26
Definition collect2.cc:175
Definition gengtype.h:252
#define NULL
Definition system.h:50
#define gcc_unreachable()
Definition system.h:848
struct gcc_target targetm
#define PRINT_CASE(f, c)
Definition tree-switch-conversion.h:34
bool tree_int_cst_equal(const_tree t1, const_tree t2)
Definition tree.cc:6382
#define TYPE_SIGN(NODE)
Definition tree.h:952
#define TREE_TYPE(NODE)
Definition tree.h:512
T * end(vec< T, A, L > *v)
Definition vec.h:457