From patchwork Tue Apr 27 12:31:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1470670 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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@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 ozlabs.org (Postfix) with ESMTPS id 4FV1NN4DG4z9t14 for ; Tue, 27 Apr 2021 22:31:48 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3FD63389682F; Tue, 27 Apr 2021 12:31:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 5C8BD3896826 for ; Tue, 27 Apr 2021 12:31:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5C8BD3896826 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rguenther@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7B0DFB18F for ; Tue, 27 Apr 2021 12:31:29 +0000 (UTC) Date: Tue, 27 Apr 2021 14:31:29 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH 2/2] tree-optimization/99912 - schedule another TODO_remove_unused_locals Message-ID: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" This makes sure to remove unused locals and prune CLOBBERs after the first scalar cleanup phase after IPA optimizations. On the testcase in the PR this results in 8000 CLOBBERs removed which in turn unleashes more DSE which otherwise hits its walking limit of 256 too early on this testcase. Bootstrap and regtest running on x86_64-unknown-linux-gnu. 2021-04-27 Richard Biener PR tree-optimization/99912 * passes.def: Add comment about new TODO_remove_unused_locals. * tree-stdarg.c (pass_data_stdarg): Run TODO_remove_unused_locals at start. --- gcc/passes.def | 3 +++ gcc/tree-stdarg.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/passes.def b/gcc/passes.def index 61fe9fdc42c..f7c42897f43 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -212,6 +212,9 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_vrp, true /* warn_array_bounds_p */); NEXT_PASS (pass_dse); NEXT_PASS (pass_dce); + /* pass_stdarg is always run and at this point we execute + TODO_remove_unused_locals to prune CLOBBERs of dead + variables which are otherwise a churn on alias walkings. */ NEXT_PASS (pass_stdarg); NEXT_PASS (pass_call_cdce); NEXT_PASS (pass_cselim); diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c index ef21c125651..2f77a613df0 100644 --- a/gcc/tree-stdarg.c +++ b/gcc/tree-stdarg.c @@ -1114,7 +1114,7 @@ const pass_data pass_data_stdarg = ( PROP_cfg | PROP_ssa ), /* properties_required */ PROP_gimple_lva, /* properties_provided */ 0, /* properties_destroyed */ - 0, /* todo_flags_start */ + TODO_remove_unused_locals, /* todo_flags_start */ 0, /* todo_flags_finish */ };