From patchwork Wed Nov 23 09:40:23 2022 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: 24826 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2688187wrr; Wed, 23 Nov 2022 01:40:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf5PQ3OgxmPqKU11zerNjYxMoyzt2gK5JrWh5vnvjybVkHq1yxIQkrkz0l/N6Swei4FqspyA X-Received: by 2002:aa7:da0f:0:b0:469:a437:ddf with SMTP id r15-20020aa7da0f000000b00469a4370ddfmr7649237eds.421.1669196453107; Wed, 23 Nov 2022 01:40:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669196453; cv=none; d=google.com; s=arc-20160816; b=IdTaDeePImBSfL0v0i0dq41hFrsGyqPl8U76wdCxXSJfrCtWTSfSbyC4YkB7YFc8Lt cXuWkTGeJxum4Teb0PE+y98AKtsf9YYRKUGz843nl58Z6o31LujUUnbhx0uhYN7qeXub vJKMmSSUAGHhwb0XemmnPQgp6R9nmVgijEGPJU6Kxuu46zHMzxh6rH0qrOsy/QoJHa/L nIIgH0RWKfELjIWwAtOKN0XuY2eAiIXLhED7pUyd2kp53W6mJF89pGzUTtWwP0fObyUy L7SNXzwMOGOEgNl3cTFuaBXt+LCT+5CgGLRVQZDBSyoH/l5juJU29D9ZXMtiKn26mhle kXew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding:cc :content-language:to:subject:from:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature:dmarc-filter:delivered-to; bh=x7fpSouBEZzIH3Fdzuj5MqOjLF3eI3NxqRma8rNJ4A4=; b=M98k+IWRX7BHWidfY62ZSRsPOb0V8QlrrAnj1K2eOPkqQ2N4UKCKpoT4IgvMvWkiKn GzM9Kg/K9ahva33NFWhzX4I2NhRgnq5j4X9ZLmo8YdJfSBocB9j/APxpYo33fJSN3rfe zQ77LHp5iOPr+I+P3BS5pTCOOKB5aXgklcTZPuL2kL+SFfHHs5cDHd036+iCg1xhqGku ULG06jO5QD22ySHDdZK5UvaelqL69icwZi29AiaSGfO2RNvKjPh7Ki8H8i8N3IAiKUAI UTh6brijZV7fCZ6JqU9Ia2YhVhkQVK3YE0cXVh7viZoLFDj8qQAwRrYYtPnCLAsEfDXO PJag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=wCOHbzVr; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=WePaJ8OJ; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id w3-20020a1709064a0300b0070fc7c9d71dsi10832816eju.989.2022.11.23.01.40.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Nov 2022 01:40:53 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=wCOHbzVr; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=WePaJ8OJ; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 84CBC3852C53 for ; Wed, 23 Nov 2022 09:40:49 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 92C483858020 for ; Wed, 23 Nov 2022 09:40:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 92C483858020 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 239A61F8CB; Wed, 23 Nov 2022 09:40:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1669196424; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x7fpSouBEZzIH3Fdzuj5MqOjLF3eI3NxqRma8rNJ4A4=; b=wCOHbzVr4FKxtffv5/Mqn9NA7qXqzJ3d/7YN9fPeiH/uTyQmoHWMnmOIBxWlGgjQjlyrqX rDqMp7TRp5u19zJhhTxXO/fNpk8iwdFgEolVP3e3z2bvoQckWGlrvUNdcnQhZ9kV7TZofk +ZyZj0GEmLmtURTZpi9gIbt24wexbS8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1669196424; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x7fpSouBEZzIH3Fdzuj5MqOjLF3eI3NxqRma8rNJ4A4=; b=WePaJ8OJ/AZ2kJSo3P2he3D7bm1w042eZ766rPCeVCfCTsvIGAp9RUbvDuAE1yxsVCR2xn yq8gl5TKWXcuVnBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 016B613AE7; Wed, 23 Nov 2022 09:40:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Xx/qOofqfWPRFQAAMHmgww (envelope-from ); Wed, 23 Nov 2022 09:40:23 +0000 Message-ID: Date: Wed, 23 Nov 2022 10:40:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] lto: fix usage of timer in materialize_cgraph To: gcc-patches@gcc.gnu.org Content-Language: en-US Cc: Martin Jambor X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750279339858382900?= X-GMAIL-MSGID: =?utf-8?q?1750279339858382900?= Pretty obvious change. Ready to be installed? Thanks, Martin PR lto/107829 gcc/lto/ChangeLog: * lto.cc (materialize_cgraph): Call timevar_push before materialization starts. --- gcc/lto/lto.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gcc/lto/lto.cc b/gcc/lto/lto.cc index 3a9147b01b5..3265a1d07bc 100644 --- a/gcc/lto/lto.cc +++ b/gcc/lto/lto.cc @@ -137,6 +137,12 @@ materialize_cgraph (void) fprintf (stderr, flag_wpa ? "Materializing decls:" : "Reading function bodies:"); + /* Start the appropriate timer depending on the mode that we are + operating in. */ + lto_timer = (flag_wpa) ? TV_WHOPR_WPA + : (flag_ltrans) ? TV_WHOPR_LTRANS + : TV_LTO; + timevar_push (lto_timer); FOR_EACH_FUNCTION (node) { @@ -147,14 +153,6 @@ materialize_cgraph (void) } } - - /* Start the appropriate timer depending on the mode that we are - operating in. */ - lto_timer = (flag_wpa) ? TV_WHOPR_WPA - : (flag_ltrans) ? TV_WHOPR_LTRANS - : TV_LTO; - timevar_push (lto_timer); - current_function_decl = NULL; set_cfun (NULL);