This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Peepholes obsolete / new peepholes
- To: Kazu Hirata <kazu at hxi dot com>
- Subject: Re: Peepholes obsolete / new peepholes
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Tue, 15 Aug 2000 08:36:41 -0600
- cc: gnuh8 <gnuh8 at pcserv dot demon dot co dot uk>, gcc <gcc at gcc dot gnu dot org>
- Reply-To: law at cygnus dot com
In message <41ECF07CC183D111A6F800805FEDAB190CE6CC@EXCHANGE1>you write:
> > Specifically if we have a memory reference like
> > (mem:mode (plus (pseudo) (const_int modesize))
> >
> > And the pseudo is dead after that instruction then we can try
> > to turn it into
> > a preinc/predec instruction (we can clobber the pseudo as we
> > know it's not
> > used again).
> >
> > I would think this would be a relatively simple extension to flow.c
>
> My patch for this turned out to be relaxing the predicate for determining
> whether to go for pre/post-inc/decrement. Please see the attached.
It also occurred to me a similar transformation could be made for
post-inc stuff.
> One thing that I am worried about is that somebody that wrote the code
> thought that "a standard addressing mode would be better". That probably
> means that on some machine it's better to do (mem (plus (reg) 1)) rather
> than (mem (pre_inc (reg))).
If that's the case, then the way we should deal with it is ADDRESS_COST
rather than an arbitrary choice that doesn't allow any target to DTRT.
> If people think this is correct, I'll wrap it up and submit it with a
> ChangeLog.
I think Richard pointed out a potential problem with the current patch, but
I believe that can be fixed by refining the patch to work when the
candidate register dies, but is not set by the current insn.
jeff