public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Botcazou <botcazou@adacore.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Reduce DF computation at -O0
Date: Thu, 06 Oct 2022 19:25:53 +0200	[thread overview]
Message-ID: <2601473.BddDVKsqQX@fomalhaut> (raw)

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

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  <ebotcazou@adacore.com>

	* function.cc (thread_prologue_and_epilogue_insns): Update only entry
	and exit blocks when not optimizing.  Remove dead statement.

-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 758 bytes --]

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

             reply	other threads:[~2022-10-06 17:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06 17:25 Eric Botcazou [this message]
2022-10-07  6:07 ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2601473.BddDVKsqQX@fomalhaut \
    --to=botcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).