* [committed] [PR target/103722] Fix register_move_cost for the sh
@ 2022-05-28 18:14 Jeff Law
0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2022-05-28 18:14 UTC (permalink / raw)
To: 'GCC Patches'
[-- Attachment #1: Type: text/plain, Size: 442 bytes --]
As outlined in the BZ the sh is returning cost 2 for various reg->reg
moves. Cost 2 has special meaning to reload and prevents the insns from
being re-recognized. Vlad's patch bumps the cost to 7. Other values
might be better, but given this has been languishing for ~6 months and
there are no signs of an SH expert stepping in to provide a better
value, I'm going with Vlad's patch from the PR as-is.
Committed to the trunk,
Jeff
[-- Attachment #2: P --]
[-- Type: text/plain, Size: 880 bytes --]
commit 42d8fb2d4569e9930e277b01170bfd3586bf94d3
Author: Vladimir Makarov <vmakarov@gcc.gnu.org>
Date: Sat May 28 12:08:38 2022 -0600
Fix ICE on sh
gcc/
PR target/103722
* config/sh/sh.c (sh_register_move_cost): Avoid cost "2" (which
is special) for various scenarios.
diff --git a/gcc/config/sh/sh.cc b/gcc/config/sh/sh.cc
index 8d4056338a5..03e1c04ec7e 100644
--- a/gcc/config/sh/sh.cc
+++ b/gcc/config/sh/sh.cc
@@ -10762,6 +10762,12 @@ sh_register_move_cost (machine_mode mode,
&& ! REGCLASS_HAS_GENERAL_REG (dstclass))
return 2 * ((GET_MODE_SIZE (mode) + 7) / 8U);
+ if (((dstclass == FP_REGS || dstclass == DF_REGS)
+ && (srcclass == PR_REGS))
+ || ((srcclass == FP_REGS || srcclass == DF_REGS)
+ && (dstclass == PR_REGS)))
+ return 7;
+
return 2 * ((GET_MODE_SIZE (mode) + 3) / 4U);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-28 18:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-28 18:14 [committed] [PR target/103722] Fix register_move_cost for the sh 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).