On Sat, May 03, 2025 at 07:42:22AM -0600, Jeff Law wrote:
> On 5/3/25 4:52 AM, Richard Biener wrote:
> >On Fri, 2 May 2025, Paul Koning wrote:
> >>>On May 2, 2025, at 12:27 PM, Maciej W. Rozycki <ma...@orcam.me.uk> 
> >>>wrote:
> >>Indeed, I have noticed that LRA doesn't take advantage of PDP-11 (and I
> >>would guess VAX) addressing modes not found in RISC type machines.  A
> >>notable example are the pre-dec and post-inc modes, and I think memory
> >>indirect (i.e., MEM(MEM(xyz)) modes).  What isn't clear to me is whether
> >>there is interest in LRA doing those things, or if the answer is that
> >>they only are part of reload and therefore now unsupported.  I would
> >>like to be able to take advantage of those features, but have not dug
> >>into it so far -- modern register alllocators are rather intimidating
> >>beasts.
> >
> >I think the auto-inc/dec addressing modes are used by many targets so
> >there's definitely the chance to adapt LRA (and/or the auto-inc/dec pass)
> >to handle these better.

Yup.  If there is a benefit to it, it will be done.  It isn't especially
difficult to do, unless I am missing something of course.

> There's also the chance this is easier to pull
> >off when we do not have to care for the IRA + reload combo not regressing.
> Yup.  There's no inherent reason why an auto-inc/auto-dec target won't 
> work with LRA  (we have some in the tree), but there's probably places 
> that support can be improved.

Absolutely.  And a lot can already be done by the instruction combiner.

> >As for MEM(MEM(xyz)) addressing modes I'm less sure - I suppose those
> >are usually formed at RTL expansion time (rather than, say, by
> >RTL combine)?  If PDP-11 is the only target with those then it might
> >be easier to recover those post-LRA during late-combine or peephole
> >or alternatively in a target specific pass?  But of course I know
> >nothing about the constraints of said addressing mode or the challenges
> >those present to LRA.
> Double-indirect is *very* uncommon.  I wouldn't want to pollute LRA with 
> support that for those addressing modes if we could avoid it.  Pushing 
> it to the target seems better from an overall project maintenance 
> standpoint, though it may not be the best solution for the targets which 
> support double-indirect addressing modes.

It is pretty hard to work with double-indirect things, often have to
make sure the two memory accesses are not to the same address, etc.


Segher

Reply via email to