From patchwork Fri Mar 13 14:25:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 1254420 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz 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 48f7K43zC1z9sNg for ; Sat, 14 Mar 2020 01:25:43 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C856B3AA8437; Fri, 13 Mar 2020 14:25:38 +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 C2CD73945C21 for ; Fri, 13 Mar 2020 14:25:36 +0000 (GMT) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9C056B14B; Fri, 13 Mar 2020 14:25:35 +0000 (UTC) From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Increase min-lto-partition. To: gcc-patches@gcc.gnu.org Message-ID: Date: Fri, 13 Mar 2020 15:25:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS 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: , Cc: Jan Hubicka Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi. I played a bit with -flinker-output=nolto-rel of gimple-match.ii and I identified that current default of min-lto-partition leads to too many LTRANS. We pay with LTO overhead and so that user time is high. Base is: $ g++ -O2 /tmp/gimple-match.ii -c -fno-checking -o x.o real 0m40.130s user 0m39.911s LGEN: $ time g++ -O2 /tmp/gimple-match.ii -c -flto -fno-checking real 0m8.709s user 0m8.543s WPA+LTRANS: $ time gcc -flto=auto -flinker-output=nolto-rel gimple-match.o -r -o gimple-match2.o --param lto-partitions=4 -fno-checking real 0m11.220s user 0m33.067s $ time gcc -flto=auto -flinker-output=nolto-rel gimple-match.o -r -o gimple-match2.o --param lto-partitions=6 -fno-checking real 0m9.880s user 0m35.599s $ time gcc -flto=auto -flinker-output=nolto-rel gimple-match.o -r -o gimple-match2.o --param lto-partitions=8 -fno-checking real 0m6.681s user 0m39.746s default: $ time gcc -flto=auto -flinker-output=nolto-rel gimple-match.o -r -o gimple-match2.o -fno-checking real 0m6.065s user 1m22.698s So I would recommend to set the param value to 75000, which leads to 6 partitions. That would be: 9+10s = 19s vs. 40s (total real time 44s). That seems reasonable to me. Thoughts? Thanks, Martin gcc/ChangeLog: 2020-03-13 Martin Liska * params.opt: Bump min-lto-partition in order to not create too many LTRANS. --- gcc/params.opt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/params.opt b/gcc/params.opt index e39216aa7d0..49fafac20af 100644 --- a/gcc/params.opt +++ b/gcc/params.opt @@ -363,7 +363,7 @@ Common Joined UInteger Var(param_max_lto_streaming_parallelism) Init(32) Integer maximal number of LTO partitions streamed in parallel. -param=lto-min-partition= -Common Joined UInteger Var(param_min_partition_size) Init(10000) Param +Common Joined UInteger Var(param_min_partition_size) Init(75000) Param Minimal size of a partition for LTO (in estimated instructions). -param=lto-partitions=