public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: gcc-patches@gcc.gnu.org
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Subject: [PATCH 1/3] function: Do the CLEANUP_EXPENSIVE after shrink-wrapping, not before
Date: Tue, 17 May 2016 01:09:00 -0000	[thread overview]
Message-ID: <213485283eede9da12b217737d95fc8f5c4be442.1463428211.git.segher@kernel.crashing.org> (raw)

We should do CLEANUP_EXPENSIVE after shrink-wrapping, because shrink-
wrapping creates constructs that CLEANUP_EXPENSIVE can optimise, and
nothing runs CLEANUP_EXPENSIVE later.  We don't need cleanup_cfg before
shrink-wrapping, nothing in shrink-wrapping (or the other *logue insertion
code) cares at all.

Tested this (and the other two patches in this series) on powerpc64-linux
(-m32/-m64, -mlra/-mno-lra); on powerpc64le-linux; and on x86_64-linux.
No regressions.

Is this okay for trunk?


Segher


2016-05-16  Segher Boessenkool  <segher@kernel.crashing.org>

	* function.c (rest_of_handle_thread_prologue_and_epilogue): Call
	cleanup_cfg with CLEANUP_EXPENSIVE after shrink-wrapping.  Don't
	call cleanup_cfg before shrink-wrapping.

---
 gcc/function.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gcc/function.c b/gcc/function.c
index 70584b9..b9a6338 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6369,9 +6369,6 @@ make_pass_leaf_regs (gcc::context *ctxt)
 static unsigned int
 rest_of_handle_thread_prologue_and_epilogue (void)
 {
-  if (optimize)
-    cleanup_cfg (CLEANUP_EXPENSIVE);
-
   /* On some machines, the prologue and epilogue code, or parts thereof,
      can be represented as RTL.  Doing so lets us schedule insns between
      it and the rest of the code and also allows delayed branch
@@ -6384,7 +6381,7 @@ rest_of_handle_thread_prologue_and_epilogue (void)
 
   /* Shrink-wrapping can result in unreachable edges in the epilogue,
      see PR57320.  */
-  cleanup_cfg (0);
+  cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0);
 
   /* The stack usage info is finalized during prologue expansion.  */
   if (flag_stack_usage_info)
-- 
1.9.3

             reply	other threads:[~2016-05-17  1:09 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17  1:09 Segher Boessenkool [this message]
2016-05-17  1:09 ` [PATCH 2/3] function: Factor out make_*logue_seq Segher Boessenkool
2016-05-17 20:35   ` Jeff Law
2016-05-18 17:17   ` H.J. Lu
2016-05-18 18:11     ` Segher Boessenkool
2016-05-18 18:20       ` H.J. Lu
2016-05-18 18:24         ` H.J. Lu
2016-05-18 18:35         ` Segher Boessenkool
2016-05-18 22:13           ` Segher Boessenkool
2016-05-19  7:16             ` Jakub Jelinek
2016-05-19  7:28               ` Segher Boessenkool
2016-05-19  7:41                 ` Jakub Jelinek
2016-05-19 17:20               ` Jeff Law
2016-05-17  1:09 ` [PATCH 3/3] function: Restructure *logue insertion Segher Boessenkool
2016-05-19  8:04   ` Segher Boessenkool
2016-05-19 22:00   ` Jeff Law
2016-05-19 22:20     ` Segher Boessenkool
2016-05-20  9:28       ` Thomas Schwinge
2016-05-20 13:21         ` Thomas Schwinge
2016-05-20 14:47           ` Nathan Sidwell
2016-05-20 15:35             ` Segher Boessenkool
2016-05-20 21:27         ` Segher Boessenkool
2016-05-17  8:06 ` [PATCH 1/3] function: Do the CLEANUP_EXPENSIVE after shrink-wrapping, not before Eric Botcazou
2016-05-17  8:47   ` Segher Boessenkool
2016-05-17  9:08     ` Eric Botcazou
2016-05-17  9:18       ` Segher Boessenkool
2016-05-17 22:23         ` Segher Boessenkool
2016-05-17 22:34           ` Eric Botcazou

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=213485283eede9da12b217737d95fc8f5c4be442.1463428211.git.segher@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --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).