public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Add support for operand-specific alignment requirements
@ 2023-11-12 14:52 Richard Sandiford
  2023-11-12 14:52 ` [PATCH 1/5] Add register filter operand to define_register_constraint Richard Sandiford
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Richard Sandiford @ 2023-11-12 14:52 UTC (permalink / raw)
  To: jlaw, vmakarov, gcc-patches; +Cc: Richard Sandiford

SME has various instructions that require aligned register tuples.
However, the associated tuple modes are already widely used and do
not need to be aligned in other contexts.  It therefore isn't
appropriate to force alignment in TARGET_HARD_REGNO_MODE_OK.

There are also strided loads and stores that require:

- (regno & 0x8) == 0 for 2-register tuples
- (regno & 0xc) == 0 for 4-register tuples

Although the requirements for strided loads and stores could be
enforced by C++ conditions on the insn, it's convenient to handle
them in the same way as alignment.

This series of patches therefore adds a way for register constraints
to specify which start registers are valid and which aren't.  Most of
the details are in the covering note to the first patch.

This is clearly changing a performance-sensitive part of the compiler.
I've tried to ensure that the overhead is only small for targets that
use the new feature.  Almost all of the new code gets optimised away
on targets that don't use the feature.

Richard Sandiford (5):
  Add register filter operand to define_register_constraint
  recog: Handle register filters
  lra: Handle register filters
  ira: Handle register filters
  Add an aligned_register_operand predicate

 gcc/common.md          |  28 ++++++++
 gcc/doc/md.texi        |  41 +++++++++++-
 gcc/doc/tm.texi        |   3 +-
 gcc/doc/tm.texi.in     |   3 +-
 gcc/genconfig.cc       |   2 +
 gcc/genpreds.cc        | 146 ++++++++++++++++++++++++++++++++++++++++-
 gcc/gensupport.cc      |  48 +++++++++++++-
 gcc/gensupport.h       |   3 +
 gcc/ira-build.cc       |   8 +++
 gcc/ira-color.cc       |  10 +++
 gcc/ira-int.h          |  14 ++++
 gcc/ira-lives.cc       |  61 +++++++++++++++++
 gcc/lra-constraints.cc |  13 +++-
 gcc/recog.cc           |  14 +++-
 gcc/recog.h            |  24 ++++++-
 gcc/reginfo.cc         |   5 ++
 gcc/rtl.def            |   6 +-
 gcc/target-globals.cc  |   6 +-
 gcc/target-globals.h   |   3 +
 19 files changed, 421 insertions(+), 17 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH 0/5] Add support for operand-specific alignment requirements
@ 2023-11-22  9:47 juzhe.zhong
  2023-11-22 10:08 ` Richard Sandiford
  0 siblings, 1 reply; 14+ messages in thread
From: juzhe.zhong @ 2023-11-22  9:47 UTC (permalink / raw)
  To: gcc-patches; +Cc: richard.sandiford, vmakarov, kito.cheng

[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

Hi, Richard.

Thanks for supporting register filter in IRA/LRA.
I found it is useful for RVV since we have a set of widen operations that allow source register overlap highpart of dest register group

For example, if vsext.vf2 v0(dest consume reg v0 and reg v1), v1 (source consume v1 only)
I want to support the highpart overlap above. (Currently, we don't any overlap between source and dest in such instructions).

So, I wonder whether we can pass "machine_mode" into register filter. Ok, I think it's too late since stage 1 closes. I wonder we can add it in GCC-15?

Thanks. 



juzhe.zhong@rivai.ai

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-11-24  9:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-12 14:52 [PATCH 0/5] Add support for operand-specific alignment requirements Richard Sandiford
2023-11-12 14:52 ` [PATCH 1/5] Add register filter operand to define_register_constraint Richard Sandiford
2023-11-19 21:49   ` Jeff Law
2023-11-12 14:52 ` [PATCH 2/5] recog: Handle register filters Richard Sandiford
2023-11-19 21:51   ` Jeff Law
2023-11-12 14:52 ` [PATCH 3/5] lra: " Richard Sandiford
2023-11-12 14:52 ` [PATCH 4/5] ira: " Richard Sandiford
2023-11-12 14:52 ` [PATCH 5/5] Add an aligned_register_operand predicate Richard Sandiford
2023-11-19 21:52   ` Jeff Law
2023-11-14  0:01 ` [PATCH 0/5] Add support for operand-specific alignment requirements Vladimir Makarov
2023-11-22  9:47 juzhe.zhong
2023-11-22 10:08 ` Richard Sandiford
2023-11-22 22:32   ` 钟居哲
2023-11-23 18:18     ` Richard Sandiford
2023-11-24  6:42       ` juzhe.zhong
2023-11-24  9:55         ` Richard Sandiford

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