From patchwork Tue Nov 23 09:59:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 48025 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3D963385801F for ; Tue, 23 Nov 2021 10:00:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D963385801F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1637661610; bh=JaZyVCfrDP6CK6kpe4RlbWaqHg8osPxAXZIg7VYhGJg=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=eNKCxjINEeWP+SdvLbL3RrVJ5eCnu0fCTqbIaKFaU5cu5csvhOBczQCYlPKwjcYaN ZsdsgWZD0RHFV/aScCnsIzixhiSWmBe4pArFE1KdPbXIcegrO7lL8Upn+P8mUUkmNB IzxDjitBJNgSBYKf8dwFdr0Ld0KtkSf8xDwYYC/c= 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 B8DB83858D28 for ; Tue, 23 Nov 2021 09:59:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B8DB83858D28 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-88-Q6RBjM5cN96Z71Fjnslt1A-1; Tue, 23 Nov 2021 04:59:39 -0500 X-MC-Unique: Q6RBjM5cN96Z71Fjnslt1A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2250218125C0; Tue, 23 Nov 2021 09:59:38 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B18AC794A3; Tue, 23 Nov 2021 09:59:37 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 1AN9xXPG3952388 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 23 Nov 2021 10:59:34 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 1AN9xWnY3952387; Tue, 23 Nov 2021 10:59:32 +0100 Date: Tue, 23 Nov 2021 10:59:32 +0100 To: Richard Biener Subject: [PATCH] inliner: Remove unused transform_lang_insert_block hook Message-ID: <20211123095932.GT2646553@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi! This struct copy_body_data's hook is always NULL since merge of the tuples branch, before that it has been shortly used by the C++ FE during ctor/dtor cloning to chain the remapped blocks, but only very shortly, before transform_lang_insert_block was a bool and the call to insert_block was done through a langhook. I'd say that for something that hasn't been used since 4.4 there is zero chance we'll want to use it again in the near future. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2021-11-23 Jakub Jelinek gcc/ * tree-inline.h (struct copy_body_data): Remove transform_lang_insert_block member. * tree-inline.c (remap_block): Don't call id->transform_lang_insert_block. (optimize_inline_calls, copy_gimple_seq_and_replace_locals, tree_function_versioning, maybe_inline_call_in_expr, copy_fn): Don't initialize id.transform_lang_insert_block. * gimplify.c (gimplify_omp_loop): Likewise. gcc/c/ * c-typeck.c (c_clone_omp_udr): Don't initialize id.transform_lang_insert_block. gcc/cp/ * semantics.c (clone_omp_udr): Don't initialize id.transform_lang_insert_block. * optimize.c (clone_body): Likewise. Jakub --- gcc/tree-inline.h.jj 2021-05-04 21:02:24.181799753 +0200 +++ gcc/tree-inline.h 2021-11-22 13:17:15.330592766 +0100 @@ -133,9 +133,6 @@ struct copy_body_data and only in that case will actually remap the type. */ bool dont_remap_vla_if_no_change; - /* A function to be called when duplicating BLOCK nodes. */ - void (*transform_lang_insert_block) (tree); - /* Statements that might be possibly folded. */ hash_set *statements_to_fold; --- gcc/tree-inline.c.jj 2021-11-19 16:39:51.669594099 +0100 +++ gcc/tree-inline.c 2021-11-22 13:17:30.429377127 +0100 @@ -823,9 +823,6 @@ remap_block (tree *block, copy_body_data &BLOCK_NONLOCALIZED_VARS (new_block), id); - if (id->transform_lang_insert_block) - id->transform_lang_insert_block (new_block); - /* Remember the remapped block. */ insert_decl_map (id, old_block, new_block); } @@ -5473,7 +5470,6 @@ optimize_inline_calls (tree fn) id.transform_new_cfg = false; id.transform_return_to_modify = true; id.transform_parameter = true; - id.transform_lang_insert_block = NULL; id.statements_to_fold = new hash_set; push_gimplify_context (); @@ -5857,7 +5853,6 @@ copy_gimple_seq_and_replace_locals (gimp id.transform_new_cfg = false; id.transform_return_to_modify = false; id.transform_parameter = false; - id.transform_lang_insert_block = NULL; /* Walk the tree once to find local labels. */ memset (&wi, 0, sizeof (wi)); @@ -6252,7 +6247,6 @@ tree_function_versioning (tree old_decl, id.transform_new_cfg = true; id.transform_return_to_modify = false; id.transform_parameter = false; - id.transform_lang_insert_block = NULL; old_entry_block = ENTRY_BLOCK_PTR_FOR_FN (DECL_STRUCT_FUNCTION (old_decl)); @@ -6541,7 +6535,6 @@ maybe_inline_call_in_expr (tree exp) id.transform_new_cfg = false; id.transform_return_to_modify = true; id.transform_parameter = true; - id.transform_lang_insert_block = NULL; /* Make sure not to unshare trees behind the front-end's back since front-end specific mechanisms may rely on sharing. */ @@ -6613,7 +6606,6 @@ copy_fn (tree fn, tree& parms, tree& res id.transform_new_cfg = false; id.transform_return_to_modify = false; id.transform_parameter = true; - id.transform_lang_insert_block = NULL; /* Make sure not to unshare trees behind the front-end's back since front-end specific mechanisms may rely on sharing. */ --- gcc/gimplify.c.jj 2021-11-22 16:14:18.365451780 +0100 +++ gcc/gimplify.c 2021-11-22 16:54:31.726082428 +0100 @@ -13413,7 +13413,6 @@ gimplify_omp_loop (tree *expr_p, gimple_ id.transform_call_graph_edges = CB_CGE_DUPLICATE; id.transform_new_cfg = true; id.transform_return_to_modify = false; - id.transform_lang_insert_block = NULL; id.eh_lp_nr = 0; walk_tree (&OMP_CLAUSE_REDUCTION_INIT (*pc), copy_tree_body_r, &id, NULL); --- gcc/c/c-typeck.c.jj 2021-11-22 10:07:01.305225923 +0100 +++ gcc/c/c-typeck.c 2021-11-22 13:18:20.678659463 +0100 @@ -13848,7 +13848,6 @@ c_clone_omp_udr (tree stmt, tree omp_dec id.transform_call_graph_edges = CB_CGE_DUPLICATE; id.transform_new_cfg = true; id.transform_return_to_modify = false; - id.transform_lang_insert_block = NULL; id.eh_lp_nr = 0; walk_tree (&stmt, copy_tree_body_r, &id, NULL); return stmt; --- gcc/cp/semantics.c.jj 2021-11-19 09:58:37.239716820 +0100 +++ gcc/cp/semantics.c 2021-11-22 13:18:40.604374884 +0100 @@ -6066,7 +6066,6 @@ clone_omp_udr (tree stmt, tree omp_decl1 id.transform_call_graph_edges = CB_CGE_DUPLICATE; id.transform_new_cfg = true; id.transform_return_to_modify = false; - id.transform_lang_insert_block = NULL; id.eh_lp_nr = 0; walk_tree (&stmt, copy_tree_body_r, &id, NULL); return stmt; --- gcc/cp/optimize.c.jj 2021-03-23 10:20:42.765718056 +0100 +++ gcc/cp/optimize.c 2021-11-22 13:18:51.899213569 +0100 @@ -103,7 +103,6 @@ clone_body (tree clone, tree fn, void *a id.transform_call_graph_edges = CB_CGE_DUPLICATE; id.transform_new_cfg = true; id.transform_return_to_modify = false; - id.transform_lang_insert_block = NULL; /* We're not inside any EH region. */ id.eh_lp_nr = 0;