From: Aldy Hernandez Date: Wed, 27 Oct 2021 19:31:35 +0000 (+0200) Subject: Make back_threader_registry inherit from back_jt_path_registry. X-Git-Tag: basepoints/gcc-13~3548 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f6c22585229b43b13fc9c8d3c08aedd9f7c493a;p=thirdparty%2Fgcc.git Make back_threader_registry inherit from back_jt_path_registry. When a class's only purpose is to expose the methods of its only member, it's really a derived class ;-). Tested on x86-64 Linux. gcc/ChangeLog: * tree-ssa-threadbackward.c (class back_threader_registry): Inherit from back_jt_path_registry. (back_threader_registry::thread_through_all_blocks): Remove. (back_threader_registry::register_path): Remove m_lowlevel_registry prefix. --- diff --git a/gcc/tree-ssa-threadbackward.c b/gcc/tree-ssa-threadbackward.c index d9ce056b06ce..6c1b15904ce6 100644 --- a/gcc/tree-ssa-threadbackward.c +++ b/gcc/tree-ssa-threadbackward.c @@ -49,13 +49,10 @@ along with GCC; see the file COPYING3. If not see // registered with register_path(), thread_through_all_blocks() is called // to modify the CFG. -class back_threader_registry +class back_threader_registry : public back_jt_path_registry { public: bool register_path (const vec &, edge taken); - bool thread_through_all_blocks (bool may_peel_loop_headers); -private: - back_jt_path_registry m_lowlevel_registry; }; // Class to abstract the profitability code for the backwards threader. @@ -541,12 +538,6 @@ back_threader::debug () dump (stderr); } -bool -back_threader_registry::thread_through_all_blocks (bool may_peel_loop_headers) -{ - return m_lowlevel_registry.thread_through_all_blocks (may_peel_loop_headers); -} - /* Examine jump threading path PATH and return TRUE if it is profitable to thread it, otherwise return FALSE. @@ -873,8 +864,7 @@ bool back_threader_registry::register_path (const vec &m_path, edge taken_edge) { - vec *jump_thread_path - = m_lowlevel_registry.allocate_thread_path (); + vec *jump_thread_path = allocate_thread_path (); // The generic copier ignores the edge type. We can build the // thread edges with any type. @@ -885,12 +875,11 @@ back_threader_registry::register_path (const vec &m_path, edge e = find_edge (bb1, bb2); gcc_assert (e); - m_lowlevel_registry.push_edge (jump_thread_path, e, EDGE_COPY_SRC_BLOCK); + push_edge (jump_thread_path, e, EDGE_COPY_SRC_BLOCK); } - m_lowlevel_registry.push_edge (jump_thread_path, - taken_edge, EDGE_NO_COPY_SRC_BLOCK); - m_lowlevel_registry.register_jump_thread (jump_thread_path); + push_edge (jump_thread_path, taken_edge, EDGE_NO_COPY_SRC_BLOCK); + register_jump_thread (jump_thread_path); return true; }