From patchwork Thu Oct 6 17:25:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 1687128 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.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=n2wqTtrm; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MjyzW0nzQz1yqn for ; Fri, 7 Oct 2022 04:26:46 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EBD81385C318 for ; Thu, 6 Oct 2022 17:26:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EBD81385C318 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665077204; bh=UeChQin9uCPochsyic8JOVFANh+OrkvKuiCaYgJM8O8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=n2wqTtrmbYh5+50YF4zRLMW7JzO7HMBMbAvJ/4k1VmWRjcvYz5kdkVVnNDFEyaPLs eKKxKsD0JoaAPPbIrXiH2eVQPlZH9HodT6UiIHHNZDeRy3e1zDoxOwPtv9Na+jvIen nIKjyNo+okU/t53EesAYzrXoJo1tJd5pJasZA/Fw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 9F1833856DC2 for ; Thu, 6 Oct 2022 17:26:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9F1833856DC2 Received: by mail-wr1-x42c.google.com with SMTP id u10so3757715wrq.2 for ; Thu, 06 Oct 2022 10:26:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UeChQin9uCPochsyic8JOVFANh+OrkvKuiCaYgJM8O8=; b=4lE3wV2bcXR1jMqVtuaFEFl4UO54HT+a/s4fwwT339LEizz3Ssb6ESVSHbsmzdq2B3 uhjW4nDqxznek47yHesuauBWWlwAiMDcjUN3jNDEXM3nd5+Lqq8N00rSPeMV37Z0gh/S xXA5grBn16beXuQf9Ldc3rwiAn5KPeZtFbcsnf+bv4yTriQ0CXBAJb6seMXXK1xltqi5 c1d9SY+3CBKVIu5E4jArt8CwLWrSMdbKDotoRZYBezFhDxm/7QmXggbzFcIAQUb5FY01 bgODiRz57bdsawHWFplrypyPAH/tYlxf7TO37y6m01HUdyvjapGZz8K1qw5Tt6W5c1jR QzrA== X-Gm-Message-State: ACrzQf3dnYl+AO/o92HV4qoROviFOvM4gmSbxdsHjm+12SHE0psHy3nC fy08oRSyW+cZhRxY/GEHHKGG85V5EPsOuQ== X-Google-Smtp-Source: AMsMyM7RfMrClgVJElt8npgCkXmzbadWWvuCOpbpyUGFR+UHf4PEfTKqLJdf00RbwzyYjZayC/wUFw== X-Received: by 2002:adf:d1c2:0:b0:22e:6499:3137 with SMTP id b2-20020adfd1c2000000b0022e64993137mr731810wrd.658.1665077182320; Thu, 06 Oct 2022 10:26:22 -0700 (PDT) Received: from fomalhaut.localnet ([2a01:e0a:8d5:d990:e654:e8ff:fe8f:2ce6]) by smtp.gmail.com with ESMTPSA id g6-20020a5d4886000000b0022cc6b8df5esm5298wrq.7.2022.10.06.10.26.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 10:26:21 -0700 (PDT) X-Google-Original-From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [PATCH] Reduce DF computation at -O0 Date: Thu, 06 Oct 2022 19:25:53 +0200 Message-ID: <2601473.BddDVKsqQX@fomalhaut> MIME-Version: 1.0 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: , X-Patchwork-Original-From: Eric Botcazou via Gcc-patches From: Eric Botcazou Reply-To: Eric Botcazou Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi, even at -O0 there may be a fair amount of DF computation performed when compiling large units and part of it appears to be useless. Bootstrapped/regtested on x86-64/Linux, OK for the mainline? 2022-10-06 Eric Botcazou * function.cc (thread_prologue_and_epilogue_insns): Update only entry and exit blocks when not optimizing. Remove dead statement. diff --git a/gcc/function.cc b/gcc/function.cc index 5498a712c4a..6474a663b30 100644 --- a/gcc/function.cc +++ b/gcc/function.cc @@ -6249,10 +6249,15 @@ thread_prologue_and_epilogue_insns (void) } } - /* Threading the prologue and epilogue changes the artificial refs - in the entry and exit blocks. */ - epilogue_completed = 1; - df_update_entry_exit_and_calls (); + /* Threading the prologue and epilogue changes the artificial refs in the + entry and exit blocks, and may invalidate DF info for tail calls. */ + if (optimize) + df_update_entry_exit_and_calls (); + else + { + df_update_entry_block_defs (); + df_update_exit_block_uses (); + } } /* Reposition the prologue-end and epilogue-begin notes after