On Wed, Apr 14, 2021 at 06:55:56PM +0100, Richard Sandiford wrote: > Segher Boessenkool <seg...@kernel.crashing.org> writes: > > The REGNO checks work fine for pseudos as well. But, why does it do > > this at all, instead of using match_dup? That should be clearer. > > The register is appearing in two different modes: GPI for operand 1 > and something smaller than GPI for operand 3 (otherwise the extension > would be ill-formed). That's what makes it specific to hard registers.
You write your patterns with subregs for that? That works fine for a mode change on hard regs as well, afaik. > > The point of make_more_copies is that the hard registers from function > > arguments are not pushed down by combine into actual instructions. This > > can be done by RA if it thinks that is a good idea, and not done if it > > thinks it is a bad idea. Having combine usurp part of the register > > allocators role is not a good idea. > > > > There are other reasons hard regs can still end up in RTL insns in > > earlier RTL passes of course, but the other changes that went together > > with make_more_copies stop combine from doing that a lot (the function > > itself makes sure every hard reg is copied to a new pseudo, because > > combining that trivial move (from that new pseudo to the pseudo it was > > copying it to already!) can still be beneficial for other reasons, all > > strange and pretty unhappy, but important on many targets). > > What would your recommendation be for this pattern? Is matching > hard registers a bad idea, or should we go with it? I would just use a subreg, and match_dup. But maybe I am missing something? Segher