public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hp@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6990] cris: Don't discriminate against ALL_REGS in TARGET_REGISTER_MOVE_COST Date: Wed, 2 Feb 2022 00:20:44 +0000 (GMT) [thread overview] Message-ID: <20220202002044.906BD385781E@sourceware.org> (raw) https://gcc.gnu.org/g:9a7f14ef9b6b287d99b8240cdb43e8fe089ea9b3 commit r12-6990-g9a7f14ef9b6b287d99b8240cdb43e8fe089ea9b3 Author: Hans-Peter Nilsson <hp@axis.com> Date: Wed Feb 2 00:00:10 2022 +0100 cris: Don't discriminate against ALL_REGS in TARGET_REGISTER_MOVE_COST When the tightest class including both SPECIAL_REGS and GENERAL_REGS is ALL_REGS, artificially special-casing for *either* to or from, hits artificially hard. This gets the port back to the code quality before the previous patch ("cris: Remove CRIS v32 ACR artefacts") - except for_vfprintf_r and _vfiprintf_r in newlib (still .8 and .4% larger). gcc: * config/cris/cris.cc (cris_register_move_cost): Remove special pre-ira extra cost for ALL_REGS. Diff: --- gcc/config/cris/cris.cc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/gcc/config/cris/cris.cc b/gcc/config/cris/cris.cc index 264439c7654..4f977221f45 100644 --- a/gcc/config/cris/cris.cc +++ b/gcc/config/cris/cris.cc @@ -1683,20 +1683,10 @@ cris_register_move_cost (machine_mode mode ATTRIBUTE_UNUSED, their move cost within that class is higher. How about 7? That's 3 for a move to a GENERAL_REGS register, 3 for the move from the GENERAL_REGS register, and 1 for the increased register pressure. - Also, it's higher than the memory move cost, as it should. - We also do this for ALL_REGS, since we don't want that class to be - preferred (even to memory) at all where GENERAL_REGS doesn't fit. - Whenever it's about to be used, it's for SPECIAL_REGS. If we don't - present a higher cost for ALL_REGS than memory, a SPECIAL_REGS may be - used when a GENERAL_REGS should be used, even if there are call-saved - GENERAL_REGS left to allocate. This is because the fall-back when - the most preferred register class isn't available, isn't the next - (or next good) wider register class, but the *most widest* register - class. FIXME: pre-IRA comment, perhaps obsolete now. */ - - if ((reg_classes_intersect_p (from, SPECIAL_REGS) - && reg_classes_intersect_p (to, SPECIAL_REGS)) - || from == ALL_REGS || to == ALL_REGS) + Also, it's higher than the memory move cost, as it should be. */ + + if (reg_classes_intersect_p (from, SPECIAL_REGS) + && reg_classes_intersect_p (to, SPECIAL_REGS)) return 7; /* Make moves to/from SPECIAL_REGS slightly more expensive, as we
reply other threads:[~2022-02-02 0:20 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220202002044.906BD385781E@sourceware.org \ --to=hp@gcc.gnu.org \ --cc=gcc-cvs@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: linkBe 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).