This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: RFC: Remove REG_WAS_0.


Hi Kazu,

Kazu Hirata wrote:
Hi Stephane,


Instead of having such REG_WAS_ note, I would have liked to have
access to a rtx giving the value of each register.  Similar to what
we do in cse reg where we keep up the last rtx assigned to each reg.


The part of m68hc11.c that uses REG_WAS_0 tries to achieve the same
effect as move2add, except that you do so on registers that satisfy
H_REG_P only as you point out in

http://gcc.gnu.org/ml/gcc-patches/2003-04/msg00057.html

I'll do something so you can cleanly use move2add, which should be
better because even if REG_WAS_0 worked as you expected, you could
only go from (const_int 0) to either (const_int 1) or (const_int -1),
whereas with move2add, you can go from (const_int N) to (const_int N +
1) or (const_int N - 1) for any integer N using inc, inx, and iny
instructions.  Correct?

Kazu Hirata


The problem I had with mov2add was that the rtx_cost does not know to which register the value is assigned. I don't want to have an add for some registers (soft reg, reg D) but want it for others (X, Y).

A second problem is that I have a lot of patterns that must be split and after
that it is no longer possible to run cse reg pass.  This is because
I come up with several insns that are not understood correctly (swap of
2 registers basically).  After those split there are cases where I could
optimize more based on the value of previous registers.

Stephane

--
        Home                           Office
E-mail: stcarrez@nerim.fr              Stephane.Carrez@solsoft.com
WWW:    http://stcarrez.nerim.net      http://www.solsoft.com
        Free the Software!             Simplifying Security Policy Management



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