On Wed, Apr 14, 2021 at 08:01:11PM +0200, Jakub Jelinek wrote:
> On Wed, Apr 14, 2021 at 12:46:43PM -0500, Segher Boessenkool wrote:
> > 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.
> 
> Because with the hard regs it has different modes, so match_dup
> wouldn't work.

A subreg:QI of the match_dup should match fine.  You can use a subreg
wherever GCC tries to match a reg.

> match_dup means insn-recog.c calls rtx_equal_p and that returns false if the
> mode is not the same.

Yes, but they are the same :-)

(reg:SI whatever)  and  (subreg:QI (reg:SI whatever) 0)

> Before combine the 3 insns are:
> (insn 2 4 3 2 (set (reg/v:SI 96 [ i ])
>         (zero_extend:SI (reg:QI 0 x0 [ i ]))) "pr100056.c":10:1 114 
> {*zero_extendqisi2_aarch64}
>      (expr_list:REG_DEAD (reg:QI 0 x0 [ i ])
>         (nil)))

> and I must say I don't know if make_more_copies was meant to
> split insn 2 into (set (reg:QI pseudo) (reg:QI 0 x0)) and
> (set (reg/v:SI 96) (zero_extend:SI (reg:QI pseudo)))
> or not.

It makes

(set (reg:QI new) (reg:QI x0))
(set (reg:SI 96) (zero_extend:SI (reg:QI new)))

The point is it keeps exactly the same form, but no hard regs anymore.


Segher

Reply via email to