From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 12FC63858404 for ; Thu, 28 Oct 2021 12:32:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 12FC63858404 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-188-NlB5XMhtM-yx6pNaTutwzQ-1; Thu, 28 Oct 2021 08:32:26 -0400 X-MC-Unique: NlB5XMhtM-yx6pNaTutwzQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4EA958B0588; Thu, 28 Oct 2021 12:32:25 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 98D345BAE0; Thu, 28 Oct 2021 12:32:22 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.16.1/8.15.2) with ESMTPS id 19SCWJNm498147 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 28 Oct 2021 14:32:20 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 19SCWJib498146; Thu, 28 Oct 2021 14:32:19 +0200 From: Aldy Hernandez To: GCC patches Subject: [COMMITTED] Make back_threader_registry inherit from back_jt_path_registry. Date: Thu, 28 Oct 2021 14:32:14 +0200 Message-Id: <20211028123215.498066-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2021 12:32:31 -0000 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. Committed as obvious. 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. --- gcc/tree-ssa-threadbackward.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/gcc/tree-ssa-threadbackward.c b/gcc/tree-ssa-threadbackward.c index d9ce056b06c..6c1b15904ce 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; } -- 2.31.1