public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/3] function: Do the CLEANUP_EXPENSIVE after shrink-wrapping, not before
@ 2016-05-17  1:09 Segher Boessenkool
  2016-05-17  1:09 ` [PATCH 2/3] function: Factor out make_*logue_seq Segher Boessenkool
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Segher Boessenkool @ 2016-05-17  1:09 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool

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

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

end of thread, other threads:[~2016-05-20 21:27 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-17  1:09 [PATCH 1/3] function: Do the CLEANUP_EXPENSIVE after shrink-wrapping, not before Segher Boessenkool
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

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