GCC Middle and Back End API Reference
back_threader_profitability Class Reference
Collaboration diagram for back_threader_profitability:

Data Structures

struct  path_stats
struct  unwind_state

Public Member Functions

 back_threader_profitability (bool speed_p, gimple *stmt)
void push_bb (const vec< basic_block > &)
void pop_bb ()
bool possibly_profitable_path_p (const vec< basic_block > &, bool *)
bool profitable_path_p (const vec< basic_block > &, edge taken, bool *irreducible_loop)

Private Member Functions

int account_bb (basic_block, bool)
int net_insns () const

Private Attributes

const bool m_speed_p
int m_exit_jump_benefit
bool m_threaded_multiway_branch
class loopm_loop
path_stats m_stats
auto_vec< unwind_state, 20 > m_unwind

Constructor & Destructor Documentation

◆ back_threader_profitability()

back_threader_profitability::back_threader_profitability ( bool speed_p,
gimple * stmt )

Member Function Documentation

◆ account_bb()

int back_threader_profitability::account_bb ( basic_block bb,
bool check_multiway )
private
Account for BB in the cumulative stats for the path being threaded.
CHECK_MULTIWAY is true for all blocks except the block whose branch
we are going to eliminate.  Return the number of insns in BB, which
PUSH_BB records so the dump can print a per-block count.   

References eni_size_weights, estimate_num_insns(), gimple_call_builtin_p(), gimple_call_internal_p(), gsi_after_labels(), gsi_end_p(), gsi_last_bb(), gsi_next_nondebug(), gsi_stmt(), is_gimple_debug(), last, m_speed_p, m_stats, and optimize_bb_for_speed_p().

Referenced by push_bb().

◆ net_insns()

int back_threader_profitability::net_insns ( ) const
inlineprivate

◆ pop_bb()

void back_threader_profitability::pop_bb ( )

References m_stats, and m_unwind.

Referenced by back_threader::find_paths_to_names().

◆ possibly_profitable_path_p()

bool back_threader_profitability::possibly_profitable_path_p ( const vec< basic_block > & m_path,
bool * large_non_fsm )
Examine jump threading path PATH and return TRUE if it is possibly
profitable to thread it, otherwise return FALSE.  If this function
returns TRUE profitable_path_p might not be satisfied but when
the path is extended it might be.  In particular indicate in
*LARGE_NON_FSM whether the thread is too large for a non-FSM thread
but would be OK if we extend the path to cover the loop backedge.

?? It seems we should be able to loosen some of the restrictions in
this function after loop optimizations have run.   

References cfun, dump_file, dump_flags, EXIT_BLOCK, find_edge(), fputc(), gcc_checking_assert, basic_block_def::index, loop::latch, m_exit_jump_benefit, m_loop, m_speed_p, m_stats, m_threaded_multiway_branch, m_unwind, net_insns(), probably_never_executed_edge_p(), and TDF_DETAILS.

Referenced by back_threader::find_paths_to_names().

◆ profitable_path_p()

bool back_threader_profitability::profitable_path_p ( const vec< basic_block > & m_path,
edge taken_edge,
bool * creates_irreducible_loop )
Examine jump threading path PATH and return TRUE if it is profitable to
thread it, otherwise return FALSE.

The taken edge out of the path is TAKEN_EDGE.

CREATES_IRREDUCIBLE_LOOP is set to TRUE if threading this path
would create an irreducible loop.

?? It seems we should be able to loosen some of the restrictions in
this function after loop optimizations have run.   

References cfun, determine_bb_domination_status(), DOMST_NONDOMINATING, dump_file, dump_flags, empty_block_p(), fputc(), loop::latch, m_speed_p, m_stats, m_threaded_multiway_branch, net_insns(), optimize_edge_for_speed_p(), probably_never_executed_edge_p(), PROP_loop_opts_done, and TDF_DETAILS.

Referenced by back_threader::maybe_register_path().

◆ push_bb()

void back_threader_profitability::push_bb ( const vec< basic_block > & path)
Update the stats after a block has been appended to PATH.   

References account_bb(), m_loop, m_stats, m_unwind, and path.

Referenced by back_threader::find_paths_to_names().

Field Documentation

◆ m_exit_jump_benefit

int back_threader_profitability::m_exit_jump_benefit
private

◆ m_loop

class loop* back_threader_profitability::m_loop
private

◆ m_speed_p

const bool back_threader_profitability::m_speed_p
private

◆ m_stats

◆ m_threaded_multiway_branch

bool back_threader_profitability::m_threaded_multiway_branch
private

◆ m_unwind

auto_vec<unwind_state, 20> back_threader_profitability::m_unwind
private

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