GCC Middle and Back End API Reference
jt_path_registry Class Referenceabstract

#include <tree-ssa-threadupdate.h>

Inheritance diagram for jt_path_registry:
Collaboration diagram for jt_path_registry:

Public Member Functions

 jt_path_registry (bool backedge_threads)
virtual ~jt_path_registry ()
bool register_jump_thread (vec< jump_thread_edge * > *)
bool thread_through_all_blocks (bool peel_loop_headers)
void push_edge (vec< jump_thread_edge * > *path, edge, jump_thread_edge_type)
vec< jump_thread_edge * > * allocate_thread_path ()
void debug ()

Protected Member Functions

void debug_path (FILE *, int pathno)
void remove_path (unsigned pathno)
void remove_path (unsigned pathno, edge first)
void add_first_edge (edge)
void drop_first_edge (edge)
unsigned first_edge_count (edge)

Protected Attributes

vec< vec< jump_thread_edge * > * > m_paths
hash_map< edge, unsigned > m_first_edge_counts
unsigned long m_num_threaded_edges

Private Member Functions

virtual bool update_cfg (bool peel_loop_headers)=0
bool cancel_invalid_paths (vec< jump_thread_edge * > &path)
 DISABLE_COPY_AND_ASSIGN (jt_path_registry)

Private Attributes

jump_thread_path_allocator m_allocator
bool m_backedge_threads

Constructor & Destructor Documentation

◆ jt_path_registry()

◆ ~jt_path_registry()

jt_path_registry::~jt_path_registry ( )
virtual

References m_paths.

Member Function Documentation

◆ add_first_edge()

void jt_path_registry::add_first_edge ( edge e)
protected
Note that one more registered path starts on E.   

References hash_map< KeyId, Value, Traits >::get_or_insert(), and m_first_edge_counts.

Referenced by back_jt_path_registry::adjust_one_path(), and register_jump_thread().

◆ allocate_thread_path()

◆ cancel_invalid_paths()

◆ debug()

void jt_path_registry::debug ( )

References debug_path(), i, and m_paths.

◆ debug_path()

void jt_path_registry::debug_path ( FILE * dump_file,
int pathno )
protected

References dump_file, i, and m_paths.

Referenced by back_jt_path_registry::adjust_one_path(), and debug().

◆ DISABLE_COPY_AND_ASSIGN()

jt_path_registry::DISABLE_COPY_AND_ASSIGN ( jt_path_registry )
private

References jt_path_registry().

◆ drop_first_edge()

void jt_path_registry::drop_first_edge ( edge e)
protected

◆ first_edge_count()

unsigned jt_path_registry::first_edge_count ( edge e)
protected

◆ push_edge()

◆ register_jump_thread()

bool jt_path_registry::register_jump_thread ( vec< jump_thread_edge * > * path)
Register a jump threading opportunity.  We queue up all the jump
threading opportunities discovered by a pass and update the CFG
and SSA form all at once.

E is the edge we can thread, E2 is the new target edge, i.e., we
are effectively recording that E->dest can be changed to E2->dest
after fixing the SSA graph.

Return TRUE if PATH was successfully threaded.   

References add_first_edge(), cancel_invalid_paths(), dbg_cnt(), dump_file, dump_flags, dump_jump_thread_path(), gcc_checking_assert, m_paths, and TDF_DETAILS.

Referenced by back_threader_registry::register_path(), and jump_threader::thread_across_edge().

◆ remove_path() [1/2]

void jt_path_registry::remove_path ( unsigned pathno)
protected

◆ remove_path() [2/2]

void jt_path_registry::remove_path ( unsigned pathno,
edge first )
protected
Drop path PATHNO, which started on FIRST, keeping the first-edge
counts in step.  For callers whose path has already been released.   

References drop_first_edge(), and m_paths.

◆ thread_through_all_blocks()

bool jt_path_registry::thread_through_all_blocks ( bool peel_loop_headers)
Thread all paths that have been queued for jump threading, and
update the CFG accordingly.

It is the caller's responsibility to fix the dominance information
and rewrite duplicated SSA_NAMEs back into SSA form.

If PEEL_LOOP_HEADERS is false, avoid threading edges through loop
headers if it does not simplify the loop.

Returns true if one or more edges were threaded.   

References cfun, LOOPS_NEED_FIXUP, loops_state_set(), m_num_threaded_edges, m_paths, statistics_counter_event(), and update_cfg().

Referenced by back_threader::thread_blocks(), and jump_threader::thread_through_all_blocks().

◆ update_cfg()

virtual bool jt_path_registry::update_cfg ( bool peel_loop_headers)
privatepure virtual

Field Documentation

◆ m_allocator

jump_thread_path_allocator jt_path_registry::m_allocator
private

Referenced by allocate_thread_path(), and push_edge().

◆ m_backedge_threads

bool jt_path_registry::m_backedge_threads
private

◆ m_first_edge_counts

hash_map<edge, unsigned> jt_path_registry::m_first_edge_counts
protected

◆ m_num_threaded_edges

unsigned long jt_path_registry::m_num_threaded_edges
protected

◆ m_paths


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