RFC: kill ORIGINAL_REGNO

Steven Bosscher stevenb@suse.de
Tue Apr 27 13:55:00 GMT 2004


Hi,

The current format of a REG rtx is "i00", with:
- op1 -> regno (REGNO)
- op2 -> original regno before regalloc (ORIGINAL_REGNO)
- op3 -> reg_attrs (REG_ATTRS)

In the only major ORIGINAL_REGNO user, regrename.c, we seem to be only interested
in testing if ORIGINAL_REGNO (reg) == REGNO (reg), in which case it must have been
a hard reg from an asm statement.  This could just be a flag on a REG instead.  Other
reasons for ORIGINAL_REGNO are purely cosmetic, for rtl dumps and verbose asm,
but IMHO one can just read the RTL dumps to see what happened.  Basically, there is
no real necessity for ORIGINAL_REGNO as far as I can tell.

So ORIGINAL_REGNO can and should go away, I think.  This would make the format of
a reg "i0", ie. it saves a few bytes for a REG rtx.  Also, since a MEM rtx is also of
format "i0", killing ORIGINAL_REGNO makes MEMs and REGs of the same size again,
which puts them in the same GC pages.  I expect this to give us a little speedup, but I'll
have to test this patch a little better to make sure...

As a side effect, gen_raw_REG can go away because the only thing it does extra
compared to gen_rtx_raw_REG is setting ORIGINAL_REGNO.

I've only lightly tested this patch: bootstrapped and tested C only on i686.  If the patch
looks OK and everyone agrees that we don't need to preserve ORIGINAL_REGNO just
for pretty printing, I'll test it more properly and resubmit it for inclusion.

Gr.
Steven




-------------- next part --------------
A non-text attachment was scrubbed...
Name: kill_ORIGINAL_REGNO.diff
Type: application/octet-stream
Size: 26884 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040427/9b4bc65c/attachment.obj>


More information about the Gcc-patches mailing list