> On Oct 14, 2022, at 12:18 PM, Segher Boessenkool <seg...@kernel.crashing.org> 
> wrote:
> 
> On Fri, Oct 14, 2022 at 12:36:47AM +0000, Koning, Paul wrote:
>> I guess I'll have to look harder to see if it's possible to make LRA handle 
>> CISC addressing modes like memory indirect, autoincrement, autodecrement, 
>> and others that the old reload handles at least somewhat.  Ideally LRA 
>> should do a better job; right now I believe it doesn't really do these 
>> things at all.  Targets like pdp11 and vax would like these.
> 
> So what does it do now?  Break every more complex addressing mode apart
> again?  Or ICE?  Or something in between?

The former.  LRA does handle some cases but not all that the target permits and 
not as many as the old reload.

Example:

unsigned int cksum (unsigned int *buf, unsigned int len)
{
    unsigned int ret = 0;
    do {
        ret += *buf++;
    } while (--len != 0);
    return ret;
}

The loop looks like this:

L_2:
        add     (r2)+,r0
        sob     r1,L_2

which is what I would expect.  Now throw in an indirection:

Old reload produces this loop:

L_2:
        add     @(r2)+,r0
        sob     r1,L_2

while LRA doesn't understand it can use the autoincrement indirect mode:

L_2:
        mov     (r2)+,r3
        add     (r3),r0
        sob     r1,L_2

This is from a GCC 13.0 test build of last June, with -O2 -m45, with and 
without -mlra.

    paul

Reply via email to