]> git.ipfire.org Git - thirdparty/gcc.git/commit
Refactor backward threader registry and profitability code into classes.
authorAldy Hernandez <aldyh@redhat.com>
Wed, 28 Apr 2021 09:15:11 +0000 (11:15 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Fri, 30 Apr 2021 16:17:18 +0000 (18:17 +0200)
commit69e5544210e3c0e27df3e6590b646c13dcce24e3
treeff08d986511e3f5ed08bc710bfe630633f6fa2ae
parentd8ea47033a726c9b3455ead98b6ddce2403ec6d9
Refactor backward threader registry and profitability code into classes.

This refactors the registry and the profitability code from the
backwards threader into two separate classes.  It cleans up the code,
and makes it easier for alternate implementations to share code.

gcc/ChangeLog:

* tree-ssa-threadbackward.c (class thread_jumps): Split out code
from here...
(class back_threader_registry): ...to here...
(class back_threader_profitability): ...and here...
(thread_jumps::thread_through_all_blocks): Remove argument.
(back_threader_registry::back_threader_registry): New.
(back_threader_registry::~back_threader_registry): New.
(back_threader_registry::thread_through_all_blocks): New.
(thread_jumps::profitable_jump_thread_path): Move from here...
(back_threader_profitability::profitable_path_p): ...to here.
(thread_jumps::find_taken_edge): New.
(thread_jumps::convert_and_register_current_path): Move...
(back_threader_registry::register_path): ...to here.
(thread_jumps::register_jump_thread_path_if_profitable): Move...
(thread_jumps::maybe_register_path): ...to here.
(thread_jumps::handle_phi): Call find_taken_edge and
maybe_register_path.
(thread_jumps::handle_assignment): Same.
(thread_jumps::fsm_find_control_statement_thread_paths): Remove
tree argument to handle_phi and handle_assignment.
(thread_jumps::find_jump_threads_backwards): Set m_name.  Remove
set of m_speed_p and m_max_threaded_paths.
(pass_thread_jumps::execute): Remove second argument from
find_jump_threads_backwards.
(pass_early_thread_jumps::execute): Same.
gcc/tree-ssa-threadbackward.c