public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] combine: More make_more_copies
@ 2018-11-10 23:06 Segher Boessenkool
  0 siblings, 0 replies; only message in thread
From: Segher Boessenkool @ 2018-11-10 23:06 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool

This makes make_more_copies do what its documentation says, that is,
only make an intermediate pseudo if copying to a pseudo.

This regressed generated code quality when we didn't keep the original
notes that were on the copy, but since r265582 we do, and only allowing
pseudos now is a win.  It also simplifies the code.

Committing.


Segher


2018-11-10  Segher Boessenkool  <segher@kernel.crashing.org>

	* combine.c (make_more_copies): Only make an intermediate copy if the
	dest of a move is a pseudo.

---
 gcc/combine.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gcc/combine.c b/gcc/combine.c
index 77eeae7..c314206 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -14990,12 +14990,11 @@ make_more_copies (void)
 	  rtx set = single_set (insn);
 	  if (!set)
 	    continue;
+
 	  rtx dest = SET_DEST (set);
-	  if (dest == pc_rtx)
-	    continue;
-	  /* See PR87871.  */
-	  if (dest == frame_pointer_rtx)
-	    continue;
+	  if (!(REG_P (dest) && !HARD_REGISTER_P (dest)))
+	      continue;
+
 	  rtx src = SET_SRC (set);
 	  if (!(REG_P (src) && HARD_REGISTER_P (src)))
 	    continue;
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-10 23:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-10 23:06 [PATCH] combine: More make_more_copies Segher Boessenkool

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