From patchwork Fri Jan 29 13:01:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1433303 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=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 4DRyBy24Clz9sVt for ; Sat, 30 Jan 2021 00:01:11 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 16A913938C3A; Fri, 29 Jan 2021 13:01:08 +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 597B6385702C for ; Fri, 29 Jan 2021 13:01:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 597B6385702C 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 206F3ACB0 for ; Fri, 29 Jan 2021 13:01:05 +0000 (UTC) Date: Fri, 29 Jan 2021 14:01:04 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] change unit of --param max-gcse-memory to kB Message-ID: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 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 changes it from bytes to kB since its value is limited to 2147483648. Bootstrap running on x86_64-unknown-linux-gnu, will push to trunk (but only there). 2021-01-29 Richard Biener * doc/invoke.texi (--param max-gcse-memory): Document unit of size. * gcse.c (gcse_or_cprop_is_too_expensive): Adjust. * params.opt (--param max-gcse-memory): Adjust default and document unit of size. --- gcc/doc/invoke.texi | 2 +- gcc/gcse.c | 4 ++-- gcc/params.opt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index d9e49c4a0da..a89d3859d6d 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -13075,7 +13075,7 @@ should be removed when the delay slot code is rewritten to maintain the control-flow graph. @item max-gcse-memory -The approximate maximum amount of memory that can be allocated in +The approximate maximum amount of memory in @code{kB} that can be allocated in order to perform the global common subexpression elimination optimization. If more memory than specified is required, the optimization is not done. diff --git a/gcc/gcse.c b/gcc/gcse.c index 29c9f900a8c..2c81fe41336 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -4007,14 +4007,14 @@ gcse_or_cprop_is_too_expensive (const char *pass) /* If allocating memory for the dataflow bitmaps would take up too much storage it's better just to disable the optimization. */ - if (memory_request > (unsigned HOST_WIDE_INT)param_max_gcse_memory) + if (memory_request / 1024 > (unsigned HOST_WIDE_INT)param_max_gcse_memory) { warning (OPT_Wdisabled_optimization, "%s: %d basic blocks and %d registers; " "increase %<--param max-gcse-memory%> above " HOST_WIDE_INT_PRINT_UNSIGNED, pass, n_basic_blocks_for_fn (cfun), max_reg_num (), - memory_request); + memory_request / 1024); return true; } diff --git a/gcc/params.opt b/gcc/params.opt index cfed980a4d2..dff8a331f82 100644 --- a/gcc/params.opt +++ b/gcc/params.opt @@ -514,8 +514,8 @@ Common Joined UInteger Var(param_max_gcse_insertion_ratio) Init(20) Param Optimi The maximum ratio of insertions to deletions of expressions in GCSE. -param=max-gcse-memory= -Common Joined UInteger Var(param_max_gcse_memory) Init(134217728) Param Optimization -The maximum amount of memory to be allocated by GCSE. +Common Joined UInteger Var(param_max_gcse_memory) Init(131072) Param Optimization +The maximum amount of memory to be allocated by GCSE, in kilobytes. -param=max-goto-duplication-insns= Common Joined UInteger Var(param_max_goto_duplication_insns) Init(8) Param Optimization