public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Reduce DF computation at -O0
@ 2022-10-06 17:25 Eric Botcazou
  2022-10-07  6:07 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Botcazou @ 2022-10-06 17:25 UTC (permalink / raw)
  To: gcc-patches

[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Reduce DF computation at -O0
  2022-10-06 17:25 [PATCH] Reduce DF computation at -O0 Eric Botcazou
@ 2022-10-07  6:07 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2022-10-07  6:07 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc-patches

On Thu, Oct 6, 2022 at 7:27 PM Eric Botcazou via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> 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?

OK.

>
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-07  6:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06 17:25 [PATCH] Reduce DF computation at -O0 Eric Botcazou
2022-10-07  6:07 ` Richard Biener

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).