This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Peepholes obsolete / new peepholes


  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]