From patchwork Thu Oct 28 12:32:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1547467 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=AqWw+iJ2; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hg4j705BTz9sP7 for ; Thu, 28 Oct 2021 23:33:13 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F10433858012 for ; Thu, 28 Oct 2021 12:33:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F10433858012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635424391; bh=UGfsC1rVx+Q/XxqQ+nogSMH2L/qT1rsTBjjpKoFV07U=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=AqWw+iJ2JD3Iz+vNVnWw6wY52CCDdjwlIBDWN/WxobqQAJeUKRpjQkKiRJgjfltgx GIui716/xA7I+MRC98QLtx0MGzO6bIuuTBN7jHO4HAWCh4U1un6bnIAJ/IbPQHSuqq PTJj+yezol9ywWade8i6Ofm6kZZkC8nQAOazaxRA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 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 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-Patchwork-Original-From: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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; }