GCC Middle and Back End API Reference
tree_switch_conversion::jump_table_cluster Class Reference

#include <tree-switch-conversion.h>

Inheritance diagram for tree_switch_conversion::jump_table_cluster:
Collaboration diagram for tree_switch_conversion::jump_table_cluster:

Public Member Functions

 jump_table_cluster (vec< cluster * > &clusters, unsigned start, unsigned end)
 
cluster_type get_type () final override
 
void emit (tree index_expr, tree index_type, tree default_label_expr, basic_block default_bb, location_t loc) final override
 
tree get_low () final override
 
tree get_high () final override
 
void debug () final override
 
void dump (FILE *f, bool details=false) final override
 
virtual bool is_single_value_p ()
 

Static Public Member Functions

static vec< cluster * > find_jump_tables (vec< cluster * > &clusters)
 
static bool can_be_handled (const vec< cluster * > &clusters, unsigned start, unsigned end, unsigned HOST_WIDE_INT max_ratio, unsigned HOST_WIDE_INT comparison_count)
 
static bool is_beneficial (const vec< cluster * > &clusters, unsigned start, unsigned end)
 
static unsigned int case_values_threshold (void)
 
static bool is_enabled (void)
 
static unsigned HOST_WIDE_INT get_range (tree low, tree high)
 

Data Fields

vec< simple_cluster * > m_cases
 
tree m_case_label_expr
 
basic_block m_case_bb
 
profile_probability m_prob
 
profile_probability m_subtree_prob
 
profile_probability m_default_prob
 

Detailed Description

Concrete subclass of group_cluster representing a collection
of cases to be implemented as a jump table.
The "emit" vfunc generates a nested switch statement which
is later lowered to a jump table.   

Constructor & Destructor Documentation

◆ jump_table_cluster()

tree_switch_conversion::jump_table_cluster::jump_table_cluster ( vec< cluster * > & clusters,
unsigned start,
unsigned end )
inline

Member Function Documentation

◆ can_be_handled()

bool jump_table_cluster::can_be_handled ( const vec< cluster * > & clusters,
unsigned start,
unsigned end,
unsigned HOST_WIDE_INT max_ratio,
unsigned HOST_WIDE_INT comparison_count )
static
Return true when cluster starting at START and ending at END (inclusive)
can build a jump-table.   

References end(), tree_switch_conversion::group_cluster::get_high(), tree_switch_conversion::group_cluster::get_low(), tree_switch_conversion::cluster::get_range(), and HOST_WIDE_INT_M1U.

Referenced by find_jump_tables().

◆ case_values_threshold()

unsigned int tree_switch_conversion::jump_table_cluster::case_values_threshold ( void )
inlinestatic

References targetm.

Referenced by find_jump_tables(), and is_beneficial().

◆ debug()

void tree_switch_conversion::group_cluster::debug ( )
inlinefinaloverridevirtualinherited

◆ dump()

◆ emit()

◆ find_jump_tables()

vec< cluster * > jump_table_cluster::find_jump_tables ( vec< cluster * > & clusters)
static

◆ get_high()

◆ get_low()

◆ get_range()

◆ get_type()

cluster_type tree_switch_conversion::jump_table_cluster::get_type ( )
inlinefinaloverridevirtual

◆ is_beneficial()

bool jump_table_cluster::is_beneficial ( const vec< cluster * > & clusters,
unsigned start,
unsigned end )
static
Return true if cluster starting at START and ending at END (inclusive)
is profitable transformation.   

References case_values_threshold(), and end().

Referenced by find_jump_tables().

◆ is_enabled()

bool tree_switch_conversion::jump_table_cluster::is_enabled ( void )
inlinestatic
Return whether jump table expansion is allowed.   

References targetm.

Referenced by find_jump_tables().

◆ is_single_value_p()

virtual bool tree_switch_conversion::cluster::is_single_value_p ( )
inlinevirtualinherited

Field Documentation

◆ m_case_bb

◆ m_case_label_expr

tree tree_switch_conversion::cluster::m_case_label_expr
inherited

◆ m_cases

◆ m_default_prob

◆ m_prob

◆ m_subtree_prob


The documentation for this class was generated from the following files: