From: Jojo R <rjiejie@linux.alibaba.com>
To: rjiejie@linux.alibaba.com, gcc-patches@gcc.gnu.org,
jeffreyalaw@gmail.com, richard.guenther@gmail.com,
kito.cheng@gmail.com
Subject: [PATCH v2] regrename: Skip renaming if instruction is noop move.
Date: Fri, 3 Dec 2021 12:26:35 +0800 [thread overview]
Message-ID: <20211203042635.5547-1-rjiejie@linux.alibaba.com> (raw)
In-Reply-To: <5cd26688-13a7-c1cc-f4ef-abaf1b806b23@gmail.com>
Skip renaming if instruction is noop move, and it will
been removed for performance.
gcc/
* regrename.c (find_rename_reg): Return satisfied regno
if instruction is noop move.
---
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
--
2.24.3 (Apple Git-128)
next prev parent reply other threads:[~2021-12-03 4:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 11:44 [PATCH] " Jojo R
2021-11-16 12:12 ` Richard Biener
2021-11-17 2:20 ` Jojo R
2021-11-18 16:13 ` Jeff Law
2021-11-19 6:23 ` Jojo R
2021-12-02 18:24 ` Jeff Law
2021-12-03 4:26 ` Jojo R [this message]
2021-12-03 14:57 ` [PATCH v2] " Jeff Law
2021-12-14 1:40 ` Jojo R
2021-12-14 21:56 ` Jeff Law
2021-12-03 3:35 Jojo R
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=20211203042635.5547-1-rjiejie@linux.alibaba.com \
--to=rjiejie@linux.alibaba.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@gmail.com \
--cc=kito.cheng@gmail.com \
--cc=richard.guenther@gmail.com \
/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).