From patchwork Thu Oct 14 14:25:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1540951 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=A+gyUaqb; 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 4HVWtx4BXhz9sP7 for ; Fri, 15 Oct 2021 01:27:04 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7B4573857C59 for ; Thu, 14 Oct 2021 14:27:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B4573857C59 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1634221621; bh=4juQ9pK5aCFCry1IYuPVe0edMbLi3Y3fYyhEeAQft4Q=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=A+gyUaqbQMoSBDADWEO1Nom4Iq87UDzvnQ6U4JntGX2bVZV/ugBv1E9sP9RKys8L+ bVPwIud9OPRPkcGDvRE81ffA84i8qb+91veK8AUkEVv8SLAsKHUKUkr0nwMjP1CG5S 5hqFCm0vKehWggICe4sTX+ScloQENCK9sJM8Ryp0= 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 ESMTP id 0F23A3858410 for ; Thu, 14 Oct 2021 14:26:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F23A3858410 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-316-r9cHpWl0N6iwcvLQIAZoPA-1; Thu, 14 Oct 2021 10:26:17 -0400 X-MC-Unique: r9cHpWl0N6iwcvLQIAZoPA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B10971006AA2; Thu, 14 Oct 2021 14:26:16 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.225]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AECCAADD7; Thu, 14 Oct 2021 14:26:14 +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 19EEQCSW251198 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 14 Oct 2021 16:26:12 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 19EEQCQR251197; Thu, 14 Oct 2021 16:26:12 +0200 To: GCC patches , Jeff Law Subject: [PATCH] Cleanup --params for backward threader. Date: Thu, 14 Oct 2021 16:25:48 +0200 Message-Id: <20211014142547.251144-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.1 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" The new backward threader makes some of the --param knobs used to control it questionable at best or no longer applicable at worst. The fsm-maximum-phi-arguments param is unused and can be removed. The max-fsm-thread-length param is block based which is a bit redundant, since we already restrict paths based on instruction estimates. The max-fsm-thread-paths restricts the total number of threadable paths in a function. We probably don't need this. Besides, the forward threader has no such restriction. OK pending tests? gcc/ChangeLog: * doc/invoke.texi: Remove max-fsm-thread-length, max-fsm-thread-paths, and fsm-maximum-phi-arguments. * params.opt: Same. * tree-ssa-threadbackward.c (back_threader::back_threader): Remove argument. (back_threader_registry::back_threader_registry): Same. (back_threader_profitability::profitable_path_p): Remove param_max_fsm_thread-length. (back_threader_registry::register_path): Remove m_max_allowable_paths. --- gcc/doc/invoke.texi | 12 ------------ gcc/params.opt | 12 ------------ gcc/tree-ssa-threadbackward.c | 27 +++------------------------ 3 files changed, 3 insertions(+), 48 deletions(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 03234c887dc..69993270b39 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -14464,14 +14464,6 @@ Emit instrumentation calls to __tsan_func_entry() and __tsan_func_exit(). Maximum number of instructions to copy when duplicating blocks on a finite state automaton jump thread path. -@item max-fsm-thread-length -Maximum number of basic blocks on a finite state automaton jump thread -path. - -@item max-fsm-thread-paths -Maximum number of new jump thread paths to create for a finite state -automaton. - @item parloops-chunk-size Chunk size of omp schedule for loops parallelized by parloops. @@ -14626,10 +14618,6 @@ The maximum depth of recursive inlining for non-inline functions. Scale factor to apply to the number of statements in a threading path when comparing to the number of (scaled) blocks. -@item fsm-maximum-phi-arguments -Maximum number of arguments a PHI may have before the FSM threader -will not try to thread through its block. - @item uninit-control-dep-attempts Maximum number of nested calls to search for control dependencies during uninitialized variable analysis. diff --git a/gcc/params.opt b/gcc/params.opt index 84d642d72c5..06a6fdc9deb 100644 --- a/gcc/params.opt +++ b/gcc/params.opt @@ -173,10 +173,6 @@ Common Joined UInteger Var(param_ranger_logical_depth) Init(6) IntegerRange(1, 9 Maximum depth of logical expression evaluation ranger will look through when evaluating outgoing edge ranges. --param=fsm-maximum-phi-arguments= -Common Joined UInteger Var(param_fsm_maximum_phi_arguments) Init(100) IntegerRange(1, 999999) Param Optimization -Maximum number of arguments a PHI may have before the FSM threader will not try to thread through its block. - -param=fsm-scale-path-blocks= Common Joined UInteger Var(param_fsm_scale_path_blocks) Init(3) IntegerRange(1, 10) Param Optimization Scale factor to apply to the number of blocks in a threading path when comparing to the number of (scaled) statements. @@ -537,18 +533,10 @@ The maximum number of nested indirect inlining performed by early inliner. Common Joined UInteger Var(param_max_fields_for_field_sensitive) Param Maximum number of fields in a structure before pointer analysis treats the structure as a single variable. --param=max-fsm-thread-length= -Common Joined UInteger Var(param_max_fsm_thread_length) Init(10) IntegerRange(1, 999999) Param Optimization -Maximum number of basic blocks on a finite state automaton jump thread path. - -param=max-fsm-thread-path-insns= Common Joined UInteger Var(param_max_fsm_thread_path_insns) Init(100) IntegerRange(1, 999999) Param Optimization Maximum number of instructions to copy when duplicating blocks on a finite state automaton jump thread path. --param=max-fsm-thread-paths= -Common Joined UInteger Var(param_max_fsm_thread_paths) Init(50) IntegerRange(1, 999999) Param Optimization -Maximum number of new jump thread paths to create for a finite state automaton. - -param=max-gcse-insertion-ratio= Common Joined UInteger Var(param_max_gcse_insertion_ratio) Init(20) Param Optimization The maximum ratio of insertions to deletions of expressions in GCSE. diff --git a/gcc/tree-ssa-threadbackward.c b/gcc/tree-ssa-threadbackward.c index 1999ccf4834..7c2c1112bee 100644 --- a/gcc/tree-ssa-threadbackward.c +++ b/gcc/tree-ssa-threadbackward.c @@ -52,12 +52,11 @@ along with GCC; see the file COPYING3. If not see class back_threader_registry { public: - back_threader_registry (int max_allowable_paths); + back_threader_registry (); 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; - const int m_max_allowable_paths; int m_threaded_paths; }; @@ -120,8 +119,7 @@ private: const edge back_threader::UNREACHABLE_EDGE = (edge) -1; back_threader::back_threader (bool speed_p) - : m_registry (param_max_fsm_thread_paths), - m_profit (speed_p), + : m_profit (speed_p), m_solver (m_ranger, /*resolve=*/false) { m_last_stmt = NULL; @@ -547,8 +545,7 @@ back_threader::debug () dump (stderr); } -back_threader_registry::back_threader_registry (int max_allowable_paths) - : m_max_allowable_paths (max_allowable_paths) +back_threader_registry::back_threader_registry () { m_threaded_paths = 0; } @@ -594,15 +591,6 @@ back_threader_profitability::profitable_path_p (const vec &m_path, if (m_path.length () <= 1) return false; - if (m_path.length () > (unsigned) param_max_fsm_thread_length) - { - if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, " FAIL: Jump-thread path not considered: " - "the number of basic blocks on the path " - "exceeds PARAM_MAX_FSM_THREAD_LENGTH.\n"); - return false; - } - int n_insns = 0; gimple_stmt_iterator gsi; loop_p loop = m_path[0]->loop_father; @@ -885,15 +873,6 @@ bool back_threader_registry::register_path (const vec &m_path, edge taken_edge) { - if (m_threaded_paths > m_max_allowable_paths) - { - if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, " FAIL: Jump-thread path not considered: " - "the number of previously recorded paths to " - "thread exceeds PARAM_MAX_FSM_THREAD_PATHS.\n"); - return false; - } - vec *jump_thread_path = m_lowlevel_registry.allocate_thread_path ();