public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5978] regrename: Skip renaming if instruction is noop move.
@ 2021-12-14 21:56 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2021-12-14 21:56 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a888259a71fbbb7f14923751251e056829d76342

commit r12-5978-ga888259a71fbbb7f14923751251e056829d76342
Author: JoJo R <rjiejie@linux.alibaba.com>
Date:   Tue Dec 14 16:55:57 2021 -0500

    regrename: Skip renaming if instruction is noop move.
    
    gcc/
            * regrename.c (find_rename_reg): Return satisfied regno
            if instruction is noop move.

Diff:
---
 gcc/regrename.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/regrename.c b/gcc/regrename.c
index b8a9ca36f22..fe72fcc3624 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -394,6 +394,11 @@ find_rename_reg (du_head_p this_head, enum reg_class super_class,
 			  this_head, *unavailable))
     return this_head->tied_chain->regno;
 
+  /* If this insn is a noop move, then do not rename in this chain as doing so
+     would inhibit removal of the noop move.  */
+  if (noop_move_p (this_head->first->insn))
+    return best_new_reg;
+
   /* If PREFERRED_CLASS is not NO_REGS, we iterate in the first pass
      over registers that belong to PREFERRED_CLASS and try to find the
      best register within the class.  If that failed, we iterate in


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

only message in thread, other threads:[~2021-12-14 21:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 21:56 [gcc r12-5978] regrename: Skip renaming if instruction is noop move Jeff Law

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